Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by nbryans for Getting residue number and residue name in Biopython PDB module

From looking at the API (and at what is available to chain via the command dir(chain)), I can see that there is a method get_residues(). Looking at one of the residues contained, I can see that there is a function get_resname(). Using these, one solution for you problem might be:

from Bio import *from Bio.PDB.PDBParser import PDBParserfrom Bio.PDB.Polypeptide import PPBuilderstructure = PDBParser().get_structure('5bmy', '5bmy.pdb')    model = structure[0]chain = model['A']for i in chain.get_residues():    print(i.get_resnames())

This gives a solution that doesn't need pymol.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>