[Biopython] Getting a list of residue numbers

Ahmad Abdelzaher underoath006 at gmail.com
Sat Apr 15 23:27:12 UTC 2017


Hi,

I know I can get residue names like this:

name = '1gdw.pdb'
structure=p.get_structure(name, name)
residue_name = []
for model in structure:
    for chain in model:
        for i in *residue_number*:
                residue_name.append(chain[i].resname)

However, I don't know of a way to get a list of *residue_number,* so I use
Pymol to do it!

import __main__
__main__.pymol_argv = ['pymol','-qc']
import pymol
from pymol import cmd, stored
pymol.finish_launching()
cmd.delete('all')
cmd.load(name)
stored.residues = []
cmd.iterate('name ca', 'stored.residues.append(resi)')
residue_number = [ int(x) for x in stored.residues ]

What is the biopython way of getting the residue numbers?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20170416/3c0cad8a/attachment.html>


More information about the Biopython mailing list