[BioRuby] bio.pdb doubt

K. Shameer shameer at ncbs.res.in
Mon Feb 18 05:16:03 UTC 2008


Dear Naohisa and Alex,

Thanks for the links and the sample code.
I have one more doubt :) .
Is there any method to check whether a protein is multichain/single chain
using BioRuby. I checked in BioRuby in Anger document and wiki, but I
couldnt find it (May be am missing something important)

Thanks,
K. Shameer
NCBS - TIFR


> You can use Bio::PDB#find_atom or Bio::PDB#find_residue methods.
>
>   require 'bio'
>
>   # reading PDB data
>   pdb = Bio::FlatFile.open("pdb1a0d.ent") { |f| f.next_entry }
>
>   # using Bio::PDB#find_atom
>   atoms = pdb.find_atom do |atom|
>     (atom.chainID == "A" and atom.resSeq >= 22) or
>     (atom.chainID == "B" and atom.resSeq <= 50)
>   end
>   print atoms.to_s
>
>   print "\n"
>
>   # the same thing can be done by using Bio::PDB#find_residue
>   residues = pdb.find_residue do |residue|
>     (residue.chain.id == "A" and residue.resSeq >= 22) or
>     (residue.chain.id == "B" and residue.resSeq <= 50)
>   end
>   print residues.to_s
>
>




More information about the BioRuby mailing list