htmd.builder.builder module#
- exception htmd.builder.builder.MissingAngleError(text, values=())#
Bases:
_MissingErrorType
- exception htmd.builder.builder.MissingAtomTypeError(text, values=())#
Bases:
_MissingErrorType
- exception htmd.builder.builder.MissingBondError(text, values=())#
Bases:
_MissingErrorType
- exception htmd.builder.builder.MissingParameterError(text, values=())#
Bases:
_MissingErrorType
- exception htmd.builder.builder.MissingResidueError(text, values=())#
Bases:
_MissingErrorType
- exception htmd.builder.builder.MissingTorsionError(text, values=())#
Bases:
_MissingErrorType
- htmd.builder.builder.convertDisulfide(mol, disu)#
Convert disulfide selection-string pairs to UniqueResidueID pairs.
- Parameters:
- Returns:
newdisu – The same pairs with each selection string resolved to a
UniqueResidueID.- Return type:
- htmd.builder.builder.detectCisPeptideBonds(mol, respect_bonds=False)#
Detect and warn about cis peptide bonds in a protein.
Projects the protein omega dihedrals and logs a warning for every frame and residue whose omega angle indicates a cis peptide bond.
- htmd.builder.builder.detectDisulfideBonds(mol, thresh=3)#
Automatically detect disulfide bonds in a molecule.
Finds all SG atoms in cysteine-like residues (resnames starting with “CY”) and returns pairs whose inter-sulfur distance is below thresh.
- Parameters:
- Returns:
disubonds – A list of pairs of
UniqueResidueIDobjects representing the detected disulfide bonds, sorted by residue ID.- Return type:
- Raises:
RuntimeError – If segment names are not defined, if multiple SG atoms are found in the same residue, or if a sulfur atom has more than one possible bond partner.
- htmd.builder.builder.embed(mol1, mol2, gap=1.3)#
Embed one molecule into another, removing overlapping residues.
Removes residues of mol2 that have collisions with atoms of mol1, then appends mol1 into mol2.
- Parameters:
- Returns:
newmol – The resulting Molecule object with mol1 embedded into mol2.
- Return type:
Examples
>>> merged = embed(memb, prot)
- htmd.builder.builder.minimalRotation(prot)#
Find the rotation around Z that minimizes the X and Y dimensions of the protein to best fit in a box.
Essentially PCA in 2D
- htmd.builder.builder.removeAtomsInHull(mol1, mol2, hullsel, removesel)#
Calculate the convex hull of an atom selection in mol1 and remove atoms within that hull in mol2.
- Parameters:
mol1 (
Molecule) – Molecule for which to calculate the convex hull.mol2 (
Molecule) – Molecule containing atoms to check for hull membership.hullsel (
str|ndarray) – An atom selection string, a boolean mask, or an integer index array (seeMolecule.atomselect) for atoms in mol1 from which to calculate the convex hull.removesel (
str|ndarray) – An atom selection string, a boolean mask, or an integer index array (seeMolecule.atomselect) for atoms in mol2 from which to remove those located within the hull.
- Return type:
- Returns:
- htmd.builder.builder.removeHET(prot)#
Remove all HETATM residues from a structure.
Each unique HETATM residue name is removed, assuming it is a bound ligand or other heteroatom group.
- htmd.builder.builder.removeLipidsInProtein(prot, memb, lipidsel='lipids')#
Calculates the convex hull of the protein. If a lipid lies inside the hull it gets removed.
This does not work well for lipids crossing out of the hull. If even one atom of the lipid is outside it will change the hull and will not get removed. I assume it will get removed by the clashes with the protein though.
- htmd.builder.builder.tileMembrane(memb, xmin, ymin, xmax, ymax, buffer=1.5)#
Tile a membrane in the X and Y dimensions to reach a specific size.
- Parameters:
- Returns:
megamemb – A tiled membrane Molecule covering the specified dimensions.
- Return type: