[BioRuby] Bio::PDB parsing problem (1B2M)

Naohisa GOTO ngoto at gen-info.osaka-u.ac.jp
Tue Apr 1 10:59:24 UTC 2008


Hi Semin,

Thank you for reporting bugs and patches.

The patch chain.diff seems good. 
I changed only to capture ArgumentError and committed into CVS.
In addition, Bio::PDB#seqres is also changed because the
Bio::AminoAcid.three2one is also used in the method.

The patch pdb.diff would work in most cases, but might break things
in some rare cases. I inserted "cResidue = nil" and "cLigand = nil"
in the place after the cChain have been changed, and committed into CVS.

Please see changes in below CVS commit mail.
http://lists.open-bio.org/pipermail/bioruby-cvs/2008-April/001606.html

Cheers,

Naohisa Goto
ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org


On Tue, 01 Apr 2008 03:12:38 +0100
Semin Lee <seminlee at gmail.com> wrote:

> Hi AlexG,
> 
> Please find attached two patch files. I don't think those patches are 
> ideal solution, but it seems working fine. As for the 'aaseq' method of 
> Chain class, I think it would be nice to have more abstracted method 
> like 'seq', so it works for any kinds of polymers in PDB.
> 
> Cheers,
> Semin
> 
> 
> Alex Gutteridge wrote:
> > Hi Semin,
> >
> > Definately a parser error - the combined HETATM/ATOM chains are 
> > confusing it, but they shouldn't. If you have the time and the 
> > inclination then patches are very welcome. If not, I can try and take 
> > a look next week.
> >
> > AlexG
> >
> > On 28 Mar 2008, at 23:27, Semin Lee wrote:
> >> Hi guys,
> >>
> >> I've got some problems when parsing 1B2M PDB file using Bio::PDB. It 
> >> doesn't seem to parse chain C to E properly. I'm currently using 
> >> BioRuby gem ver. 1.2.1 and Ruby 1.8.6 on Mac OS X Leopard.
> >>
> >> >> require "bio"
> >> => true
> >> >> require "open-uri"
> >> => true
> >> >> pdb = 
> >> Bio::PDB.new(open("http://www.rcsb.org/pdb/files/1b2m.pdb").read)
> >> => #<Bio::PDB entry_id="1B2M">
> >> >> p pdb.models.first.chains
> >> ArgumentError: ArgumentError
> >>       from 
> >> /opt/local/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/data/aa.rb:184:in 
> >> `three2one'
> >>       from 
> >> /opt/local/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/db/pdb/chain.rb:192:in 
> >> `aaseq'
> >>       from 
> >> /opt/local/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/db/pdb/chain.rb:186:in 
> >> `each'
> >>       from 
> >> /opt/local/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/db/pdb/chain.rb:186:in 
> >> `aaseq'
> >>       from 
> >> /opt/local/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/db/pdb/chain.rb:178:in 
> >> `inspect'
> >>       from (irb):4:in `p'
> >>       from (irb):4
> >> >>
> >>
> >> a strange error occurred, but I just overrided(?) 'aaseq' method to 
> >> see what happens,
> >>
> >> >> module Bio
> >> >>   class PDB
> >> >>     class Chain
> >> >>       def aaseq
> >> >>         ""
> >> >>         end
> >> >>       end
> >> >>     end
> >> >>   end
> >> => nil
> >> >> pp pdb.models.first.chains
> >> [#<Bio::PDB::Chain id="A" model.serial=nil residues.size=104 
> >> heterogens.size=0 aaseq="">,
> >> #<Bio::PDB::Chain id="B" model.serial=nil residues.size=104 
> >> heterogens.size=0 aaseq="">,
> >> #<Bio::PDB::Chain id="C" model.serial=nil residues.size=1 
> >> heterogens.size=1 aaseq="">,
> >> #<Bio::PDB::Chain id="D" model.serial=nil residues.size=0 
> >> heterogens.size=0 aaseq="">,
> >> #<Bio::PDB::Chain id="E" model.serial=nil residues.size=0 
> >> heterogens.size=0 aaseq="">,
> >> #<Bio::PDB::Chain id=" " model.serial=nil residues.size=0 
> >> heterogens.size=92 aaseq="">]
> >> => nil
> >> >>
> >>
> >> Now it doesn't complain, but Bio::PDB::Chain for chain D and E have 
> >> wrong number of residues and heterogens. In the 1B2M PDB file, each 
> >> chain D and E also has a RNA residue and a heterogen, U34, just like 
> >> chain C. However, Bio::PDB::Chain for chain D and E have no residues 
> >> and heterogens. Does anyone have any ideas? Or, am I missing something?
> >>
> >> Cheers,
> >> Semin
> >>
> >> _______________________________________________
> >> BioRuby mailing list
> >> BioRuby at lists.open-bio.org
> >> http://lists.open-bio.org/mailman/listinfo/bioruby
> >>
> >
> 
> 



More information about the BioRuby mailing list