[BioRuby] bug in residue.rb

Moses M. Hohman mmhohman at northwestern.edu
Fri Apr 14 04:15:28 UTC 2006


Hi Goto and Mikael,

I'd be happy to help write more unit tests for the PDB parser if that  
would be helpful. Please let me know (I am already a bioruby  
committer - I haven't done much in quite a while though).

Moses

On Apr 13, 2006, at 10:27 AM, GOTO Naohisa wrote:

> Hi,
> Thank you for reporting bugs.
> Because we extremely changed PDB parser from 0.6.4 to 1.0,
> there might be more and more bugs.
>
> On Thu, 13 Apr 2006 08:42:09 -0400
> Mikael Borg <mikael.borg at utoronto.ca> wrote:
>
>> Hi, the [] method for Bio::PDB::Residue stopped working when I  
>> upgraded from
>> bioruby-0.6.4 to bioruby-1.0.
>>
>> I believe the problem lies in line 86 of bio-1.0.0/lib/bio/db/pdb/ 
>> residue.rb:
>>
>>       #Keyed access to atoms based on element e.g. ["CA"]
>>       def [](key)
>>         atom = @atoms.find{ |atom| key == atom.element }
>>       end
>>
>> Should this be something like
>>
>>       #Keyed access to atoms based on element e.g. ["CA"]
>>       def [](key)
>>         atom = @atoms.find{ |atom| key == atom.name.strip}
>>       end
>>
>> as atom.element==nil when I read in a pdb file?
>>
>> When a pdb file is parsed, the white space surrounding the atom.name
>> record is not removed, so e.g. atom.name=" CA ", which is why I  
>> had to strip
>> atom.name.
>
> I previously thought that the white spaces may have some literal
> meanings, but I'm now feeling inconvenience for the spaces.
> I'll change atom.name (and other methods like this) to return a
> stripped string (e.g. "CA"), if this dosn't make fatal errors.
>
> -- 
> Naohisa GOTO
> ngoto at gen-info.osaka-u.ac.jp
> Department of Genome Informatics, Genome Information Research Center,
> Research Institute for Microbial Diseases, Osaka University, Japan
>
> _______________________________________________
> BioRuby mailing list
> BioRuby at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioruby
>




More information about the BioRuby mailing list