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

Semin Lee seminlee at gmail.com
Tue Apr 1 02:12:38 UTC 2008


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
>>
>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: chain.diff
URL: <http://lists.open-bio.org/pipermail/bioruby/attachments/20080401/17dd6ba7/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pdb.diff
URL: <http://lists.open-bio.org/pipermail/bioruby/attachments/20080401/17dd6ba7/attachment-0001.ksh>


More information about the BioRuby mailing list