1
$\begingroup$

What are a 'Structure' and a 'Model' in BioPython?

Why did they incorporate 'structure' and 'model' instead of 'Protein' as objects?

$\endgroup$
3
  • $\begingroup$ You mean why they chose that name? And are these only for proteins? Can't they describe RNA molecules for instance? Or other chemical species? $\endgroup$
    – terdon
    Commented Apr 14 at 15:30
  • 1
    $\begingroup$ This question is similar to: How does BioPython generate IDs for atoms, residues, chains, and structures?. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. $\endgroup$
    – pippo1980
    Commented Jul 29 at 19:28
  • $\begingroup$ Thanks @pippo1980 its fair to allow the OP a few days to edit their question, but otherwise the question should be closed. $\endgroup$
    – M__
    Commented Jul 30 at 1:28

1 Answer 1

2
$\begingroup$

From How does BioPython generate IDs for atoms, residues, chains, and structures? accepted answer (answer link) :

When reading PDB file ("1fat.pdb" as an example):

from Bio.PDB import *

parser = PDBParser()
structure = parser.get_structure("PHA-L", "1fat.pdb")

The Structure object follows the so-called SMCRA (Structure/Model/Chain/Residue/Atom) architecture :

  1. A structure consists of models
  2. A model consists of chains
  3. A chain consists of residues
  4. A residue consists of atoms

Biopython will automatically generate ids for models, chians, residues and atoms separately.

The model id is an integer which denotes the rank of the model in the PDB file. The model id starts at 0.

The chain id is specified in the PDB file, and is a single character (typically a letter).

The residue id is a tuple with three elements:

  1. The hetero-flag: this is 'H_' plus the name of the hetero-residue (e.g. 'H_GLC' in the case of a glucose molecule), or 'W' in the case of a water molecule.
  2. The sequence identifier in the chain, e.g. 100
  3. The insertion code, e.g. 'A'. The insertion code is sometimes used to preserve a certain desirable residue numbering scheme.

The atom id is simply the atom name (eg. 'CA').

You can check the id like this:

import itertools
# for convenience, we just check the first three id
for model in itertools.islice(structure.get_models(), 3):
    print(f"Model: {model.id}")
    for chain in itertools.islice(model.get_chains(), 3):
        print(f"Chain: {chain.id}")
        for residue in itertools.islice(chain.get_residues(), 3):
            print(f"Residue: {residue.id}")
            for atom in itertools.islice(residue.get_atoms(), 3):
              print(f"Atom: {atom.id}")

The output is like this:

enter image description here

The hetero-flag and insertion code in residue id are all empty in the example.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.