schrodinger.application.desmond.stage.utils module

schrodinger.application.desmond.stage.utils.check_cms_file(fname)
schrodinger.application.desmond.stage.utils.check_box_size(model, msj_content, return_params=False)

Check that the model box is big enough for desmond to run.

Parameters
  • model (cms.Cms or structure.Structure) – Desmond model or structure. For structure chorus properties must be set

  • msj_content (str) – Contents of the simulate block (X in simulate {X}). Or for the concatenate: concatenate {simulate = [{X}]} Only some parameters are used to determine r_lazy: temp, ensemble, etc. see gconfig.msj2cfg

  • return_params (bool) – If True, return also adjusted box and r_lazy

Return type

bool or tuple

Returns

True or False if box is big enough. If return_params=True, also return adjusted box size and r_lazy

Raises

ValueError – If msj is concatenate stage (checked with is_concat)

schrodinger.application.desmond.stage.utils.run_stage_method_in_parallel(method)

Decorator to run a stage method in parallel. The first argument to the method must be a list, which will be split into cmj.ENGINE.maxjob jobs. If the first argument contains a single element, or maxjob is 1, then the method is called directly.

The decorated method must return a list of results. It must NOT alter the stage state in any way, because the stage state is not propagated back.

Raises

RuntimeError – If the subprocess did not run successfully.

class schrodinger.application.desmond.stage.utils.SystemBuilder(*arg, **kwarg)

Bases: schrodinger.application.desmond.cmj.StageBase

NAME = 'system_builder'
SOLVENT = {'SPC': 'spc.box.mae', 'SPCE': 'spce.box.mae', 'SPCFW': 'spcfw.box.mae', 'TIP3P': 'tip3p.box.mae', 'TIP4P': 'tip4p.box.mae', 'TIP4P2005': 'tip4p2005.box.mae', 'TIP4PD': 'tip4pd.box.mae', 'TIP4PEW': 'tip4pew.box.mae', 'TIP5P': 'tip5p.box.mae'}
SB_CMD = '/scr/buildbot/savedbuilds/2024-1/NB/build-133/utilities/system_builder'
PARAM = <schrodinger.utils.sea.sea.Map object>
static merge_restrain(model: schrodinger.application.desmond.cms.Cms, param: schrodinger.utils.sea.sea.Map, new_restr: List[schrodinger.application.desmond.cms.RestrainGroupContainer], old_restr: List[schrodinger.application.desmond.cms.RestrainGroupContainer])

Create restrain arrays/objects corresponding to the settings in param and merge them into new_restr. If the ‘ref’ or ‘reference_pos’ field of param equals ‘retain’, the reference positions from any matching restraints in old_restr are copied to the created restrain objects before they are merged into new_restr. :param model: the input cms model. It is not modified. :param param: The restrain parameters. ‘atom’, ‘fc’ or ‘force_constant’, ‘ref’ or ‘reference_position’, and ‘sigma’ are allowed :param new_restr: The collection of restrains that the new restrains will be merged into. :param old_restr: The collection of restrains to pull any corresponding reference positions from if ‘ref’ or ‘reference_position’ field == ‘retain’.

static gen_restraint(model, setting, job)

Generates restraints.

static set_restrain(model: schrodinger.application.desmond.cms.Cms, setting: Union[schrodinger.utils.sea.sea.List, schrodinger.utils.sea.sea.Map], permanent_restr: Optional[List[schrodinger.application.desmond.cms.RestrainGroupContainer]] = None, job=None)

Set ffio_restrain block in cms model given the ‘restrain’ setting and any existing permanent restraints :param model: the cms model to add restraints to :param setting: the ‘restrain’ setting, as a sea.Map. :param permanent_restr: any optional ‘permanent’ restrain that is passed along with the job object and persists throughout the workflow. It can :param job: the job object

static merge_atom_group(model, group_key)
static set_atom_group(model, group, permanent_group=None)
__init__(*arg, **kwarg)
crunch()
hook_captured_successful_job(job)
RESTARTABLE = False
add_job(job: schrodinger.application.desmond.cmj.Job)

Shortcut for add_jobs

add_jobs(jobs: Iterable[schrodinger.application.desmond.cmj.Job])

Add jobs to the stage’s job manager

check_param()
count = 0
describe()
determine()
filter_jobs(**kwargs) List[schrodinger.application.desmond.cmj.Job]

Return a list of jobs based on a matching a set of criteria given as arguments. Read JobManager.filter_jobs for available arguments.

finalize_job(job: schrodinger.application.desmond.cmj.Job)

Call hook_captured_successful_job on any successful jobs and write a checkpoint

finalize_stage()

If the stage is done running, pack the stage, and if the stage is successful, continue to the next stage

get_output_jobs() List[schrodinger.application.desmond.cmj.Job]

Get the stage’s output jobs

get_prejobs() List[schrodinger.application.desmond.cmj.Job]

Get the stage’s input jobs

property jobs: List[schrodinger.application.desmond.cmj.Job]
migrate_param(param: schrodinger.utils.sea.sea.Map)

