ProtoCaller.IO.PDB package

This module includes a PDB parser which takes care of many details that are ignored by other PDB parsers. Here we take care of missing residues, missing atoms, disulfide bonds, modified residues and site residues in addition to the regular atom information. By doing so, ProtoCaller makes sure that the use of external tools which modify PDB files will not result in any data loss when e.g. feeding in a protein into Modeller and then PDB2PQR to prepare it while still keeping track of disulfide bonds.

The PDB class is highly structured into Chain, Chain into Residue and Residue into Atom classes. In addition, there are the MissingResidue and MissingAtoms classes which act as placeholders for missing elements in the PDB file.

This structure enables sophisticated manipulations of the PDB file inside ProtoCaller when the input PDB file is not readily usable and manually editing it would be non-trivial. An example would be the preparation of Sialyltransferase, where the PDB file contains a modified selenomethionine residues which the user might want to convert into methionine residues due to lack of parameters. Although this is currently achieved automatically in recent versions of ProtoCaller, one can easily imagine other situations where they might want to edit the PDB file. Such an example is Dihydrofolate Reductase where it is shown that when the same atom might have two alternative positions suggested in the PDB file, the user could choose one of them from inside ProtoCaller without needing to manually edit the PDB file.

Module contents

class ProtoCaller.IO.PDB.PDB(input)

Bases: ProtoCaller.IO.PDB.Chain.Chain, ProtoCaller.Utils.ConditionalList.ConditionalList

Represents a whole PDB file.

Parameters

input (str) – Name of the input PDB file.

property filename

Name of the file corresponding to the PDB object.

Type

str

filter(mask, type='residues')

Returns a selection based on a mask. E.g. mask=”chainID=’A’” returns all elements which belong to chain A.

Parameters
  • mask (str) – A conditional expression which is to be evaluated.

  • type (str) – The type of objects to be returned. One of “chains”, “residues” and “atoms”.

Returns

total_list – All elements satisfying the given conditions.

Return type

list

property numberOfChains

Returns the number of chains.

Type

int

property numberOfResidues

Returns the total number of Residues and MissingResidues.

Type

int

purgeAtoms(atoms)

Removes or keeps the selected atoms.

Parameters
  • atoms ([ProtoCaller.IO.PDB.Atom.Atom]) – Atoms to be removed or kept

  • mode (str) – One of “keep” and “discard” - either keeps only the selection or discards the latter.

purgeEmpty()

Removes empty elements.

purgeResidues(residues, mode)

Removes or keeps the selected residues.

Parameters
  • atoms ([ProtoCaller.IO.PDB.Atom.Atom]) – Residues to be removed or kept

  • mode (str) – One of “keep” and “discard” - either keeps only the selection or discards the latter.

reNumberResidues(start=1, custom_resSeqs=None, custom_iCodes=None)

Renumbers the residues.

Parameters
  • start (int, optional) – Initial index.

  • custom_resSeqs ([int] or None, optional) – A list of custom resSeqs. If None, residues are renumbered sequentially.

  • custom_iCodes ([str] or None, optional) – A list of custom iCodes. If None, residues are renumbered sequentially.

readPDB(filename)

Reads the input PDB.

property sequence

Returns the single-character sequence of all amino acids in the protein.

Type

str

static sortResidueList(residuelist)

list: A helper method which sorts the residues in the list by number.

totalResidueList(sort=True)

Returns only missing and non-missing residues with no HETATM molecules.

Parameters

sort (bool) – Whether to sort the residues by number.

Returns

total_res – All residues in the PDB file.

Return type

[ProtoCaller.IO.PDB.Residue.Residue]

property type

Returns “protein”. A potentially useful placeholder for more functionality in the future.

Type

str

writeHetatms(filebase=None)

Partitions every type of HETATM molecules into a separate PDB file.

Parameters

filebase (str or None) – Base name of the output files. Default: the original PDB name.

Returns

  • filenames ([str]) – The absolute paths of all output files.

  • moltypes ([str]) – Their corresponding moltypes.

writePDB(filename=None)

Writes the object as a PDB file.

Parameters

filename (str or None) – Name of the output file. Default: original filename.

Returns

filename – The absolute path to the written PDB file.

Return type

str