Question: Extracting residue name and residue ID from PDB.
0
gravatar for underoath006
2.9 years ago by
underoath0060 wrote:

I want to get residue name, residue ID pairs from a PDB file. Also, just to make sure, If I sort residues by ID and print residue name, I always get the sequence, correct?

Edit: I solved the residue name, but how to get a list of all residue numbers? I also wonder if there's a better solution and if I sort residues by ID and print residue name, would I always get the sequence?

from Bio.PDB.PDBParser import PDBParser
from Bio.PDB.Polypeptide import PPBuilder
structure = PDBParser().get_structure('5bmy', '5bmy.pdb')    
model = structure[0]
chain = model['A']
stored.residues = [1,2,3,4,5]
for i in stored.residues:
    print (chain[i].resname)
biopython pdb • 2.5k views
ADD COMMENTlink modified 2.9 years ago • written 2.9 years ago by underoath0060

Posting code you have tried ensures swift results for these type of questions.

ADD REPLYlink written 2.9 years ago by genomax76k

edited, plz see the main post

ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by underoath0060
0
gravatar for Petr Ponomarenko
2.9 years ago by
United States / Los Angeles / ALAPY.com
Petr Ponomarenko2.6k wrote:

Have you tried get_sequece() method from Bio.PDB.Polypeptide http://biopython.org/DIST/docs/api/Bio.PDB.Polypeptide-pysrc.html ?

ADD COMMENTlink written 2.9 years ago by Petr Ponomarenko2.6k

I'm not interested in the sequence per se, I want to get the residue number (ID).

ADD REPLYlink written 2.9 years ago by underoath0060
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 843 users visited in the last hour