implicit_solvent_ddm.runner.IntermidateRunner¶
- class implicit_solvent_ddm.runner.IntermidateRunner(simulations, restraints, post_process_no_solv_mdin, post_process_mdin, post_process_distruct, post_only, config, adaptive=False, loaded_dataframe=[], post_output=[], memory=None, cores=None, disk=None, preemptable=None, unitName='', checkpoint=False, displayName='', descriptionClass=None)[source]¶
Manages and executes MD simulations and post-analysis steps for a given system phase.
This runner class handles the full lifecycle for a batch of simulation jobs (e.g., for ligand, receptor, or complex), including: - Launching intermediate MD simulations (if not already run), - Collecting and caching output data (parsed from mdout), - Running post-analysis jobs (e.g., energy decomposition), - Supporting adaptive workflows and optional “post-only” modes.
- Parameters:
simulations (list of Simulation) – List of simulation objects to run. Each one encapsulates the inputs for a ligand, receptor, or complex phase.
restraints (RestraintMaker) – Object that manages creation of restraint files or logic for the simulations.
post_process_no_solv_mdin (FileID) – Input file for post-processing jobs that should exclude implicit solvent (e.g., for igb=6).
post_process_mdin (FileID) – Standard input file for post-analysis energy evaluation (e.g., sander).
post_process_distruct (str) – Directory structure key or identifier used to organize post-processing job outputs.
post_only (bool) – If True, skips MD simulations and runs post-analysis only.
config (Config) – Global configuration object for the workflow.
adaptive (bool, optional) – Enables adaptive lambda window or restraint scheduling if True.
loaded_dataframe (list, optional) – Tracks previously parsed output directories to avoid reprocessing.
post_output (list or list of pd.DataFrame, optional) – Stores collected energy analysis output dataframes from post-processing.
memory (int or str, optional) – Memory allocation for the job (used by the underlying workflow engine).
cores (int or float or str, optional) – Number of CPU cores to request for each job.
disk (int or str, optional) – Disk allocation for the job (used by the underlying workflow engine).
preemptable (bool or int or str, optional) – Flag to mark the job as preemptable (depending on scheduler).
unitName (str, optional) – Name for job unit (optional; used in workflow diagnostics).
checkpoint (bool, optional) – If True, enables checkpointing of the job state.
displayName (str, optional) – Custom name for the job (for logs/monitoring).
descriptionClass (str, optional) – Optional tag or label for job type.
- Variables:
post_output (list) – Contains parsed pandas DataFrames of energy terms from post-analysis jobs.
ligand_output (list) – Placeholder list for ligand-specific outputs.
receptor_output (list) – Placeholder list for receptor-specific outputs.
complex_output (list) – Placeholder list for complex-specific outputs.
_loaded_dataframe (list) – Tracks directories already parsed to prevent duplicate processing.
Notes
Each Simulation object is checked for output; if missing, MD is run first.
If post_only is True, only analysis is performed using available trajectories.
Uses sander.MPI for post-processing and create_mdout_dataframe for parsing outputs.
Designed for use in generalized workflows involving restraint-free energies or DDM.
- Returns:
self – Returns itself to support chaining or retrieval in a workflow graph.
- Return type:
- __init__(simulations, restraints, post_process_no_solv_mdin, post_process_mdin, post_process_distruct, post_only, config, adaptive=False, loaded_dataframe=[], post_output=[], memory=None, cores=None, disk=None, preemptable=None, unitName='', checkpoint=False, displayName='', descriptionClass=None)[source]¶
Job initializer.
This method must be called by any overriding constructor.
- Parameters:
memory (int or string convertible by toil.lib.conversions.human2bytes to an int) – the maximum number of bytes of memory the job will require to run.
cores (float, int, or string convertible by toil.lib.conversions.human2bytes to an int) – the number of CPU cores required.
disk (int or string convertible by toil.lib.conversions.human2bytes to an int) – the amount of local disk space required by the job, expressed in bytes.
accelerators (int, string, dict, or list of those. Strings and dicts must be parseable by parse_accelerator.) – the computational accelerators required by the job. If a string, can be a string of a number, or a string specifying a model, brand, or API (with optional colon-delimited count).
preemptible (bool, int in {0, 1}, or string in {'false', 'true'} in any case) – if the job can be run on a preemptible node.
preemptable (
Union[bool,int,str,None]) – legacy preemptible parameter, for backwards compatibility with workflows not using the preemptible keywordunitName (str) – Human-readable name for this instance of the job.
checkpoint (bool) – if any of this job’s successor jobs completely fails, exhausting all their retries, remove any successor jobs and rerun this job to restart the subtree. Job must be a leaf vertex in the job graph when initially defined, see
toil.job.Job.checkNewCheckpointsAreCutVertices().displayName (str) – Human-readable job type display name.
descriptionClass (class) – Override for the JobDescription class used to describe the job.
local – if the job can be run on the leader.
files – Set of Files that the job will want to use.
Methods
__init__(simulations, restraints, ...[, ...])Job initializer.
addChild(childJob)Add a childJob to be run as child of this job.
addChildFn(fn, *args, **kwargs)Add a function as a child job.
addChildJobFn(fn, *args, **kwargs)Add a job function as a child job.
addFollowOn(followOnJob)Add a follow-on job.
addFollowOnFn(fn, *args, **kwargs)Add a function as a follow-on job.
addFollowOnJobFn(fn, *args, **kwargs)Add a follow-on job function.
addService(service[, parentService])Add a service.
add_to_files_to_use(val)assignConfig(config)Assign the given config object.
checkJobGraphAcylic()checkJobGraphConnected()checkJobGraphForDeadlocks()Ensures that a graph of Jobs (that hasn't yet been saved to the JobStore) doesn't contain any pathological relationships between jobs that would result in deadlocks if we tried to run the jobs.
checkNewCheckpointsAreLeafVertices()A checkpoint job is a job that is restarted if either it fails, or if any of its successors completely fails, exhausting their retries.
check_initialized()Ensure that Job.__init__() has been called by any subclass __init__().
defer(function, *args, **kwargs)Register a deferred function, i.e. a callable that will be invoked after the current attempt at running this job concludes.
encapsulate([name])Encapsulates the job, see
toil.job.EncapsulatedJob.files_downloaded_hook([host_and_job_paths])Function that subclasses can call when they have downloaded their input files.
getRootJobs()Return the set of root job objects that contain this job.
getTopologicalOrderingOfJobs()getUserScript()get_system_dirs(system_type)hasChild(childJob)Check if childJob is already a child of this job.
hasFollowOn(followOnJob)Check if given job is already a follow-on of this job.
hasPredecessor(job)Check if a given job is already a predecessor of this job.
hasService(service)Return True if the given Service is a service of this job, and False otherwise.
has_debug_flag(flag)Return true if the given debug flag is set.
loadJob(job_store, job_description)Retrieves a
toil.job.Jobinstance from a JobStorelog(text[, level])Log using
fileStore.log_to_leader().new_runner(config, obj)only_post_analysis(completed_sim, md_traj, ...)Run post-analysis calculations on a completed MD simulation.
preemptable()prepareForPromiseRegistration(jobStore)Set up to allow this job's promises to register themselves.
registerPromise(path)remove_from_files_to_use(val)run(fileStore)Submits molecular dynamics (MD) or post-processing jobs based on configuration.
rv(*path)Create a promise (
toil.job.Promise).saveAsRootJob(jobStore)Save this job to the given jobStore as the root job of the workflow.
saveBody(jobStore)Save the execution data for just this job to the JobStore, and fill in the JobDescription with the information needed to retrieve it.
set_debug_flag(flag)Enable the given debug option on the job.
update_postprocess_dirstruct(run_time_args)wrapFn(fn, *args, **kwargs)Makes a Job out of a function.
wrapJobFn(fn, *args, **kwargs)Makes a Job out of a job function.
Attributes
acceleratorsAny accelerators, such as GPUs, that are needed.
checkpointDetermine if the job is a checkpoint job or not.
coresThe number of CPU cores required.
descriptionExpose the JobDescription that describes this job.
diskThe maximum number of bytes of disk the job will require to run.
files_to_usejobStoreIDGet the ID of this Job.
memoryThe maximum number of bytes of memory the job will require to run.
preemptibleWhether the job can be run on a preemptible node.
tempDirShortcut to calling
job.fileStore.getLocalTempDir().