Subclasses can implement this to migrate params to provide backward compatibility with older msj files, ideally with a deprecation warning.

pack_stage(force=False)
poststage()
prestage()
push(job)
release(is_restarting=False)

Calls the ‘crunch’ method to generate new jobs objects and submits them to the ‘QUEUE’.

restart_subjobs(jobs)

Subclass should override this if it supports subjob restarting.

stage_cls = {'generic': <class 'schrodinger.application.desmond.stage.simulate.VrunBase'>, 'pl_analysis': <class 'schrodinger.application.desmond.stage.analysis.PLAnalysis'>, 'analysis': <class 'schrodinger.application.desmond.stage.analysis.Analysis'>, 'fep_analysis': <class 'schrodinger.application.desmond.stage.analysis.FepAnalysis'>, 'multisim': <class 'schrodinger.application.desmond.stage.launcher.Multisim'>, 'fep_launcher': <class 'schrodinger.application.desmond.stage.launcher.FepLauncher'>, 'fep_membrane_launcher': <class 'schrodinger.application.desmond.stage.launcher.FepMembraneLauncher'>, 'covalent_fep_mapper': <class 'schrodinger.application.desmond.stage.fep_mapper.CovalentFepMapper'>, 'protein_fep_mapper': <class 'schrodinger.application.desmond.stage.fep_mapper.ProteinFepMapper'>, 'fep_mapper': <class 'schrodinger.application.desmond.stage.fep_mapper.FepMapper'>, 'fep_mapper_cleanup': <class 'schrodinger.application.desmond.stage.fep_mapper.FepMapperCleanup'>, 'calc_ddg': <class 'schrodinger.application.desmond.stage.fep_mapper.CalcDdg'>, 'system_builder': <class 'schrodinger.application.desmond.stage.utils.SystemBuilder'>, 'simulate': <class 'schrodinger.application.desmond.stage.simulate.Simulate'>, 'replica_exchange': <class 'schrodinger.application.desmond.stage.simulate.ReplicaExchange'>, 'lambda_hopping': <class 'schrodinger.application.desmond.stage.simulate.LambdaHopping'>, 'desmond_extend': <class 'schrodinger.application.desmond.stage.simulate.DesmondExtend'>, 'vrun': <class 'schrodinger.application.desmond.stage.simulate.Vrun'>, 'fep_vrun': <class 'schrodinger.application.desmond.stage.simulate.FepVrun'>, 'concatenate': <class 'schrodinger.application.desmond.stage.simulate.Concatenate'>, 'reinit': <class 'schrodinger.application.desmond.stage.simulate.ReInit'>, 'primer': <class 'schrodinger.application.desmond.stage.workflow.Primer'>, 'concluder': <class 'schrodinger.application.desmond.stage.workflow.Concluder'>, 'task': <class 'schrodinger.application.desmond.stage.workflow.Task'>, 'extern': <class 'schrodinger.application.desmond.stage.workflow.Extern'>, 'trim': <class 'schrodinger.application.desmond.stage.workflow.Trim'>, 'stop': <class 'schrodinger.application.desmond.stage.workflow.Stop'>, 'assign_custom_charge': <class 'schrodinger.application.desmond.stage.prepare.forcefield.AssignCustomCharge'>, 'assign_forcefield': <class 'schrodinger.application.desmond.stage.prepare.forcefield.AssignForcefield'>, 'assign_lambda_schedule': <class 'schrodinger.application.desmond.stage.prepare.forcefield.AssignLambdaSchedule'>, 'load_restraints_from_structure': <class 'schrodinger.application.desmond.stage.prepare.forcefield.LoadRestraintsFromStructure'>, 'forcefield_builder_launcher': <class 'schrodinger.application.desmond.stage.prepare.forcefield.ForcefieldBuilderLauncher'>, 'build_geometry': <class 'schrodinger.application.desmond.stage.prepare.structure.BuildGeometry'>, 'extract_structures': <class 'schrodinger.application.desmond.stage.prepare.structure.ExtractStructures'>, 'extract_solute_structure': <class 'schrodinger.application.desmond.stage.prepare.structure.ExtractSoluteStructure'>, 'hash_structure_title': <class 'schrodinger.application.desmond.stage.prepare.structure.HashStructureTitle'>, 'disordered_system_builder': <class 'schrodinger.application.desmond.stage.prepare.structure.DisorderedSystemBuilder'>, 'protein_mutation_generator': <class 'schrodinger.application.desmond.stage.prepare.structure.ProteinMutationGenerator'>, 'replicate_structure': <class 'schrodinger.application.desmond.stage.prepare.structure.ReplicateStructure'>, 'group_waters': <class 'schrodinger.application.desmond.stage.prepare.structure.GroupWaters'>, 'fep_absolute_binding_structure_primer': <class 'schrodinger.application.desmond.stage.app.absolute_binding.stage.FepAbsoluteBindingStructurePrimer'>, 'fep_absolute_binding_fep_primer': <class 'schrodinger.application.desmond.stage.app.absolute_binding.stage.FepAbsoluteBindingFepPrimer'>, 'fep_absolute_binding_launcher_base': <class 'schrodinger.application.desmond.stage.app.absolute_binding.stage.FepAbsoluteBindingLauncherBase'>, 'fep_absolute_binding_md_launcher': <class 'schrodinger.application.desmond.stage.app.absolute_binding.stage.FepAbsoluteBindingMdLauncher'>, 'fep_absolute_binding_fep_launcher': <class 'schrodinger.application.desmond.stage.app.absolute_binding.stage.FepAbsoluteBindingFepLauncher'>, 'fep_absolute_binding_analysis': <class 'schrodinger.application.desmond.stage.app.absolute_binding.stage.FepAbsoluteBindingAnalysis'>, 'fragment_linking_primer': <class 'schrodinger.application.desmond.stage.app.fragment_linking.stage.FragmentLinkingPrimer'>, 'ramd': <class 'schrodinger.application.desmond.stage.app.kinetics.RandomAcceleratedMD'>, 'ramd_reactive_path': <class 'schrodinger.application.desmond.stage.app.kinetics.RamdGenerateUnbindingPath'>, 'ramd_setup': <class 'schrodinger.application.desmond.stage.app.kinetics.RamdSetup'>, 'ramd_cleanup': <class 'schrodinger.application.desmond.stage.app.kinetics.RamdCleanup'>, 'path_unbinding': <class 'schrodinger.application.desmond.stage.app.kinetics.PathUnbinding'>, 'path_unbinding_analysis': <class 'schrodinger.application.desmond.stage.app.kinetics.PathUnbindingAnalysis'>, 'path_unbind_cleanup': <class 'schrodinger.application.desmond.stage.app.kinetics.PathUnbindingCleanup'>, 'lambda_dynamics_mapper': <class 'schrodinger.application.desmond.stage.app.lambda_dynamics.LambdaDynamicsMapper'>, 'lambda_dynamics_md_launcher': <class 'schrodinger.application.desmond.stage.app.lambda_dynamics.LambdaDynamicsMdLauncher'>, 'aacg_sitemap': <class 'schrodinger.application.desmond.stage.app.matsci.Aacg_SiteMap_Multijob'>, 'average_cell': <class 'schrodinger.application.desmond.stage.app.matsci.AverageCell'>, 'deform_cell': <class 'schrodinger.application.desmond.stage.app.matsci.DeformCell'>, 'solvate_slab_builder': <class 'schrodinger.application.desmond.stage.app.matsci.SolvateSlabBuilder'>, 'matsci_analysis': <class 'schrodinger.application.desmond.stage.app.matsci.MatSciAnalysis'>, 'ses_stage': <class 'schrodinger.application.desmond.stage.app.matsci.ScaleEffectiveSolvent'>, 'extract_subsystem': <class 'schrodinger.application.desmond.stage.app.matsci.ExtractSubSystem'>, 'mixed_solvent_setup': <class 'schrodinger.application.desmond.stage.app.mxmd.MixedSolventSetup'>, 'mixed_solvent_analysis': <class 'schrodinger.application.desmond.stage.app.mxmd.MixedSolventAnalysis'>, 'mixed_solvent_cleanup': <class 'schrodinger.application.desmond.stage.app.mxmd.MixedSolventCleanup'>, 'generate_mxmd_box': <class 'schrodinger.application.desmond.stage.app.mxmd.GenerateMxmdBox'>, 'analyze_mxmd_probe_mixture': <class 'schrodinger.application.desmond.stage.app.mxmd.AnalyzeMxmdProbeMixture'>, 'generate_solubility_fep_structures': <class 'schrodinger.application.desmond.stage.app.solubility.GenerateSolubilityFepStructures'>, 'solubility_md_launcher': <class 'schrodinger.application.desmond.stage.app.solubility.SolubilityMdLauncher'>, 'solubility_fep_launcher': <class 'schrodinger.application.desmond.stage.app.solubility.SolubilityFepLauncher'>, 'solubility_fep_analysis': <class 'schrodinger.application.desmond.stage.app.solubility.SolubilityFepAnalysis'>, 'watermap_cluster': <class 'schrodinger.application.desmond.stage.app.watermap.WaterMapCluster'>, 'watermap_post_analysis': <class 'schrodinger.application.desmond.stage.app.watermap.WaterMapPostAnalysis'>, 'constant_ph_analysis': <class 'schrodinger.application.desmond.stage.app.constant_ph.ConstantpHAnalysis'>, None: <class 'schrodinger.application.desmond.stage.deprecate.MustSkip'>, 'ffbuilder': <class 'schrodinger.application.desmond.stage.deprecate.ForcefieldBuilder'>, 'align_core': <class 'schrodinger.application.desmond.stage.deprecate.AlignCore'>, 'solvate_pocket': <class 'schrodinger.application.desmond.stage.deprecate.SolvatePocket'>, 'vacuum_report': <class 'schrodinger.application.desmond.stage.deprecate.VacuumReport'>, 'fep_mapper_report': <class 'schrodinger.application.desmond.stage.deprecate.FepMapperReport'>}
stage_obj = {}
time_stage()