Performing geometric operations
We will now perform computations with geometry information, including computing the center of mass of chains and whole models.In this recipe, we will learn how to use Biopython’s PDB module to calculate the masses of structures in our model. We’ll then use operations to find the geometric center of mass.
Getting ready
This recipe is made available in the Ch09/Ch09-3-geometric-operations.ipynb file.
How to do it...
Here are the steps to try this recipe:
- First, let’s retrieve the data:
from Bio import PDB
repository = PDB.PDBList()
parser = PDB.PDBParser() repository.retrieve_pdb_file('1TUP', pdir='.', file_format='pdb')
p53_1tup = parser.get_structure('P 53', 'pdb1tup.ent')
- Then, let’s recall the type of residues that we have with the following code:
my_residues = set()
for residue in p53_1tup.get_residues():
my_residues.add(residue.id[0])
print(my_residues)...