I'm new to Biopython and I'd like to extract the sequence of residues from a pdb file.
My two questions are:
- What is the simplest way to do this? (Esp. when there is more than one sequence) and
- Should I be worried about "PDBConstructionWarning: WARNING: Chain B is discontinuous"?
So far, I've obtained the residue sequence via:
p = PDBParser() structure = p.get_structure("1ppi", "1ppi.pdb") ppb=PPBuilder() for pp in ppb.build_peptides(structure): print(pp.get_sequence()) seq = pp.get_sequence().__str__()
This seems to work well for this molecule. However, is there an easier way, especially when there is more than one sequence?
For example, I've read that one can also do
res_list = Bio.PDB.Selection.unfold_entities(structure, 'R')
but res_list is not a sequence of residues in str, and I don't know how to convert the output from res_list to a str sequence.
In addition (or perhaps because I'm going through the PPBuilder), I've recently gotten a lot of warnings of the type:
/usr/local/lib/python3.8/site-packages/Bio/PDB/StructureBuilder.py:89: PDBConstructionWarning: WARNING: Chain A is discontinuous at line..
(For example, with
structure = p.get_structure("5owu", "5owu.pdb"))
I've seen a discussion about how to silence such warnings, but should I be worried about this? I've also noticed that when I get these warnings, pp builder seems to give me more sequences then are there.