IMP logo
IMP Reference Guide  2.19.0
The Integrative Modeling Platform
IMP.EMageFit.domino_model.DominoModel Class Reference

Management of a model using DOMINO. More...

Detailed Description

Management of a model using DOMINO.

Note
This class is only available in Python.

Definition at line 34 of file domino_model.py.

Public Member Functions

def add_branch_and_bound_assignments_table
 BranchAndBoundAssignmentsTable enumerate states based on provided filtered using the provided the subset filter tables. More...
 
def add_exclusion_filter_table
 ExclusionSubsetFilterTable ensures that two particles are not given the same state at the same time. More...
 
def add_restraint
 Adds a restraint to the model. More...
 
def add_restraint_score_filter_table
 Add a RestraintScoreSubsetFilterTable to DOMINO that allows to reject assignments that have score worse than the thresholds for the restraints. More...
 
def align_rigid_bodies_states
 Aligns the set of structures considered for DOMINO sampling. More...
 
def create_coarse_assembly
 Simplify the assembly with a coarse representation. More...
 
def create_merge_tree
 Creates a merge tree from the restraints that are set already. More...
 
def do_sampling
 Do Domino sampling. More...
 
def get_assignment_and_RFs
 Return a line with texts for an assignment and the the reference frames of the RigidBodies in the subset. More...
 
def get_assignment_info
 Info related to an assignment. More...
 
def get_assignment_scores
 Returns a list with the values for the restraints on a subset of the components of the assembly. More...
 
def get_assignment_text
 Get the formatted text for an assignment. More...
 
def get_assignments_with_heap
 Domino sampling that recovers the assignments for the root of the merge tree, but conserving only the best k scores for each vertex of the tree. More...
 
def get_restraint_value_for_assignment
 Recover the value of a restraint. More...
 
def get_restraints_for_native
 Get values of the restraints for the native structure. More...
 
def get_restraints_names_used
 Get the names of the restraints used for a subset. More...
 
def get_scoring_function
 Get a ScoringFunction that includes all restraints. More...
 
def load_state
 Load the positions of the components given by the assignment. More...
 
def read_merge_tree
 Read and create a merge tree from a file. More...
 
def set_assembly
 Sets an assembly from a single PDB file. More...
 
def set_assembly_components
 Sets the components of an assembly, each one given as a separate PDB file. More...
 
def set_close_pairs_excluded_volume_restraint
 Creates an excluded volume restraint between all the components of the coarse assembly.See help for. More...
 
def set_complementarity_restraint
 Set a restraint for geometric complementarity between 2 components. More...
 
def set_connectivity_restraint
 Set a connectivity restraint between the elements of the assembly. More...
 
def set_em2d_restraint
 Set a Restraint computing the em2d score. More...
 
def set_native_assembly_for_benchmark
 Sets the native model for benchmark, by reading the native structure and set the rigid bodies. More...
 
def set_not_optimized
 Set a part of the model as not optimized (it does not move during the model optimization) More...
 
def set_pair_score_restraint
 Set a pair_score restraint between the coarse representation of two components. More...
 
def set_rb_states
 Add a set of reference frames as possible states for a rigid body. More...
 
def set_xlink_restraint
 Set a restraint on the maximum distance between 2 residues. More...
 
def setup_domino_sampler
 Creates a DOMINO sampler and adds the required filter tables. More...
 
def write_merge_tree
 Writes the current merge tree to file. More...
 
def write_monte_carlo_solution
 Write the solution of a MonteCarlo run. More...
 
def write_pdb_for_assignment
 Write the solution in the assignment. More...
 
def write_pdb_for_component
 Write one component of the assembly. More...
 
def write_pdb_for_configuration
 Write a file with a configuration for the model (configuration here means a configuration in DOMINO) More...
 
def write_pdb_for_reference_frames
 Write a PDB file with a solution given by a set of reference frames. More...
 
def write_pdbs_for_reference_frames
 Write a separate PDB for each of the elements. More...
 
def write_solutions_database
 Write the results of the DOMINO sampling to a SQLite database. More...
 
def write_subset
 Writes lines describing a subset (vertex of a merge tree) More...
 

Member Function Documentation

def IMP.EMageFit.domino_model.DominoModel.add_branch_and_bound_assignments_table (   self)

