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

Semin Lee seminlee at gmail.com
Fri Mar 28 23:27:39 UTC 2008


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




More information about the BioRuby mailing list