Builder helper#

Some helper functions used during the building of the pipeline

bindflow.orchestration.flow_builder.approach_flow(global_config: dict, submit: bool = False) str[source]#

It controls the rest of the workflows that make the actual calculations. It will only hang and wait till the rest subprocess finish. In case that cluster/options/job is defined in global_config, those options will be used to create the proper cluster submit script, if not cluster/option/calculation will be used instead

Parameters:
  • global_config (dict) – The global configuration. It should contain: out_approach_path[PathLike], inputs[dict[dict]], water_model[str], host_name[str], host_selection[str] (no needed for mmpbsa), fix_protein[bool], solv_d[float], solv_bt[str], solv_rmin[float], solv_ion_conc[float] cofactor_on_protein[bool], cofactor_selection[str], extra_directives[dict], dt_max[float] ligand_names[list[str]], replicas[float], threads[int], samples[int] (no needed for fep) hmr_factor[float, None], custom_ff_path[str, None], cluster/type[str], cluster/options/calculation[dict] num_max_thread: int, The maximum number of threads to be used on each simulation. mdrun: dict: A dict of mdrun keywords to add to gmx mdrun, flag must be passed with boolean values. E.g {‘cpi’: True} extra_dependencies: A list of dependencies that must be run before gmx mdrun. Useful to launch modules as spack or conda. num_jobs: int: Maximum number of jobs to run in parallel cluster/options/job[dict]. The last is optional and will override cluster/options/calculation[dict] during submit

  • submit (bool, optional) – Submit to the workload manager, by default False

Returns:

Some identification of the submitted job. It will depend on how the submit method of the corresponded Schedular (bindflow.orchestration.generate_scheduler.Scheduler) was implemented

Return type:

str

bindflow.orchestration.flow_builder.generate_approach_snake_file(out_file_path: str, conf_file_path: str, calculation_type: str) None[source]#

Used to generate the main Snakefile

Parameters:
  • out_file_path (str) – Path to write the Snakefile

  • conf_file_path (str) – Path of the yml workflow configuration file.

  • calculation_type (str) – Either mmpbsa or fep.

bindflow.orchestration.flow_builder.update_nwindows_config(config: dict) dict[source]#

A simple function to update the config file for the entrance nwindows

Parameters:

config (dict) –

The configuration file with or without the nwindows keyword. In case it is present, must be in the shape of:

'nwindows': {
    'ligand': {
        'vdw': <int>[11],
        'coul': <int>[11],
    },
    'complex': {
        'vdw': <int>[21],
        'coul': <int>[11],
        'bonded': <int>[11]
    },
}

Returns:

The updated config

Return type:

dict