BranchAndBoundAssignmentsTable enumerate states based on provided filtered using the provided the subset filter tables.

Definition at line 498 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.add_exclusion_filter_table (   self)

ExclusionSubsetFilterTable ensures that two particles are not given the same state at the same time.

Definition at line 512 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.add_restraint (   self,
  r,
  name,
  weight,
  max_score = False 
)

Adds a restraint to the model.

Parameters
rAn IMP.Restraint object
nameName for the restraint
weightWeight for the restraint
max_scoreMaximum score allowed for the restraint. If max_score is False, there is no limit for the value of the restraint

Definition at line 55 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.add_restraint_score_filter_table (   self)

Add a RestraintScoreSubsetFilterTable to DOMINO that allows to reject assignments that have score worse than the thresholds for the restraints.

Definition at line 454 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.align_rigid_bodies_states (   self)

Aligns the set of structures considered for DOMINO sampling.

The function: 1) reads the possible reference frames that the rb_states_table stores for each rigid body. This table must be filled before using this function. Usually it is filled with the results from a previous Monte Carlo sampling. If the solutions from Monte Carlo seem to have the same structure but they are not aligned to each other, this function can help setting better starting positions to use with DOMINO. 2) Gets the first state for each of the rigid bodies and sets a reference structure using such states. 3) Aligns all the rest of the structures respect to the reference 4) Replaces the values of the reference frames stored in the rb_states_table with the new values obtained from the alignments. It does it for all states of a rigid body.

Note
: If this function is applied, the parameters "anchor" and "fixed" are ignored, as they are superseded by the use of the alignments calculated here.

Definition at line 77 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.create_coarse_assembly (   self,
  n_residues 
)

Simplify the assembly with a coarse representation.

Parameters
n_residuesNumber of residues used for a coarse particle

Definition at line 217 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.create_merge_tree (   self)

Creates a merge tree from the restraints that are set already.

Definition at line 595 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.do_sampling (   self,
  mode = 'assignments_heap_container',
  params = None 
)

Do Domino sampling.

Parameters
modeThe mode used to recover solutions from domino. It can have the value "configuration", "assignments", or "assignments_heap_container". The mode "configuration" recovers all possible configurations (takes a while to generate them). The mode "assignments" only provides the assignments (state numbers) of the solutions. It is faster but requires generating the solutions afterwards The mode "assignments_heap_container" selects the best solutions after each merging in DOMINO, discarding the rest. In practice I used the mode "assignments_heap_container"
params

Definition at line 233 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.get_assignment_and_RFs (   self,
  assignment,
  subset 
)

Return a line with texts for an assignment and the the reference frames of the RigidBodies in the subset.

Parameters
subsetSubset of components of the assembly
assignmentAssignment class with the states for the subset
Note
: see the get_assignment_assignment_text() note.

Definition at line 297 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.get_assignment_info (   self,
  assignment,
  subset 
)

Info related to an assignment.

Returns a list with text for the assignment and all the scores for the restraints

Parameters
subsetSubset of components of the assembly
assignmentAssignment class with the states for the subset

Definition at line 320 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.get_assignment_scores (   self,
  assignment,
  subset 
)

Returns a list with the values for the restraints on a subset of the components of the assembly.

Parameters
subsetSubset of components of the assembly
assignmentAssignment class with the states for the subset

Definition at line 332 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.get_assignment_text (   self,
  assignment,
  subset 
)

Get the formatted text for an assignment.

Parameters
subsetSubset of components of the assembly
assignmentAssignment class with the states for the subset
Note
: The order in assignment and subset is not always the order of the rigid bodies in self.components_rbs. The function reorders the terms in the assignment so there is correspondence.

Definition at line 280 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.get_assignments_with_heap (   self,
  vertex,
  k = 0 
)

Domino sampling that recovers the assignments for the root of the merge tree, but conserving only the best k scores for each vertex of the tree.

Parameters
[in]vertexVertex with the root of the current merge tree. This function is recursive.
[in]k

Definition at line 354 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.get_restraint_value_for_assignment (   self,
  assignment,
  name 
)

Recover the value of a restraint.

Parameters
nameof the restraint
assignmentAssignment class containing the assignment for the solution desired

