moleculekit.tools.preparationdata.
PreparationData
¶Bases: object
Results of the system preparation and optimization steps.
Contains the results of an optimization operation, notably, for each residue name, id, and chain, the corresponding pKa and protonation state.
The most important properties are accessible via the .data property, a pandas DataFrame. As such, they can be subset, converted, and saved in several ways (see examples below).
Examples
>>> tryp = Molecule("3PTB")
>>> tryp_op, ri = proteinPrepare(tryp, returnDetails=True)
>>> ri
PreparationData object about 290 residues.
Unparametrized residue names: CA, BEN
Please find the full info in the .data property, e.g.:
resname resid insertion chain pKa protonation flipped buried
0 ILE 16 A NaN ILE NaN NaN
1 VAL 17 A NaN VAL NaN NaN
2 GLY 18 A NaN GLY NaN NaN
3 GLY 19 A NaN GLY NaN NaN
4 TYR 20 A 9.590845 TYR NaN 14.642857
. . .
>>> "%.2f" % ri.data.pKa[ri.data.resid==189]
'4.95'
>>> ri.data.to_csv("/tmp/report.csv")
data
¶A pandas DataFrame with these columns: resname “Residue name, as per the original PDB”, resid “Residue ID”, insertion “Insertion code (resid suffix)”, chain “Chain”, pKa “pKa value computed by propKa”, “protonation” Forcefield-independent protonation code, flipped “Whether the residue was flipped during the optimization”, buried “Fraction of residue which is buried”, membraneExposed “Whether residue is exposed to membrane”, etc.
DataFrame
object
propkaContainer
¶Detailed information returned by propKa 3.1.
propka.molecular_container.Molecular_container
findHbonds
(angleCutoff=30.0, distanceCutoff=3.4)¶Return a list of H bonds determined by pdb2pqr.
Lifted from the “hbond.py” extension of pdb2pqr.
Residue information of the donor and acceptor atoms returned are of type pdb2pqr.src.structures.Atom and their information can be accessed e.g. as follows:
atom.name atom.serial atom.residue.__str__() atom.residue.name …
A list of dicts containing donor (Atom), acceptor (Atom), hydrogen (Atom), distance (float), angle (float)
for each hydrogen bond found by pdb2pqr.
Example
>>> m=Molecule("3ptb")
>>> mp, md = proteinPrepare(m, returnDetails=True)
>>> hlist=md.findHbonds()
>>> hlist[0]['donor'].name
'N'
>>> hlist[0]['donor'].residue.__str__()
'VAL A 17'
>>> hlist[0]['acceptor'].name
'O'
>>> hlist[0]['acceptor'].residue.__str__()
'ASP A 189'
getTerminiBuriedness
()¶Compute the buriedness of termini.
Returns a dictionary with keys N and C. Each value is a list, possibly empty, containing the buried fraction (as per propka).
A dictionary, as above.
getTerminiHbonds
()¶Check if the termini are involved in H bonds.
Returns a dictionary with keys N and C. Each value is a list, possibly empty, containing the H bonds involving respectively the N atom of the N terminus and the O atoms of the C terminus.
A dictionary, as above.
reprepare
()¶Repeat the system preparation, after the user edited the .data table.
You should only modify the value of the .data.forced_protonation column on the basis of the values in the .data.resid, .data.insertion, .data.chain attributes. Any other change will be ignored.
mol_out (Molecule) – the molecule titrated and optimized. The molecule object contains an additional attribute,
resData (ResidueData) – a table of residues with the corresponding protonation states, pKas, and other information
Examples
mol, prepData = proteinPrepare(Molecule(“3PTB”), returnDetails=True) d = prepData.data d.loc[d.resid == 40, ‘forced_protonation’] = ‘HIP’ mHIP40, pHIP40 = prepData.reprepare()
moleculekit.tools.preparationdata.
prettyPrintResidue
(r)¶