CLI Reference¶
This section documents all available CLI commands.
protein-detective COMMAND
Protein Detective CLI
Table of Contents¶
Workflow:
candidates: Candidate structure related commandspowerfit: PowerFit related commandsrefine: HADDOCK3 refinement commands
Utilities:
meta: Generate a DuckDB metadata database for a Protein Detective session.import-structures: Import structures from a file or directory.--install-completion: Install shell completion for this application.dashboard: Browse a session snapshot in the dashboard. Stop with Ctrl+C.
protein-detective --install-completion¶
protein-detective --install-completion [OPTIONS]
Install shell completion for this application.
This command generates and installs the completion script to the appropriate location for your shell. After installation, you may need to restart your shell or source your shell configuration file.
Parameters:
--shell: Shell type for completion. If not specified, attempts to auto-detect current shell. [choices: zsh, bash, fish]--output, -o: Output path for the completion script. If not specified, uses shell-specific default.
protein-detective candidates¶
Candidate structure related commands
protein-detective candidates search¶
protein-detective candidates search [OPTIONS] SESSION_DIR
Search for candidate protein structures.
- Searches for UniProt accessions, writes
<session_dir>/uniprot.txt. - If interaction partner seeds are given, searches for interaction partners.
and adds partners to the list of UniProt accessions.
Writes
<session_dir>/interaction_partner_seeds.txt,<session_dir>/complexes.csvand<session_dir>/uniprot_with_interaction_partners.txt. - Searches for AlphaFold structures for the UniProt accessions.
Writes
<session_dir>/alphafold.csv. - Searches for PDBe structures for the UniProt accessions.
Writes
<session_dir>/pdbe.csv. - Searches for PDBe validation quality reports for the found PDBe structures.
Writes
<session_dir>/pdbe-quality.json. - Writes
<session_dir>/ro-crate-metadata.jsonto keep track of used arguments and its output files.
Arguments:
SESSION_DIR: RO-Crate session directory. [required]
UniProt sub-search:
--taxon-id: NCBI Taxon ID to filter results by organism (for example 9606 for human).--reviewed, --no-reviewed: Whether to filter results by reviewed status (True for reviewed, False for unreviewed).--subcellular-location-uniprot: Subcellular location in UniProt format (for example "nucleus").--subcellular-location-go: Subcellular location in GO format. Can be a single GO term (for example, ["GO:0005634"]) or a collection of GO terms (for example, ["GO:0005634", "GO:0005737"]), which are searched with OR logic.--molecular-function-go: Molecular function in GO format. Can be a single GO term (for example, ["GO:0003674"]) or a collection of GO terms (for example, ["GO:0003674", "GO:0008150"]), which are searched with OR logic.--min-sequence-length: Minimum length of the canonical sequence.--max-sequence-length: Maximum length of the canonical sequence.--limit-uniprot: Maximum number of UniProt accessions to return. [default: 10000]
AlphaFold sub-search:
--alphafold.limit: Maximum number of AlphaFold entries to return. Use '0' to skip the AlphaFold sub-search. [default: 10000]
PDBe sub-search:
--pdbe.limit: Maximum number of PDBe entries to return. Use '0' to skip the PDBe sub-search. [default: 10000]--pdbe.min-residues: Minimum chain length for PDBe.--pdbe.max-residues: Maximum chain length for PDBe.--pdbe.top-resolution-per-uniprot-accession: Best-N PDBe per UniProt. [default: 5]
Interaction partners sub-search:
--interaction.seed: UniProt ID to use as interaction partner seed. The search will be expanded to include structure identifiers of the found interaction partners. Can be specified multiple times. [default: {}]--interaction.exclude: UniProt ID to exclude as found interaction partners. Can be specified multiple times. [default: {}]--interaction.limit: Maximum number of interaction partners to return. [default: 10000]
Common:
--verbose, -v: Increase verbosity (use multiple times for more detail). [default: 0]--quiet, -q: Decrease verbosity (use multiple times for less output). [default: 0]
protein-detective candidates retrieve¶
protein-detective candidates retrieve [OPTIONS] SESSION_DIR
Retrieve structure files from AlphaFold and PDBe.
Based on previously obtained search results.
Arguments:
SESSION_DIR: The directory containing the search results. [required]
Parameters:
--alphafold-db-version: The version of the AlphaFold database to use. [default: 6]
Cache:
--no-cache: Disable caching of files to central location. [default: False]--cache-dir: Directory to use as cache for files. [default: /home/runner/.cache/protein-quest]--copy-method: How to make target file be same file as source file. By default uses hardlinks to save disk space. Note that hardlinks only work within the same filesystem and are harder to track. If you want to track cached files easily then use 'symlink'. On Windows you need developer mode or admin privileges to create symlinks. [choices: copy, symlink, hardlink] [default: hardlink]
Common:
--verbose, -v: Increase verbosity (use multiple times for more detail). [default: 0]--quiet, -q: Decrease verbosity (use multiple times for less output). [default: 0]
protein-detective candidates filter¶
protein-detective candidates filter [OPTIONS] SESSION_DIR
Filter structure files based on specified parameters.
Steps:
- Verify expected uniprot accessions are in structure files and inject uniprot accession if missing. See protein-quest convert structure --uniprots.
- Convert PDBe structure files to single chain structure files. See protein-quest filter chain.
- Filters processed PDBe structure files and AlphaFold structure files based on given parameters. See protein-quest filter combined.
- If secondary structure options are given then filters passed structure files based on secondary structure. See protein-quest filter secondary-structure.
Arguments:
SESSION_DIR: Directory where the structure files are located. [required]
Parameters:
--min-confidence: Minimal confidence (plDDT) for AlphaFold structures to pass the filter. [default: 70.0]--min-residues: Min residues in chain A. [default: 0]--max-residues: Max residues in chain A. [default: 10000000]--min-geometry-quality: Minimal geometry quality score to pass the filter. [default: 50.0]--min-sequence-identity: Minimum sequence identity ratio to the Uniprot sequence for a structure to be passed. If not set then discards structures that are not fully identical to the Uniprot sequence. For example if set to 0.8 then structures that have sequence identity below 0.8 are discarded. [default: 1.0]--top-uniprot-cluster: Maximum number of files to keep for structures per cluster per Uniprot accession. Alphafold structures are excluded from this limit. [default: 1000]--top-non-uniprot: Maximum number of files to keep for structures without Uniprot accession. [default: 0]--scheduler-address: Address of the Dask scheduler to connect to. If not provided, will create a local cluster. If set tosequentialwill run tasks sequentially.
Secondary structure sub-filter:
--secondary.abs-min-helix-residues: Minimum number of residues in helices (absolute).--secondary.abs-max-helix-residues: Maximum number of residues in helices (absolute).--secondary.abs-min-sheet-residues: Minimum number of residues in sheets (absolute).--secondary.abs-max-sheet-residues: Maximum number of residues in sheets (absolute).--secondary.ratio-min-helix-residues: Minimum helix residue ratio (fraction from 0 to 1).--secondary.ratio-max-helix-residues: Maximum helix residue ratio (fraction from 0 to 1).--secondary.ratio-min-sheet-residues: Minimum sheet residue ratio (fraction from 0 to 1).--secondary.ratio-max-sheet-residues: Maximum sheet residue ratio (fraction from 0 to 1).
Cache:
--no-cache: Disable caching of files to central location. [default: False]--cache-dir: Directory to use as cache for files. [default: /home/runner/.cache/protein-quest]--copy-method: How to make target file be same file as source file. By default uses hardlinks to save disk space. Note that hardlinks only work within the same filesystem and are harder to track. If you want to track cached files easily then use 'symlink'. On Windows you need developer mode or admin privileges to create symlinks. [choices: copy, symlink, hardlink] [default: hardlink]
Common:
--verbose, -v: Increase verbosity (use multiple times for more detail). [default: 0]--quiet, -q: Decrease verbosity (use multiple times for less output). [default: 0]
protein-detective powerfit¶
PowerFit related commands
protein-detective powerfit commands¶
protein-detective powerfit commands [OPTIONS] TARGET RESOLUTION SESSION_DIR
Generate PowerFit commands for structure files in the session directory.
See powerfit --help for more information on the available options.
Arguments:
TARGET: Target density map to fit the model in. Data should either be in CCP4 or MRC format [required]RESOLUTION: Resolution of map in Angstrom [required]SESSION_DIR: Session directory for input and output [required]
Parameters:
--powerfit-run-id: ID of the PowerFit run to use. If not provided, will autoincrement based on existing runs.--output: Output file path. If not specified, defaults to standard output.
PowerFit specific parameters:
--angle: Rotational sampling density in degree. Increasing this number by a factor of 2 results in approximately 8 times more rotations sampled. [default: 10.0]--no-laplace: Do not use the Laplace pre-filter density data. [default: False]--no-core-weighted: Do not use core-weighted local cross-correlation score. [default: False]--no-resampling: Do not resample the density map. [default: False]--resampling-rate: Resampling rate compared to Nyquist. [default: 2.0]--no-trimming: Do not trim the density map. [default: False]--trimming-cutoff: Intensity cutoff to which the map will be trimmed. Default is 10 percent of maximum intensity.
Process parameters:
--cpu: Use CPU for the intensive calculations. Otherwise off-loads to GPU. [default: False]--workers-per-gpu: Number of workers to run per GPU. [default: 1]--gpu-backend: Backend to use for GPU processing. [choices: opencl, cuda] [default: opencl]--nproc: Number of processors used during search. The number will be capped at the total number of available processors on your machine. [default: 1]--batch-size: GPU batch size to use. Use 0 to disable batching entirely, or a positive integer to force a specific batch size. Applies to GPU backends (CUDA/OpenCL). If set too high will cause out-of-memory errors. [default: 100]
Common:
--verbose, -v: Increase verbosity (use multiple times for more detail). [default: 0]--quiet, -q: Decrease verbosity (use multiple times for less output). [default: 0]
protein-detective powerfit run¶
protein-detective powerfit run [OPTIONS] TARGET RESOLUTION SESSION_DIR
Run PowerFit on PDB files in the session directory and store results.
See powerfit --help for more information on the available options.
Unlike powerfit command, no cross-correlation map (lcc.mrc file) is generated.
If you need the lcc.mrc file, use powerfit commands to generate the commands and run them manually.
Arguments:
TARGET: Target density map to fit the model in. Data should either be in CCP4 or MRC format [required]RESOLUTION: Resolution of map in Angstrom [required]SESSION_DIR: Session directory for input and output [required]
Parameters:
--powerfit-run-id: ID of the PowerFit run to use. If not provided, will autoincrement based on existing runs.
PowerFit specific parameters:
--angle: Rotational sampling density in degree. Increasing this number by a factor of 2 results in approximately 8 times more rotations sampled. [default: 10.0]--no-laplace: Do not use the Laplace pre-filter density data. [default: False]--no-core-weighted: Do not use core-weighted local cross-correlation score. [default: False]--no-resampling: Do not resample the density map. [default: False]--resampling-rate: Resampling rate compared to Nyquist. [default: 2.0]--no-trimming: Do not trim the density map. [default: False]--trimming-cutoff: Intensity cutoff to which the map will be trimmed. Default is 10 percent of maximum intensity.
Process parameters:
--cpu: Use CPU for the intensive calculations. Otherwise off-loads to GPU. [default: False]--workers-per-gpu: Number of workers to run per GPU. [default: 1]--gpu-backend: Backend to use for GPU processing. [choices: opencl, cuda] [default: opencl]--nproc: Number of processors used during search. The number will be capped at the total number of available processors on your machine. [default: 1]--batch-size: GPU batch size to use. Use 0 to disable batching entirely, or a positive integer to force a specific batch size. Applies to GPU backends (CUDA/OpenCL). If set too high will cause out-of-memory errors. [default: 100]--scheduler-address: Address of the Dask scheduler to use. Usesequentialto run PowerFit sequentially without Dask cluster. If not provided, will create a local Dask cluster.
protein-detective powerfit report¶
protein-detective powerfit report [OPTIONS] SESSION_DIR
Generate a report of the best PowerFit solutions.
Arguments:
SESSION_DIR: Session directory containing PowerFit results [required]
Parameters:
--powerfit-run-id: ID of the PowerFit run to report on--top: Number of top solutions to report per structure. [default: 1]--no-group-by-structure: If absent, group solutions by structure. If present, top will be overall instead of per structure. [default: False]--output: Output file for solutions table. If set to '-' (default) will print to stdout.
protein-detective powerfit fit-models¶
protein-detective powerfit fit-models [OPTIONS] SESSION_DIR
Fit models to the best PowerFit solutions.
Arguments:
SESSION_DIR: Session directory containing PowerFit results [required]
Parameters:
--powerfit-run-id: ID of the PowerFit run to report on--top: Number of top solutions to fit per structure. [default: 1]--no-group-by-structure: If absent, group solutions by structure. If present, top will be overall instead of per structure. [default: False]--output: Output file for fitted models table. If set to '-' (default) will print to stdout.
protein-detective powerfit list-runs¶
protein-detective powerfit list-runs [OPTIONS] SESSION_DIR
List all PowerFit runs in the session directory.
Arguments:
SESSION_DIR: Directory containing the session data. [required]
Parameters:
--output: Comma separated output file for listing runs. If set to '-' (default) will print to stdout.
protein-detective refine¶
HADDOCK3 refinement commands
protein-detective refine run¶
protein-detective refine run [OPTIONS] SESSION_DIR KNOWN_STRUCTURE
Refine structures fitted with PowerFit against a known structure using HADDOCK3.
The fitted structures will be refined against the known structure using HADDOCK3 rigidbody and molecular dynamics refinement.
The refined fitted structure and refined known structure are reconstructed from the refined complex made by HADDOCK3. The known structures original chain identifiers and residue numbers are restored.
Arguments:
SESSION_DIR: Session directory containing fitted PowerFit results [required]KNOWN_STRUCTURE: Path to the known structure to refine against. The known structure should be in the same coordinate system as the fitted structures from the session directory. The known structure should contain the known structures in the volume. Can be a PDB or mmCIF file either gzipped or not. It will be copied into session directory and converted into a structure file with all chains renamed to B. It will not be translated or rotated. [required]
Parameters:
--remove-known-chains: Chain identifiers to remove from the given known structure before renaming the remaining chains to B. For mmCIF inputs, use author chain identifiers (auth_asym_id). Use this to omit the fitted counterpart of the fitted unknown structure. To remove multiple chains, repeat the option:--remove-known-chains A --remove-known-chains C.--refine-run-id: Set refinement run ID; defaults to refine_run_NNN.--powerfit-run-id: ID of the PowerFit run to refine. If not provided, all fitted models of all powerfit runs will be refined.--scheduler-address: Address of the Dask scheduler to connect to. If not provided, will create a local cluster. If set tosequentialwill run tasks sequentially.
Refine options:
--ncores: Number of CPU cores to use for a single fitted structure. Use a large number such as 9999 to use all available CPU cores. [default: 1]--rigidbody-sampling: Number of rigidbody samples. [default: 1000]--top-clusters: Number of top clusters to keep. [default: 10]--top-models: Number of top models to keep. [default: 2]--water-refinement-sampling-factor: Factor for determining the number of water refinement samples. [default: 1]--water-refinement-solvent: Solvent used for water refinement. [choices: water, dmso, none] [default: none]--fcc-clust-cutoff: Minimum fraction of common contacts (FCC) to be considered in a cluster. [default: 0.6]
Common:
--verbose, -v: Increase verbosity (use multiple times for more detail). [default: 0]--quiet, -q: Decrease verbosity (use multiple times for less output). [default: 0]--prov: Whether to write provenance information about the command execution to ro-crate-metadata.json file. [default: False]
protein-detective refine list-runs¶
protein-detective refine list-runs [OPTIONS] SESSION_DIR
List refinement runs and saved known structures from their IO indexes.
Read command options from RO-Crate and include runs recorded in both sources.
Arguments:
SESSION_DIR: Session directory containing refinement runs. [required]
Parameters:
--output: CSV output path; defaults to standard output.
protein-detective refine report¶
protein-detective refine report [OPTIONS] SESSION_DIR
Report the best final members of every cluster for each fitted input.
By default, select the best N final-stage members from every cluster, independently for each fitted input and refinement run, using CAPRI's model-cluster_ranking. The generated workflow clusters every final model, including isolated models in single-member clusters. With --no-group-by-structure, select the best N models overall across all fitted inputs and selected refinement runs. Rank by refined_score ascending and keep the usual report order for score ties. Reporting does not change the workflow's top_clusters or top_models options.
Include UniProt accessions, fitted rank, source and refinement run IDs, cluster summaries, and individual model scores in separate columns. All file paths and refine_run_dir are prefixed with session_dir. Relative session paths remain relative to the current working directory; absolute session paths remain absolute. Model paths reference compressed PDBs produced by HADDOCK cleanup with clean = True.
Require powerfit/fitted_models.csv and powerfit/fittable_structures.csv to contain data rows matching each refined input. Discover final results directly in refinement/8_caprieval and join PowerFit CSVs in memory. Read recorded refinement runs from RO-Crate and input mappings from refine/*/io.csv. No persistent database is needed.
Run the report after all refinement runs have completed, including baseline scoring. The CLI writes CSV to stdout or the --output path. Use --refine-run-id to select one refinement run, independently of the source PowerFit run.
Report columns and their sources (CAPRI files are in each model run's last caprieval directory):
- refine_run_id: refinement ID from the refine/{refine_run_id} directory name.
- powerfit_run_id: source fitting ID from the next directory component.
- structure: source structure directory name, joined to powerfit/fittable_structures.csv column structure.
- fitted_rank: powerfit/fitted_models.csv column rank, matched through its fitted_model_file column.
- uniprot_accessions: powerfit/fittable_structures.csv column uniprot_accessions, joined by structure; accessions are colon-separated.
- cluster_id: capri_ss.tsv column cluster_id.
- cluster_rank: capri_clt.tsv column cluster_rank.
- population: capri_clt.tsv column n, before report member selection.
- under_eval: capri_clt.tsv column under_eval.
- cluster_score: capri_clt.tsv column score.
- cluster_score_std: capri_clt.tsv column score_std.
- modelcluster_ranking: capri_ss.tsv column modelcluster_ranking.
- refined_score: capri_ss.tsv column score.
- unrefined_score: HADDOCK score of unrefined structure and the known structure.
- before_cc, after_cc: fixed-coordinate PowerFit CC before and after refinement.
- cc_change: after_cc minus before_cc.
- before_fishz, after_fishz: PowerFit Fisher z before and after refinement.
- before_relative_z, after_relative_z: PowerFit relative z before and after refinement. PowerFit scores are read from each model run's powerfit-recscores.csv.
- density: path to the density map used to fit the model; empty when it was not recorded.
- unrefined_fitted_model: path to the fitted model before refinement.
- original_known_structure: path to the supplied known structure before chain removal or renaming.
- refined_complex: path to the refined complex containing both the fitted and known structures.
- refined_fitted_structure: path to the fitted structure after refinement, extracted from the refined complex.
- refined_known_structure: path to the known structure after refinement, with its original chain identifiers and residue numbers restored.
- refine_run_dir: model run directory containing baseline and refinement/8_caprieval, discovered as refine/{refine_run_id}/{powerfit_run_id}/{structure}/{fitted_model_name}.
Cluster summary columns are joined from capri_clt.tsv using cluster_id within the same model run, and are repeated for each selected member. Missing values are empty in CSV except cluster_id, which is '-'.
Arguments:
SESSION_DIR: Session directory containing refinement results. [required]
Parameters:
--refine-run-id: Refinement run to select; defaults to all runs.--top: Number of best members per cluster, or overall when grouping is disabled. This does not change the workflow's top_clusters or top_models options. [default: 1]--no-group-by-structure: Select the best top models overall instead of per fitted input and cluster. [default: False]--output: CSV output path; defaults to standard output.
protein-detective import-structures¶
protein-detective import-structures [OPTIONS] STRUCTURES_DIR SESSION_DIR
Import structures from a file or directory.
Arguments:
STRUCTURES_DIR: Directory containing structure files to import [required]SESSION_DIR: Session directory to store results [required]
Parameters:
--copy-method: Method to use for importing files. If 'copy', files will be copied. If 'symlink', symbolic links will be created. If 'hardlink', hard links will be created (unavailable on Windows). [choices: copy, symlink, hardlink] [default: hardlink]--strict: Raise an error if structure files do not meet expected criteria (single chain A, single UniProt accession). Without this flag, files that do not meet these criteria are skipped with a warning. [default: False]
Common:
--verbose, -v: Increase verbosity (use multiple times for more detail). [default: 0]--quiet, -q: Decrease verbosity (use multiple times for less output). [default: 0]
protein-detective meta¶
protein-detective meta SESSION-DIR
Generate a DuckDB metadata database for a Protein Detective session.
Filesystem paths are relative to the session directory. Raw CAPRI model
values retain their source meaning; use refined_fitted_structure and
refined_known_structure for reconstructed partners.
Recorded commands and other provenance text retain their original values.
Parameters:
SESSION-DIR, --session-dir: Session directory containing the files to include. [required]
protein-detective dashboard¶
protein-detective dashboard [OPTIONS] SESSION_DIR
Browse a session snapshot in the dashboard. Stop with Ctrl+C.
Arguments:
SESSION_DIR: Existing session directory. Missing metadata is generated before startup. [required]
Parameters:
--host: Address to bind and use in the launch URL; defaults to loopback. [default: 127.0.0.1]--port: Listening port from 0 to 65535; zero chooses an available port. [default: 8080]--browser: Open the printed launch URL automatically; disabled by default. [default: False]--dev: Start Vite with hot module replacement; requires a source checkout and npm ci. [default: False]