Definition at line 395 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.get_restraints_for_native (   self,
  restraints_names 
)

Get values of the restraints for the native structure.

Parameters
restraints_namesNames of the restraints requested
Returns
a list with the values of all scores, and the total score

Definition at line 874 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.get_restraints_names_used (   self,
  subset 
)

Get the names of the restraints used for a subset.

Parameters
subsetSubset of components of the assembly

Definition at line 867 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.get_scoring_function (   self)

Get a ScoringFunction that includes all restraints.

Definition at line 966 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.load_state (   self,
  assignment 
)

Load the positions of the components given by the assignment.

Parameters
assignmentAssignment class

Definition at line 346 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.read_merge_tree (   self,
  fn 
)

Read and create a merge tree from a file.

The format of the file is the format written by write merge_tree() It does not matter the order of the indices in the file, as they are sorted by this function. The only condition is that the index for the vertex that is the root of the tree MUST be the largest. This is guaranteed when creating a merge tree with create_merge_tree()

Parameters
fnFile containing the merge tree

Definition at line 537 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.set_assembly (   self,
  fn_pdb,
  names 
)

Sets an assembly from a single PDB file.

The function assumes that the components of the assembly are the chains of the PDB file.

Parameters
fn_pdbPDB with the file for the assembly
namesNames for each of the components (chains) of the assembly

Definition at line 484 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.set_assembly_components (   self,
  fn_pdbs,
  names 
)

Sets the components of an assembly, each one given as a separate PDB file.

Parameters
fn_pdbsList with the names of the pdb files
namesList with the names of the components of the assembly.

Definition at line 469 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.set_close_pairs_excluded_volume_restraint (   self,
  distance = 10,
  weight = 1.0,
  ratio = 0.05,
  stddev = 2,
  max_score = False 
)

Creates an excluded volume restraint between all the components of the coarse assembly.See help for.

Parameters
distanceMaximum distance tolerated between particles
weightWeight for the restraint
stddev
max_scoreMaximum value for the restraint. If the parameter is None, an automatic value is computed (using the ratio).
ratioFraction of the number of possible pairs of particles that are tolerated to overlap. The maximum score is modified according to this ratio. I have found that ratios of 0.05-0.1 work well allowing for some interpenetration
stddevStandard deviation used to approximate the HarmonicUpperBound function to a Gaussian

Definition at line 730 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.set_complementarity_restraint (   self,
  name1,
  name2,
  rname,
  max_sep_distance,
  max_penetration,
  weight,
  max_score = 10000000000.0 
)

Set a restraint for geometric complementarity between 2 components.

Parameters
name1name of
name2- The restraint is applied to this components
rname- The name given to the restraint
max_sep_distance- maximum distance between molecules tolerated by the restraint
max_penetration- Maximum penetration allowed (angstrom)
weight
max_score

Definition at line 191 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.set_connectivity_restraint (   self,
  names,
  rname,
  distance = 10,
  weight = 1.0,
  max_score = None,
  n_pairs = 1,
  stddev = 2 
)

Set a connectivity restraint between the elements of the assembly.

Parameters
namesList with all the elements to be connected
distanceMaximum distance tolerated by the restraint
rnameName for the restraint
weightWeight for the restraint
max_scoreMaximum score for the restraint
n_pairsNumber of pairs of particles used in the KClosePairScore of the connectivity restraint
stddevStandard deviation used to approximate the HarmonicUpperBound function to a Gaussian

Definition at line 655 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.set_em2d_restraint (   self,
  name,
  fn_images_sel,
  pixel_size,
  resolution,
  n_projections,
  weight,
  max_score = False,
  mode = 'fast',
  n_optimized = 1 
)

Set a Restraint computing the em2d score.

Parameters
nameName for the restraint
fn_images_selSelection file with the names of the images used for the restraint
pixel_size- pixel size in the images
resolution- resolution used to downsample the projections of the model when projecting
weightWeight of the restraint
max_score- Maximum value tolerated for the restraint
n_projections- Number of projections to generate when projecting the model to do the coarse alignments
mode- Mode used for computing the restraints.
n_optimized- number of results from the coarse alignment that are refined with the Simplex algorithm to get a more accurate value for the restraint

