How to do it...

Take a look at the following steps:

  1. Let's parse the file. We just use the MMCIF parser instead of the PDB parser:
from Bio import PDBparser = PDB.MMCIFParser()p53_1tup = parser.get_structure('P53', '1tup.cif')
  1. Let's inspect the following chains:
def describe_model(name, pdb):    print()    for model in p53_1tup:        for chain in model:            print('%s - Chain: %s. Number of residues: %d. Number of atoms: %d.' %                  (name, chain.id, len(chain), len(list(chain.get_atoms()))))describe_model('1TUP', p53_1tup)

The output will be as follows:

1TUP - Chain: E. Number of residues: 43. Number of atoms: 442.1TUP - Chain: F. Number of residues: 35. Number of atoms: 449.1TUP - Chain: A. Number of residues: 395. Number of atoms: 1734.1TUP - Chain: B. Number ...

Get Bioinformatics with Python Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.