[BioRuby] bug in residue.rb

Mikael Borg mikael.borg at utoronto.ca
Thu Apr 13 12:42:09 UTC 2006


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.

Regards,

Mikael Borg




More information about the BioRuby mailing list