Bioconda

Step 1: Install conda (if not already done)

We strongly recommend using Mamba (much faster!) over miniconda/conda, but all will work.

Step 2: Create the gTranslate environment

It is strongly recommended to create a new conda environment for each version of gTranslate released.

gTranslate requires third-party packages from the conda-forge and bioconda channels, make sure to specify those channels in that order!

# using mamba (recommended)
mamba create -n gtranslate-0.0.7 -c conda-forge -c bioconda gtdb-gtranslate=0.0.7

# or using conda
conda create -n gtranslate-0.0.7 -c conda-forge -c bioconda gtdb-gtranslate=0.0.7

# activate the environment
conda activate gtranslate-0.0.7

Step 3: Download and alias the gTranslate models

gTranslate locates the models using the GTRANSLATE_MODEL_PATH environment variable, which must be set to the directory containing the models. Alternatively, the --custom_model_path argument of detect_table can be used.

You can automatically alias GTRANSLATE_MODEL_PATH whenever the environment is activated by setting environment-specific variables, e.g.:

# Activate the gTranslate conda environment
conda activate gtranslate-0.0.7

# Set the environment variable to the directory containing the gTranslate models
conda env config vars set GTRANSLATE_MODEL_PATH="/path/to/unarchived/gtranslate/models/"

# Re-activate the environment for the variable to take effect
conda deactivate
conda activate gtranslate-0.0.7

The directory must contain the following files (see gTranslate Models):

  • ada_multi_class.pkl.gz

  • dt_multi_class.pkl.gz

  • knn_multi_class.pkl.gz

  • mlp_multi_class.pkl.gz

  • xgb_multi_class.pkl.gz

  • label_encoder.pkl.gz