Definition at line 684 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.set_native_assembly_for_benchmark (   self,
  params 
)

Sets the native model for benchmark, by reading the native structure and set the rigid bodies.

Definition at line 413 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.set_not_optimized (   self,
  name 
)

Set a part of the model as not optimized (it does not move during the model optimization)

Parameters
nameof the component to optimized

Definition at line 714 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.set_pair_score_restraint (   self,
  name1,
  name2,
  restraint_name,
  distance = 10,
  weight = 1.0,
  n_pairs = 1,
  stddev = 2,
  max_score = None 
)

Set a pair_score restraint between the coarse representation of two components.

Parameters
name1Name of the first component
name2Name of the second component
restraint_nameName for the restraint
distanceMaximum distance tolerated between particles
weightWeight of the restraint
n_pairs
max_scoreMaximum value tolerated for the restraint
stddevStandard deviation used to approximate the HarmonicUpperBound function to a Gaussian

Definition at line 779 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.set_rb_states (   self,
  rb,
  transformations 
)

Add a set of reference frames as possible states for a rigid body.

Parameters
rbThe rigid body
transformationsTransformations are used to build the reference frames for the rigid body.

Definition at line 437 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.set_xlink_restraint (   self,
  id1,
  chain1,
  residue1,
  id2,
  chain2,
  residue2,
  distance,
  weight,
  stddev,
  max_score = False 
)

Set a restraint on the maximum distance between 2 residues.

Parameters
id1Name of the first component
chain1
residue1Residue number for the aminoacid in the first component.The number is the number in the PDB file, not the number relative to the beginning of the chain
id2Name of the second component
chain2
residue2Residue number for the aminoacid in the second component.
distanceMaximum distance tolerated
weightWeight of the restraint
stddevStandard deviation used to approximate the HarmonicUpperBound function to a Gaussian
max_scoreSee help for add_restraint(). If none is given, the maximum score is set to allow a maximum distance of 10 Angstrom greater than the parameter "distance".

Definition at line 139 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.setup_domino_sampler (   self)

Creates a DOMINO sampler and adds the required filter tables.

Definition at line 521 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.write_merge_tree (   self,
  fn 
)

Writes the current merge tree to file.

The format is: parent | child_left | child_right | labels

Parameters
fnFile for storing the merge tree

Definition at line 611 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.write_monte_carlo_solution (   self,
  fn_database 
)

Write the solution of a MonteCarlo run.

Parameters
fn_databaseDatabase file with the solution. The database will contain only one record

Definition at line 971 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.write_pdb_for_assignment (   self,
  assignment,
  fn_pdb 
)

Write the solution in the assignment.

Parameters
assignmentAssignment class with the states for the subset
fn_pdbFile to write the model

Definition at line 908 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.write_pdb_for_component (   self,
  component_index,
  ref,
  fn_pdb 
)

Write one component of the assembly.

Parameters
component_indexPosition of the component in the assembly
refReference frame of the component
fn_pdbOutput PDB

Definition at line 954 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.write_pdb_for_configuration (   self,
  n,
  fn_pdb 
)

Write a file with a configuration for the model (configuration here means a configuration in DOMINO)

Parameters
nIndex of the configuration desired.
fn_pdb

Definition at line 920 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.write_pdb_for_reference_frames (   self,
  RFs,
  fn_pdb 
)

Write a PDB file with a solution given by a set of reference frames.

Parameters
RFsReference frames for the elements of the complex
fn_pdbFile to write the solution

Definition at line 933 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.write_pdbs_for_reference_frames (   self,
  RFs,
  fn_base 
)

Write a separate PDB for each of the elements.

Parameters
RFsReference frames for the elements of the complex
fn_basebase string to build the names of the PDBs files

Definition at line 943 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.write_solutions_database (   self,
  fn_database,
  max_number = None 
)

Write the results of the DOMINO sampling to a SQLite database.

Parameters
fn_database
max_numberMaximum number of results to write

Definition at line 827 of file domino_model.py.

def IMP.EMageFit.domino_model.DominoModel.write_subset (   self,
  v,
  w 
)

Writes lines describing a subset (vertex of a merge tree)

Parameters
wA csv.writer
vVertex index

Definition at line 629 of file domino_model.py.


The documentation for this class was generated from the following file: