Source code for drugforge.cli.cli_args

import click


[docs] def postera(func): return click.option( "--postera", is_flag=True, default=False, help="Whether to download complexes from Postera.", )(func)
[docs] def postera_molset_name(func): return click.option( "--postera-molset-name", type=str, default=None, help="The name of the Postera molecule set to use.", )(func)
[docs] def postera_upload(func): return click.option( "--postera-upload", is_flag=True, default=False, help="Whether to upload results to Postera.", )(func)
[docs] def postera_args(func): return postera(postera_molset_name(postera_upload(func)))
[docs] def use_dask(func): return click.option( "--use-dask", is_flag=True, default=False, help="Whether to use dask for parallelism.", )(func)
[docs] def dask_type(func): from drugforge.data.util.dask_utils import DaskType return click.option( "--dask-type", type=click.Choice(DaskType.get_values(), case_sensitive=False), default=DaskType.LOCAL, help="The type of dask cluster to use. Local mode is reccommended for most use cases.", )(func)
[docs] def failure_mode(func): from drugforge.data.util.dask_utils import FailureMode return click.option( "--failure-mode", type=click.Choice(FailureMode.get_values(), case_sensitive=False), default=FailureMode.SKIP, help="The failure mode for dask. Can be 'raise' or 'skip'.", show_default=True, )(func)
[docs] def dask_n_workers(func): return click.option( "--dask-n-workers", type=int, default=None, help="The number of workers to use with dask.", )(func)
[docs] def dask_args(func): return use_dask(dask_type(dask_n_workers(failure_mode(func))))
[docs] def target(func): from drugforge.data.services.postera.manifold_data_validation import TargetTags return click.option( "--target", type=click.Choice(TargetTags.get_values(), case_sensitive=True), help="The target for the workflow", required=True, )(func)
[docs] def ligands(func): return click.option( "-l", "--ligands", type=click.Path(resolve_path=True, exists=True, file_okay=True, dir_okay=False), help="File containing ligands", )(func)
[docs] def output_dir(func): return click.option( "--output-dir", type=click.Path( resolve_path=True, exists=False, file_okay=False, dir_okay=True ), help="The directory to output results to.", default="output", )(func)
[docs] def overwrite(func): return click.option( "--overwrite/--no-overwrite", default=True, help="Whether to overwrite the output directory if it exists.", )(func)
[docs] def input_json(func): return click.option( "--input-json", type=click.Path(resolve_path=True, exists=True, file_okay=True, dir_okay=False), help="Path to a json file containing the inputs to the workflow, WARNING: overrides all other inputs.", )(func)
[docs] def ml_scorers(func): from drugforge.ml.models import ASAPMLModelRegistry return click.option( "--ml-scorer", type=click.Choice( ASAPMLModelRegistry.get_implemented_model_types(), case_sensitive=True ), multiple=True, help="The names of the ml scorer to use, can be specified multiple times to use multiple ml scorers.", )(func)
# flag to run all ml scorers
[docs] def ml_score(func): return click.option( "--ml-score", is_flag=True, default=False, help="Whether to run all ml scorers", )(func)
[docs] def fragalysis_dir(func): return click.option( "--fragalysis-dir", type=click.Path(resolve_path=True, exists=True, file_okay=False, dir_okay=True), help="Path to a directory containing fragments to dock.", )(func)
[docs] def structure_dir(func): return click.option( "--structure-dir", type=click.Path(resolve_path=True, exists=True, file_okay=False, dir_okay=True), help="Path to a directory containing structures.", )(func)
[docs] def pdb_file(func): return click.option( "--pdb-file", type=click.Path(resolve_path=True, exists=True, file_okay=True, dir_okay=False), help="Path to a pdb file containing a structure", )(func)
[docs] def cache_dir(func): return click.option( "--cache-dir", type=click.Path( resolve_path=True, exists=False, file_okay=False, dir_okay=True ), help="Path to a directory where design units are cached.", )(func)
[docs] def use_only_cache(func): return click.option( "--use-only-cache", is_flag=True, default=False, help="Whether to only use the cache.", )(func)
[docs] def gen_cache_w_default(func): return click.option( "--gen-cache", type=click.Path( resolve_path=False, exists=False, file_okay=False, dir_okay=True ), help="Path to a directory where a design unit cache should be generated.", default="prepped_structure_cache", )(func)
[docs] def md(func): return click.option( "--md", is_flag=True, default=False, help="Whether to run MD", )(func)
[docs] def md_steps(func): return click.option( "--md-steps", type=int, default=2500000, help="Number of MD steps", )(func)
[docs] def md_openmm_platform(func): from drugforge.simulation.simulate import OpenMMPlatform return click.option( "--md-openmm-platform", type=click.Choice(OpenMMPlatform.get_values(), case_sensitive=False), default=OpenMMPlatform.Fastest, help="The OpenMM platform to use for MD", )(func)
[docs] def md_args(func): return md(md_steps(md_openmm_platform(func)))
[docs] def core_smarts(func): return click.option( "-cs", "--core-smarts", type=click.STRING, help="The SMARTS which should be used to select which atoms to constrain to the reference structure.", )(func)
[docs] def save_to_cache(func): return click.option( "--save-to-cache/--no-save-to-cache", help="If the newly generated structures should be saved to the cache folder.", default=True, )(func)
[docs] def loglevel(func): return click.option( "--loglevel", type=click.Choice(["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]), help="The log level to use.", default="INFO", show_default=True, )(func)
[docs] def ref_chain(func): return click.option( "--ref-chain", type=str, default=None, help="Chain ID to align to in reference structure containing the active site.", )(func)
[docs] def active_site_chain(func): return click.option( "--active-site-chain", type=str, default=None, help="Active site chain ID to align to ref_chain in reference structure", )(func)
[docs] def seq_file(func): return click.option( "-f", "--seq-file", type=click.Path(resolve_path=True, exists=True, file_okay=True, dir_okay=False), help="File containing reference sequences", )(func)
[docs] def seq_type(func): return click.option( "-t", "--seq_type", type=click.Choice(["fasta", "pdb", "pre-calc"]), help="Type of input from which the sequence will be read.", default="fasta", show_default=True, )(func)
[docs] def blast_json(func): return click.option( "--blast-json", type=click.Path(resolve_path=True, exists=True, file_okay=True, dir_okay=False), help="Path to a json file containing parameters for the blast search.", )(func)
[docs] def email(func): return click.option( "--email", type=str, default="", help="Email for Entrez search.", )(func)
[docs] def max_mismatches(func): return click.option( "--max-mismatches", default=0, help="Maximum number of aminoacid group missmatches to be allowed in color-seq-match mode.", )(func)
[docs] def gen_ref_pdb(func): return click.option( "--gen-ref-pdb", is_flag=True, default=False, help="Whether to retrieve a pdb file for the query structure.", )(func)
[docs] def multimer(func): return click.option( "--multimer", is_flag=True, default=False, help="Store the output sequences for a multimer ColabFold run (from identical chains)." ' If not set, "--n-chains" will not be used. ', )(func)
[docs] def n_chains(func): return click.option( "--n-chains", type=int, default=None, help="Number of repeated chains that will be saved in csv file." ' Requires calling the "--multimer" flag', )(func)
[docs] def pymol_save(func): return click.option( "--pymol-save", type=str, default="session.pse", help="Path to file where session will be saved.", )(func)