Metadata-Version: 2.4
Name: gtdb-gtranslate
Version: 0.0.7
Summary: software tool designed to accurately identify the genetic translation table (GTT) used in prokaryotic organisms.
Author: Pierre-Alain Chaumeil, Donovan Parks
License-Expression: GPL-3.0-only
Project-URL: repository, https://github.com/cmc-aau/gTranslate
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: joblib~=1.3
Requires-Dist: numpy~=1.26
Requires-Dist: pandas~=2.2
Requires-Dist: scikit-learn==1.6.1
Requires-Dist: scipy~=1.12
Requires-Dist: tqdm~=4.67
Requires-Dist: mlxtend~=0.23
Requires-Dist: plotly~=5.15
Requires-Dist: xgboost==2.1.4
Requires-Dist: lightgbm==4.6.0
Requires-Dist: requests>=2.32.3
Dynamic: license-file

# gTranslate

[![PyPI](https://img.shields.io/pypi/v/gtdb-gtranslate.svg)](https://pypi.python.org/pypi/gtdb-gtranslate)
[![PyPI Downloads](https://pepy.tech/badge/gtdb-gtranslate)](https://pepy.tech/project/gtdb-gtranslate)
[![Bioconda](https://img.shields.io/conda/vn/bioconda/gtdb-gtranslate.svg?color=43b02a)](https://anaconda.org/bioconda/gtdb-gtranslate)
[![BioConda Downloads](https://img.shields.io/conda/dn/bioconda/gtdb-gtranslate.svg?style=flag&label=downloads&color=43b02a)](https://anaconda.org/bioconda/gtdb-gtranslate)

**gTranslate** is a machine learning-based command-line tool for predicting the translation table (TT) used by prokaryotic genomes. By analyzing specific sequence features — such as coding density differences, Trp ratios, and Gly ratios — `gTranslate` can accurately distinguish between the genetic codes associated with reassignment of the UGA stop codon, i.e. translation tables 11 (standard prokaryotic code), 4 (UGA=Trp), and 25 (UGA=Gly).

## Features

* **Automated Table Detection:** Rapidly predict the correct translation table for a single genome or large batches of genomes.
* **Interactive Visualizations:** Generate dynamic HTML dashboards to explore the feature space used by the classifiers.

## Documentation

Documentation for gTranslate can be found [here](https://cmc-aau.github.io/gTranslate/).

## Usage

gTranslate has seven subcommands:

* `detect_table` and `generate_plot` to predict translation tables and explore the features used;
* `check_install` and `test` to validate your installation (see [Testing](#testing));
* `ground_truth`, `build_features` and `fit_models` to train your own models.

You can view the general help menu at any time:
```bash
gtranslate -h
```

### Detect table
The core pipeline for detecting the translation table used by prokaryotic organisms. You must provide input genomes either via a directory or a batch file.

**Basic Usage:**
```bash
# Process a directory of genomic FASTA files
gtranslate detect_table --genome_dir /path/to/genomes --out_dir /path/to/output

# Process genomic FASTA files defined in a batch file
gtranslate detect_table --batchfile genomes.tsv --out_dir /path/to/output
```

The file provided to `--batchfile` is a two-column, tab-separated values (TSV) file that indicates the path to the genomic FASTA file and the desired genome identifier, e.g.:
```
/example/path/GCF_001729785.1_ASM172978v1/GCF_001729785.1.fna.gz	G001729785
/a/different/path/GCF_043834535.1.fna.gz	G043834535
...
```

### Generate plot (optional)
Generates an interactive HTML dashboard to visually explore the features (e.g., coding density difference, amino acid ratios) used by gTranslate to predict the translation table. 

**Basic Usage:**
```bash
gtranslate generate_plot --feature_file /path/to/output/gtranslate.feature_summary.tsv --output_file dashboard.html
```

The file `gtranslate.feature_summary.tsv` provided to `--feature_file` is generated by the `detect_table` command.

## Testing

Validation that gTranslate has been installed correctly and is operating as expected can be done using the `check_install` and `test` subcommands:

### Check installation
Verifies that all third-party software is on the system path and that the model files are present in the directory pointed to by `GTRANSLATE_MODEL_PATH`.

**Basic Usage:**
```bash
gtranslate check_install
```

### Test operation of gTranslate
Runs `detect_table` on three bundled genomes (one each for translation tables 4, 11 and 25) to validate that gTranslate is functioning correctly on your system. The models must be downloaded and `GTRANSLATE_MODEL_PATH` set before running this command.

**Basic Usage:**
```bash
gtranslate test --cpus 4
```
*Note: If `--out_dir` is not specified, the test will securely execute in a temporary directory.*
