haddock.libs.libaa2cg module
Reduces complexity of protein residue to the MARTINI coarse grained model: CA, O, Bead(s) in specific atom location.
Reference: Monticelli et al. The MARTINI coarse-grained force field: extension to proteins. J. Chem. Theory Comput. (2008) vol. 4 (5) pp. 819-834
Martinize Script from Tserk Wassenaar
Uses Biopython to parse the structure and DSSP output. Uses pieces of the martinize-1.1.py script to convert the SS types
Outputs a coarse grained pdb file (*_ss.pdb) with assigned bfactors.
Outputs a tbl file to map the beads to the atoms they represent.
- Updates
Updated python version to 2.6 to support isdisjoint() set method in DSSP.py (JR Apr 2012)
Residues that DSSP can’t handle (incomplete backbone f ex) treated as coil (JR Apr 2012)
Update to_one_letter_code library to protein_letters_3to1 (Jorge Roel 2017)
Inclusion of fake beads for corresponding amino-acids <SCd> (Jorge Roel 2017)
Changed the mapping routine to include DNA bead types (Rodrigo Honorato 2018)
Implemented feature to check if nucleic acid is a candidate for hbond (Rodrigo Honorato 2018)
- haddock.libs.libaa2cg.add_dummy(bead_list, rng, dist, n)[source]
Place the
SCD*dummy beads around the last bead of a residue.The beads are laid out along a randomly oriented axis through the parent bead: the first at
+dist, the second (if any) at-dist, so that a pair straddles the parent symmetrically. Only the orientation is random.- Parameters:
bead_list –
(name, coordinates)pairs of the residue’s real beads. The dummy beads are attached to the last one.rng –
random.Randominstance used to orient the dummy beads.dist – Distance from the parent bead, in angstrom (see
map_cg).n – Number of dummy beads, 1 or 2.
- Returns:
Mapping of bead name (
SCD1,SCD2) to its coordinates.
- haddock.libs.libaa2cg.center_of_mass(entity, geometric=False)[source]
Returns gravitic [default] or geometric center of mass of an Entity. Geometric assumes all masses are equal (geometric=True)
- Parameters:
entity
geometric
Returns:
- haddock.libs.libaa2cg.create_file_with_cryst(pdb_file: str) None[source]
This function creates a new pdb because the CRYST line is missing from the pdf file. This line is necessary for DSSP.
- Parameters:
output – str
pdb_file – str
- Returns:
pdb_file_copy – str
- haddock.libs.libaa2cg.determine_hbonds(structure: Structure)[source]
- Parameters:
structure
Returns:
- haddock.libs.libaa2cg.determine_ss(structure: Structure, skipss: bool, pdbf_path: str) Structure[source]
Determine secondary structures from input structure
- Parameters:
structure
skipss
pdbf_path
- Returns:
structure
- haddock.libs.libaa2cg.gen_cg_filename(output_dir: str, input_fname: str, force_field: str | None = None, ext: str | None = None) str[source]
Helper function to standarize CG filename from input file.
- Parameters:
output_dir (str) – Where to write the file.
input_fname (str) – Name of the original input PDB file.
force_field (Optional[str], optional) – Name of the force-field, by default None
ext (Optional[str], optional) – File extension, by default None
- Returns:
cg_fname (str) – Name of the CG file.
- haddock.libs.libaa2cg.gen_cg_tbl_backmapping_fname(output_dir: str, input_fname: str) Path[source]
Helper function to generate CG backmapping retraints filename.
- Parameters:
output_dir (str) – Where to write the file.
input_fname (str) – Name of the original input PDB file.
- Returns:
tbl_file_name (Path) – Name of backmapping restraint filename.
- haddock.libs.libaa2cg.hash(x, y)[source]
Makes a dictionary from two lists.
- Parameters:
x
y
Returns:
- haddock.libs.libaa2cg.map_cg(chain, rng)[source]
- Parameters:
chain
rng –
random.Randominstance used to orient the dummy beads.
Returns:
- haddock.libs.libaa2cg.martinize(input_pdb: str, output_path: str, skipss: bool, seed: int = 917) tuple[str, bool][source]
Converts an all-atom (AA) PDB structure into a coarse-grained (CG) model using a MARTINI2.2 mapping and generating CG-to-AA restraints for backmapping. Optionally uses secondary structure for mapping.
- Parameters:
input_pdb (str) – Path to the input AA PDB file.
output_path (str) –
- Directory where the output files will be written.
A CG PDB file (
*_cg.pdb)A restraint table (
*_cg_to_aa.tbl)
skipss (bool) – If True, skips secondary structure assignment (DSSP step). If False, assigns secondary structure and encodes it into HADDOCK-compatible B-factors.
seed (int) – Pseudo-random seed used to orient the
SCD*dummy beads.
- Returns:
tuple[str, bool] – cg_pdb_name: Path to the generated CG PDB file. shape: True if at least one residue with name “SHA” (shape bead) is detected in the structure, False otherwise.
- haddock.libs.libaa2cg.rename_nucbases(structure: Structure) None[source]
Inplace residue renaming according to HADDOCK ones.
- Parameters:
structure (Bio.PDB.Structure.Structure) – Input structure