[BioRuby] How to renumber a PDB file using BioRuby ?

K. Shameer shameer at ncbs.res.in
Thu Apr 10 04:17:49 EDT 2008


Dear Alex,

Thanks for your help

> You have to alter the number by atom rather than by residue. Altering
> the residue object directly used to work, but has been broken. Anyway,
> this seems to work for your purpose:
>
> require 'bio'
>
> pdb = Bio::PDB.new(File.read(ARGV[0]))
>
> pdb.each_atom do |atom|
>    atom.resSeq += 12
> end
> puts pdb

Sorry, this is exactly I want to do, I want to apply it in a whole atom
level, not residue level - this works well for me !

Once again Thank you Alex and Chen for quick and great help,
K. Shameer

>
> It would be good (IMHO) to have:
>
> require 'bio'
>
> pdb = Bio::PDB.new(File.read(ARGV[0]))
>
> pdb.each_residue do |residue|
>    residue.resSeq += 10
> end
>
> puts pdb
>
> Do the same thing, but currently changes to residue objects don't
> propagate back down to the atoms so the above code doesn't do anything
> useful.
>
> Alex Gutteridge
>
> Department of Biochemistry
> University of Cambridge




More information about the BioRuby mailing list