PDB atomic model

class mdk::pdb::Model

PDB model object. As opposed to Model, here we store atomic data, chiefly for the use in the derivation of full-atomic contact maps. Also, non-full-atomic contact maps may be derived; Model doesn’t contain such a method because it’s ill-defined for models obtained from Sequence file, which doesn’t have native residue positions.

Public Functions

Atom &addAtom(int serial, Residue *res = nullptr)

Add an atom to a residue.

Parameters
  • serial – Serial number of an atom

  • res – Parent residue, or nullptr

Returns

Reference to the added atom.

Residue &addResidue(int serial, Chain *chain = nullptr)

Add a residue to a chain.

Parameters
  • serial – Serial number of a residue to add.

  • chain – Parent chain or nullptr

Returns

Reference to the added residue.

Chain &addChain(char serial)

Add a chain with a specified serial character.

Parameters

serial – Serial character of the chain.

Returns

Reference to the added chain.

Contact &addContact()

Add a new contact.

Returns

Reference to the added contact.

Model() = default
explicit Model(mdk::Model const &coarse)

Construct a pdb::Model from a Model. Doesn’t extrapolate extra atoms, i.e. only CA atoms are in the final model.

Parameters

coarseModel from which to construct the PDB model.

void addContactsFromAtomOverlap()

Adds contacts based on the overlap of atoms. This method also derives types of contacts based on whether the atoms are in the backbone or the sidechain of an amino acid.

void addContactsFromResOverlap(param::Parameters const &params)

Adds contacts based on approximate residue overlap, given the aminoAcidRadii data from the parameter file.

Parameters

params – Parameter file with amino acid radii data.

mdk::Model coarsen()

Construct a mdk::Model from the PDB model. Collapses residues to a single Model residue and copies the contacts (if two atoms are connected, the residues containing them are connected in the final model).

Returns

A reduced (“coarsened”) model.

Public Members

std::unordered_map<int, Atom> atoms

A map from the serial number of an atom to the Atom structure. Note that the order of serial numbers is (1) not necessarily consecutive, (2) not starting from 0, in some degenerate cases. Also, adding new atoms doesn’t invalidate pointers or references.

std::unordered_map<int, Residue> residues

A map from residue serial number to Residue struct. Note that the order of serial numbers is (1) not necessarily consecutive, (2) not starting from 0, in some degenerate cases. Also, adding new residues doesn’t invalidate pointers or references.

std::unordered_map<char, Chain> chains

A map from the chain serial character to the chain.

std::vector<Contact> contacts

A vector of contacts. Note that references are (potentially) invalidated when adding new contacts.

Topology top

“Topology”, i.e. box shape for PBC.

struct Atom

A struct containing data for a single atom.

Public Members

int serial

PDB serial number of an atom. Zero-indexed.

int idxInRes

Index of an atom in the Residue::atoms list of the parent residue, or -1 if it’s not a part of any residue.

Residue *res

Parent residue.

Eigen::Vector3d r

(Native) position of the atom.

std::string type

Type of an atom (in the std::string form).

struct Chain

A struct containing PDB chain data.

Public Members

char serial

Serial (alphanumeric) character of a chain.

std::vector<Residue*> residues

Constituent resides of the chain. Ordered.

struct Contact

A struct containing contacts. Technically this isn’t represented 1-to-1 in the PDB data, but an unification of SSBONDs and LINKs is useful, especially for the reduction of the pdb::Model into Model.

Public Members

int idx

Index of the contact in contacts vector.

Atom *atom[2]

Pointers to atoms that comprise the contact.

std::string type

Type of contact. Takes (at this moment) values “SSBOND”, “NAT”, “NAT_BB”, “NAT_BS”, “NAT_SB”, “NAT_SS”.

double dist0

Native contact length.

struct Residue

A struct containing data for a PDB residue.

Public Functions

Atom *find(std::string const &type)

Find an atom belonging to the residue by the type. (Used primarily for finding CG atoms in SSBONDs).

Parameters

typeAtom type to find.

Returns

Pointer to found atom, or nullptr if such an atom has not been found.

Public Members

int serial

Serial number of a residue. 0-indexed.

int idxInChain

Index in the Chain::residues of the parent chain, or -1 if it’s not in any chain.

Chain *chain

Parent chain.

std::string type

Type of residue (in std::string form)

std::vector<Atom*> atoms

List of constituent atoms for the residue.