qp.structure.missing

Build missing residues and atoms using Modeller

Usage:

>>> from qp.structure import missing
>>> pdb = "1lnh"

# Parse PDB file, filling in missing residues
>>> residues = missing.get_residues("path/to/PDB.pdb")

# Write alignment file
>>> missing.write_alignment(
...     residues,
...     pdb,
...     "path/to/PDB.pdb",
...     "path/to/ALI.ali"
... )
>P1;1lnh (template from original PDB file)
structureX:1lnh.pdb:FIRST:@ END::::::
--------GHKIKGTVVLMRKNVLDVNSVTSV-------------TLDTLTAFLGRSVSLQLISAT...
>P1;1lnh_fill (full sequence)
sequence:::::::::
MLGGLLHRGHKIKGTVVLMRKNVLDVNSVTSVGGIIGQGLDLVGSTLDTLTAFLGRSVSLQLISAT...

# Run Modeller with the given alignment file
>>> missing.build_model(
...     residues,
...     pdb,
...     "path/to/PDB.pdb",
...     "path/to/ALI.ali",
...     "path/to/OUT.pdb"
... )

Optimization level (optimize argument in missing.build_model):

    1. No optimization. Missing coordinates filled in using Modeller’s topology library.

    1. Optimize missing residues and residues with missing atoms only. (Default)

    1. Optimize the entire structure. Hetero atoms are included but treated as rigid bodies.

Note

Non-standard residues (substrates, cofactors, and other HETATM entries) are preserved as rigid bodies by Modeller and any missing atoms in these residues will not be modeled. A warning is emitted listing the non-standard residues encountered during parsing.

Functions

build_model

Run Modeller to build missing residues and atoms.

clean_termini

Remove unresolve amino acids from the N- and C-termini.

define_residues

Access a look up table of standard and non-standard amino acids.

delete_clashes

Delete residues with clashes from a PDB file and rewrite the PDB file.

fix_numbering

Handles insertion codes from Modeller.

get_chain_order

Get the order of chains in a PDB file.

get_residues

Extract residues from a PDB file, including missing residue annotations.

transfer_numbering

Transfer residue numbers and chain IDs from template to built model.

write_alignment

Write a Modeller alignment file for filling missing residues.