schrodinger.application.matsci.automated_martini_mapping_protein module¶
Map an all-atom protein structure to a coarse-grained one compatible with the Martini force field.
Copyright Schrodinger, LLC. All rights reserved.
- exception schrodinger.application.matsci.automated_martini_mapping_protein.OverlapError¶
Bases:
Exception
Error to raise when an atom is found in two different residue matches
- exception schrodinger.application.matsci.automated_martini_mapping_protein.MissingAtoms¶
Bases:
Exception
Exception raised when mapping fails.
- exception schrodinger.application.matsci.automated_martini_mapping_protein.MissingSecondaryStructure¶
Bases:
Exception
Exception raised when secondary structure is missing.
- class schrodinger.application.matsci.automated_martini_mapping_protein.CGStructBuilder(aa_struct, mapping_info)¶
Bases:
object
Create a coarse-grained structure based on all-atom structure’s mapping
- __init__(aa_struct, mapping_info)¶
Create an instance.
- Parameters:
aa_struct (structure.Structure) – The all-atom structure
mapping_info (dict) – The protin’s martini mapping information
- createCGStruct(all_hits)¶
Create a coarse-grained structure.
- Parameters:
all_hits (dict) – The mapping information
- Return type:
- Returns:
The coarse-grained structure
- addBackmapping(caps, mapped_atoms)¶
Record parent AA information on CG structure to aid in future reconstruction of the AA structure from the CG structure. Per each CG site type, store AA structure extract as CG structure property and record bonding information in CG particle atom properties. Also record as structure property the structure and bonding of terminal capping groups not corresponding to any particle.
- Parameters:
caps (dict) – Collection of the capping groups
mapped_atoms (dict) – Mappings of the CG particle index to the corresponding AA atom index
- findCapNeighbors(caps, mapped_atoms)¶
Find the neighbors of the capping groups. Add the capping group information to the coarse-grained structure.
- Parameters:
caps (dict) – Collection of the capping groups
mapped_atoms (dict) – Mappings of the CG particle index to the
- Return type:
list(tuple)
- Returns:
Contains the capping group and its neighbor particle atom name
- adjustHelixTerminal()¶
Correct for Martini’s use of slightly different site types for terminal neutral backbone sites in helices.
- findNTerminae()¶
Find the N-termini of the CG structure.
- Return type:
list(structure.Atom)
- Returns:
Contains the N-terminal atoms of the CG structure
- findCTerminae()¶
Find the C-termini of the CG structure.
- Return type:
list(structure.Atom)
- Returns:
Contains the C-terminal atoms of the CG structure
- static findBackboneChains(cg_struct)¶
Find the backbone chains in the CG structure.
- Parameters:
cg_struct (structure.Structure) – The coarse-grained structure
- Return type:
list(list(structure.Atom))
- Returns:
Contains the backbone chains in the CG structure
- addNewSite(a_site, site_info, a_match, a_residue, atom_idx, mapped_atoms, internal_sites)¶
Add a new site to the coarse-grained structure.
- Parameters:
a_site (str) – The site type
site_info (dict) – The site information from the mapping json file
a_residue (str) – Residue name as key from the json file
a_match (list(int)) – The atom indices from the AA structure matching to the site type SMARTS pattern
atom_idx (int) – The atom index from the AA structure
mapped_atoms (dict) – Mappings of the CG particle index to the corresponding AA atom index
internal_sites (dict) – The internal bonds for the site
- createNewSite(atom_idx, a_residue, a_residue_info, a_match, mapped_atoms, caps)¶
Create a new site in the coarse-grained structure.
- Parameters:
atom_idx (int) – The atom index from the AA structure
a_residue (str) – Residue name as key from the json file
a_residue_info (dict) – Contains residue SMARTS pattern, external bonding information, site mappings, colors, and names for different bead types.
a_match (list(int)) – The atom indices from the AA structure matching to the site type SMARTS pattern
mapped_atoms (dict) – Mappings of the CG particle index to the corresponding AA atom index
caps (dict) – Collection of the capping groups
- Return type:
list
- Returns:
atoms which should not be mapped if mapped particle is Nothing
- addBonds(a_residue_info, a_match, mapped_atoms, internal_sites)¶
Add bonds to the coarse-grained structure.
- Parameters:
a_residue_info (dict) – residue information from the mapping json file
a_match (list(int)) – The atom indices from the AA structure
mapped_atoms (dict) – Mappings of the CG particle index to the
internal_sites (dict) – The internal bonds for the site
- static getCutBonds(aa_struct, parent_atoms)¶
Collect the bonds of parent atoms that are cut, because of CG mapping.
- Parameters:
aa_struct (structure.Structure) – The all-atom structure
parent_atoms (list) – The parent atoms
- Return type:
list(tuple(int, int, int))
- Returns:
list of AA bonds that are cut
- getCommonValueProp(parent_atoms, property_name)¶
Find the most common value of a property among parent atoms.
- Parameters:
parent_atoms (list) – The parent atoms
property_name (str) – The property name
- Return type:
str
- Returns:
The most common value of the property among parent atoms
- class schrodinger.application.matsci.automated_martini_mapping_protein.Mapper(mapping_info, aa_struct)¶
Bases:
object
Mapper class to find mapping between all-atom and coarse-grained structures.
- __init__(mapping_info, aa_struct)¶
Create an instance.
- Parameters:
mapping_info (dict) – The protein’s Martini mapping information
aa_struct (structure.Structure) – The all-atom structure
- determineMapping()¶
Determine the mapping, using the Martini mapping information.
- Return type:
dict
- Returns:
The mapping information as a dictionary of atom index and the residue name, residue info, and match that the atom is in
- cleanHTerminals()¶
Clean unmapped H atoms bound to the N terminal N atom of a protein backbone
- storeMatchingHits()¶
Store matched atoms in a dictionary.
- Raises:
OverlapError – If an atom is found in two different residue matches
- Return type:
dict
- Returns:
A dictionary of atom index and the residue, residue info, and match that the atom is in
- checkMatchesContained()¶
Find matches that are subsets of other matches and eliminate them.
- static convertAlternateHtoCaps(res_info, H_Nterminal_info)¶
For most residues in chain the N terminus would be R’-NH-R’’ and the SMARTS patterns have only 1 H on the terminal N. This leads to two matches for the same residue but involving different H atoms. This function removes one of the two matches for backbone N terminations with NH2-R for proteins and places the unmapped hydrogen into a new unmapped group for backmapping
- Parameters:
res_info (dict) – information on a residue
H_Nterminal_info (dict) – information on unmapped H atoms for terminal
- static removeFirstH(res_info, H_Nterminal_info)¶
For most Proline residues in a chain the N terminus would be R’-N(-R’’)-R’’’ and the SMARTS patterns have no H on the terminal N. For prolines at the N terminus of a protein backbone chain sometimes this site is neutral (i.e., there is an H on the N atom) and this can lead to an unmapped H atom. A pattern has been added for such proleins and they map onto normal PRO Martini sites. The unmapped H atom needs to be tracked for recording backmapping information.
- Parameters:
a_residue_info (dict) – info on a N-terminal PRO residue
H_Nterminal_info (dict) – info on unmapped H atoms for terminal residues
- class schrodinger.application.matsci.automated_martini_mapping_protein.AutomatedMartiniProteinMapping(struct, keep_secondary_structure=True)¶
Bases:
object
Class to map an AA structure to a CG structure using the Martini mapping defined for protein residues.
- MULTI_MOL = 1¶
- __init__(struct, keep_secondary_structure=True)¶
Generate the CG structure from the AA structure. Using the residues in the mapping file, search the AA structure for matches, map the AA atom indices to a CG particle, generate and store the particles in a CG structure.
- Parameters:
struct (structure.Structure) – the AA structure to be coarse grained
keep_secondary_structure (bool) – retain the input protein secondary structure or not. Default is True.
- Return type:
- Returns:
The CG structure
- map()¶
Map the AA structure to the CG structure
- Return type:
- Returns:
The CG structure
- tagAAStructure()¶
Tag the AA structure with the CG structure’s information.
- class schrodinger.application.matsci.automated_martini_mapping_protein.StructuralHarmonicRestraints(struct, force_constant=3.585, target_distance=10.0)¶
Bases:
object
Class to generate harmonic restraints on the protein backbone atoms
- STRANDS_FC_KEY = 'force_constant'¶
- STRANDS_MIN_ANGLE_KEY = 'minimum_angle'¶
- STRANDS_APPLY_KEY = 'apply'¶
- MOL_GROUPS_KEY = 'groups'¶
- STRAND_RESTRAINTS_KEY = 'strand_restraints'¶
- EXCLUDE_RESTRAINTS_KEY = 'exclude_restaints_between_group_of_sites'¶
- EXTRA_SITES_RESTRAINTS_KEY = 'restrain_other_sites_in_protein_molecules'¶
- GROUP_MEMBERS_KEY = 'group_members'¶
- ATOMI_KEY = 'atom_i'¶
- ATOMJ_KEY = 'atom_j'¶
- DIST_KEY = 'distance'¶
- FC_KEY = 'fc'¶
- REST_BLOCK_SEP = ';'¶
- REST_PARAM_SEP = ','¶
- DEFAULT_FC = 3.585¶
- DEFAULT_RC = 10.0¶
- STRAND_TURN = 'strand_turn'¶
- __init__(struct, force_constant=3.585, target_distance=10.0)¶
Generate harmonic restraints on the protein backbone atoms
- Parameters:
struct (structure.Structure) – input cg structure
force_constant (float) – harmonic restraints’ force constant (kcal/mol/A^2)
target_distance (float) – largest distance (A) between backbone protein particles to be restrained
- addHarmonicRestraints()¶
Add harmonic restraints to the protein based on the restraints defined in the json file
- Return type:
- Returns:
The CG structure with restraints added as atom properties
- createRestraints()¶
Create the harmonic restraints
- storeRestraintsOnStruct()¶
Store the restraints on the structure as atom properties
- otherRestraints(mol, backbone)¶
Create the harmonic restraints for other particles that are not part of the backbone or a strand
- strandRestraints(backbone)¶
Create the harmonic restraints for the strands. In principle there should be a dihedral potential between side_chain(i)-backbone(i)-backbone(i+1)-side_chain(i+1) particles at the input geometry. Dihedrals were problematic when this was implemented so a distance restraint is applied between the input side chain particles to maintain the current geometry. This restraint is problematic if the dihedral angle is less than a certain value. The minimum_angle specifies this value and dihedrals less than this value are not restrained.
- sideChainS1(atom)¶
Find the side chain S1 atom for the given atom index
- Parameters:
atom (structure.Atom) – The atom
- Return type:
schrodinger.structure.atom.Atom or None
- Returns:
The side chain S1 atom, or None if not found
- backboneRestraints(backbone)¶
Create the harmonic restraints between backbone particles
- Parameters:
backbone (list) – The backbone atoms
- isInExcludedGroups(atom1_idx, atom2_idx)¶
Check if the atoms are supposed to be excluded from the restraints
- Parameters:
atom1_idx (int) – The first atom index
atom2_idx (int) – The second atom index
- Return type:
bool
- Returns:
True if the atoms are supposed to be excluded
- restraintBlock(atom1_idx, atom2_idx, distance, k_spring)¶
Create a restraint block
- Parameters:
atom1_idx (int) – The first atom index
atom2_idx (int) – The second atom index
distance (float) – The distance (A)
k_spring (float) – The force constant (kcal/mol/A^2)
- Return type:
dict
- Returns:
The restraint block
- addSingleRestraint(atom1, atom2, dist=None, k_spring=None, check_exclusion=True, check_distance_target=True)¶
Create a single restraint between two atoms
- Parameters:
atom1 (structure.Atom) – The first atom
atom2 (structure.Atom) – The second atom
dist (float) – The distance (A). If None, calculate from structure
k_spring (float) – The force constant (kcal/mol/A^2). If None, assigned by default
check_exclusion (bool) – Check if the atoms are supposed to be excluded from the restraints
check_distance_target (bool) – Check if the distance is within the target distance
- Return type:
list
- Returns:
The restraint between the two atoms
- backbone(molecule)¶
Find the backbone atoms in the protein
- Parameters:
molecule (structure.Molecule) – The molecule
- Return type:
list(schrodinger.structure.atom.Atom)
- Returns:
The backbone atoms
- excludedGroups(set_of_groups)¶
Find the groups to exclude from the restraints
- Parameters:
set_of_groups (dict) – The set of groups to exclude
- Return type:
list
- Returns:
The groups to exclude