Usage

This section summarizes common CLI tasks, options, and environment variables.

CLI overview

ocdocker --help
ocdocker <command> --help

Commands

  • Optional feature installs:

    pip install "ocdocker[docking]"      # required for docking commands
    pip install "ocdocker[db]"           # required for --store-db
    pip install "ocdocker[ml]"           # required for ML workflows (PyTorch/XGBoost/Optuna)
    
  • vs: Dock a single receptor/ligand/box with one engine (vina/smina/plants)

    ocdocker vs \\
      --engine vina \\
      --receptor path/to/receptor.pdb \\
      --ligand path/to/ligand.smi \\
      --box path/to/box0.pdb \\
      --timeout 600 \\
      --store-db
    
  • pipeline: Multi-engine docking + clustering + rescoring

    ocdocker pipeline \\
      --receptor path/to/receptor.pdb \\
      --ligand path/to/ligand.sdf \\
      --box path/to/box0.pdb \\
      --engines vina,smina,plants \\
      --outdir runs/exp1 \\
      --timeout 900 \\
      --store-db
    
  • shap: Delegate to OCScore SHAP CLI

    ocdocker shap --help
    
  • console: Interactive console with tab-completion and history

    ocdocker console --conf OCDocker.cfg
    
  • doctor: Diagnostics for binaries/deps/DB

    ocdocker doctor --conf OCDocker.cfg
    
  • init-config: Create a starter OCDocker.cfg or OCDocker.yml from the example

    ocdocker init-config --conf OCDocker.cfg
    # or:
    ocdocker init-config --conf OCDocker.yml
    
  • manifest: Generate reproducibility manifest JSON with version metadata

    ocdocker manifest --conf OCDocker.cfg --output reproducibility_manifest.json
    

    Programmatic API:

    import OCDocker.Toolbox.Reproducibility as ocrepro
    manifest = ocrepro.generate_reproducibility_manifest(include_python_packages=False)
    _ = ocrepro.write_reproducibility_manifest("reproducibility_manifest.json")
    
  • script: Run a Python script with OCDocker pre-loaded (requires explicit trust opt-in)

    ocdocker script --conf OCDocker.cfg --allow-unsafe-exec script.py --arg1 value
    
  • version: Print installed version

    ocdocker version
    

Global options

All commands accept the following global options:

  • --conf: path to OCDocker.cfg or OCDocker.yml

  • --multiprocess: enable multiprocessing for compatible tasks

  • --no-multiprocess: disable multiprocessing for compatible tasks

  • --update-databases: run DB updates at startup

  • --output-level: control log level (0-5)

  • --overwrite: allow overwriting outputs when applicable

  • --log-file: write logs to a file

  • --no-stdout-log: disable logging to stdout

Bootstrap & environment

  • Auto-bootstrap happens on first import outside docs/tests.

  • Environment variables:

    • OCDOCKER_CONFIG: config file path

    • OCDOCKER_NO_AUTO_BOOTSTRAP: disable auto-bootstrap on import

    • OCDOCKER_DB_BACKEND / DB_BACKEND: select backend (postgresql, mysql, sqlite)

    • OCDOCKER_SQLITE_PATH: explicit SQLite database file path

    • OCDOCKER_TIMEOUT: default timeout (seconds) for external tools

    • OCDOCKER_SKIP_ODDT: skip importing ODDT during bootstrap

    • OCDOCKER_ALLOW_SCRIPT_EXEC: allow trusted in-process script execution

    • OCDOCKER_ALLOW_UNSAFE_DESERIALIZATION: allow trusted pickle/joblib/torch deserialization

  • For trusted scripts that need deserialization, use:

    from OCDocker.Toolbox.Security import allow_unsafe_runtime
    allow_unsafe_runtime(deserialization=True, script_exec=False)
    

See OCDocker.Initialise module for details.

Further reading