Installation
We are still upgrading ChloroScan for better plastid MAG recovery, for the best outcomes, make sure to install latest release.
1. pip and conda/mamba
To install the workflow, use pip. Firstly create a virtual environment. We recommend Python 3.10 for the current workflow. The Python package metadata permits Python 3.9 and later, but the complete workflow has not been validated across all those versions. Use Python 3.10 for reproducible setup.
Run this to check if your python version is compatible:
python3 --version
Another key component of using ChloroScan is an appropriate conda distribution, so you need to install conda/mamba via downloading miniforge from the link: https://github.com/conda-forge/miniforge/releases/. This will give you minimal installers of conda and mamba.
Once you download the installer, run the command below to install mamba (replace the {OPERATING_SYSTEM} and {ARCHITECTURE} with your own system information, e.g., Miniforge3-Linux-x86_64.sh).:
bash Miniforge3-{OPERATING_SYSTEM}-{ARCHITECTURE}.sh
Check whether conda and mamba are intactly installed by running the commands below:
# initialize conda and mamba for bash.
conda init bash
source ~/.bashrc
conda --version
mamba --version
which mamba
which conda
NOTE: For Snakemake 7.32, use the Conda frontend explicitly (--conda-frontend=conda). This avoids requiring a downgrade to Mamba 1.x or Conda 23.3.1.
Now you can proceed to set up the virtual environment and install the chloroscan.
Cargo and FragGeneScanRs may be needed for coding-sequence extraction. The repository includes a helper installer (follow its prompts and check its prerequisites): https://github.com/Andyargueasae/chloroscan/blob/main/install_fraggenescanrs.sh.
# Download the script from the repository first, then run it:
bash install_fraggenescanrs.sh
Simply follow its prompts. Now you are ready to install ChloroScan via pip.
python3.10 -m venv chloroscan_env
source chloroscan_env/bin/activate
pip3 install chloroscan
Alternatively, you can create a conda environment with compatible python version, and install chloroscan in it. Make sure that conda/mamba is initiated for bash.
mamba create -n chloroscan_env python=3.10 -y
conda activate chloroscan_env
which pip; which python; # check if the pip and python are from the conda environment,
#!CAUTION!: default python in your machine shouldn't be shown here, it causes head-scratching issues.
python -m pip install chloroscan
# check chloroscan is installed correctly
chloroscan --help
chloroscan run --help
ChloroScan uses the Binny marker database to assess plastid MAG quality. CAT/BAT classification is optional and uses a separate database.
2. CAT database
Your choices can be either using the CAT-prepared database which contains all proteins in NCBI’s nr database. However, it is ram-taking and time-consuming when running CAT, and requires ~300GB of disk.
To assess plastid contig taxonomy, we recommend downloading our curated protein database consisting of all plastid genome-encoded proteins from NCBI and proteins from UniRef90 (size: ~85GB after unzipping). Ensure that you have sufficient disk space for both the archive and extracted files.
command to download:
figshare download -o CAT_db.tar.gz 27990278
mkdir -p /path/to/your/CAT_database
tar -xzf CAT_db.tar.gz -C /path/to/your/CAT_database
Identify the extracted CAT database and taxonomy directories (containing files such as names.dmp in the taxonomy directory). When using --use-cat, supply these directories with --cat-database and --cat-taxonomy.
3. Binny database and conda environments
You do not need to download Binny’s marker database manually. ChloroScan retrieves it during workflow execution under OUTPUT_DIR/resources/A2K_database, not while initially creating Conda environments. Ensure the output path is writable.
Run chloroscan with the flag “--conda-create-envs-only” added to setup the conda environments. Always add the flag “--use-conda” to make sure the workflow uses conda environments. You can specify the prefix of conda environments with “--conda-prefix” flag, otherwise the environments will be created in default location. You may always specify the prefix each time you run ChloroScan to avoid rebuilding.
For a typical run, provide Inputs-assembly, Inputs-batch-name, outputdir and Inputs-alignment (or a depth file), using test data if needed. The example adds --use-cat and its two paths to provision the taxonomy environments as well.
chloroscan run --use-conda --conda-frontend conda --conda-create-envs-only --conda-prefix="/path/to/your/conda/envs" \
--Inputs-assembly "/path/to/your/assembly.fasta" --Inputs-batch-name "sample_name" \
--outputdir "/path/to/your/output_dir" --Inputs-alignment "/path/to/your/bams_directory" \
--use-cat --cat-database "/path/to/your/CAT_database/db" \
--cat-taxonomy "/path/to/your/CAT_database/tax"
The example paths are placeholders: check your extracted database layout before running. This command prepares conda environments only; it does not verify a complete end-to-end run. See Full installation validation for an end-to-end procedure.
4. CPU and GPU environments
The CORGI Conda environment is CPU-compatible by default. For a compatible NVIDIA host requiring CUDA 12.4 acceleration, explicitly opt in before provisioning the rule environments:
export CHLOROSCAN_INSTALL_CUDA=1
Do not enable this option on hosts without a compatible driver and GPU. This opt-in affects rule-environment setup; it does not change the main pip install chloroscan step.
5. First-run checklist
After chloroscan run --help, verify that the CAT db directory exists, the CAT tax directory contains names.dmp, and the assembly and BAM or depth inputs are nonempty. Use a small dataset for your first run and check for OUTPUT_DIR/ChloroScan.done at completion. See Full installation validation for the validated command sequence and troubleshooting.