Skip to content

Commit 1b040bd

Browse files
fix: expanded README.md to indicate file formats and seperate execution from testing subcommands; minor code refactoring
1 parent 71c3f2b commit 1b040bd

3 files changed

Lines changed: 35 additions & 21 deletions

File tree

‎README.md‎

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,71 @@
11
# gTranslate
22

3-
**gTranslate** is a machine learning-based command-line tool designed to automatically detect and predict the genetic translation table (GTT) used in prokaryotic genomes.
4-
5-
By analyzing specific sequence features—such as coding density differences, Trp ratios, and Gly ratios—`gTranslate` utilizes advanced classifiers to accurately distinguish between different genetic codes, particularly focusing on the identification of recoding events associated with Translation Tables 11, 4 (UGA=Trp), and 25 (UGA=Gly).
3+
**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).
64

75
## Features
86

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

10+
## Installation
11+
12+
... TBD ...
13+
1214
## Usage
1315

14-
gTranslate is operated via four primary subcommands: `detect_table`, `generate_plot`, `test`, and `check_install`.
16+
gTranslate is operated via two subcommands: `detect_table` and `generate_plot`.
1517

1618
You can view the general help menu at any time:
1719
```bash
1820
gtranslate -h
1921
```
2022

21-
### 1. `detect_table`
22-
The core pipeline for detecting the genetic translation table in prokaryotic organisms. You must provide input genomes either via a directory or a batch file.
23+
### Detect table
24+
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.
2325

2426
**Basic Usage:**
2527
```bash
26-
# Process a directory of FASTA files
28+
# Process a directory of genomic FASTA files
2729
gtranslate detect_table --genome_dir /path/to/genomes --out_dir /path/to/output
2830

29-
# Process genomes defined in a batch file
31+
# Process genomic FASTA files defined in a batch file
3032
gtranslate detect_table --batchfile genomes.tsv --out_dir /path/to/output
3133
```
3234

33-
### 2. `generate_plot`
34-
Generates an interactive HTML dashboard to visually explore the features (e.g., Coding Density Difference, amino acid ratios) used for GTT prediction.
35+
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.:
36+
```
37+
/example/path/GCF_001729785.1_ASM172978v1/GCF_001729785.1.fna.gz G001729785
38+
/a/different/path/GCF_043834535.1.fna.gz G043834535
39+
...
40+
```
41+
42+
### Generate plot (optional)
43+
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.
3544

3645
**Basic Usage:**
3746
```bash
3847
gtranslate generate_plot --feature_file features.tsv --output_file dashboard.html
3948
```
4049

41-
### 3. `test`
42-
Runs the built-in test suite on bundled genomic data to validate that the GTT detection pipeline is functioning correctly on your system.
50+
The file `features.tsv` provided to `--feature_file` is generated by the `detect_table` command.
4351

44-
**Basic Usage:**
45-
```bash
46-
gtranslate test --cpus 4
47-
```
48-
*Note: If `--out_dir` is not specified, the test will securely execute in a temporary directory.*
52+
## Testing
53+
54+
Validation that gTranslate has been installed correctly and is operating as expected can be done using the `check_install` and `test` subcommands:
4955

50-
### 4. `check_install`
56+
### Check installation
5157
Verifies your installation and ensures that all required dependencies and reference data files are correctly configured and present.
5258

5359
**Basic Usage:**
5460
```bash
5561
gtranslate check_install
5662
```
5763

64+
### Test operation of gTranslate
65+
Runs the built-in test suite on bundled genomic data to validate that gTranslate is functioning correctly on your system.
66+
67+
**Basic Usage:**
68+
```bash
69+
gtranslate test --cpus 4
70+
```
71+
*Note: If `--out_dir` is not specified, the test will securely execute in a temporary directory.*

‎gtranslate/tbl_predictor.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from gtranslate.external.prodigal import Prodigal
2424
from gtranslate.files.prodigal.tln_table_summary import TranslationSummaryFile, TranslationSummaryFileRow
2525
from gtranslate.files.featurefile import FeatureFile
26-
from gtranslate.tools import tqdm_log,symlink_f
26+
from gtranslate.tools import tqdm_log, symlink_f
2727

2828

2929
class TablePredictor(object):

‎gtranslate/tools.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from gtranslate.biolib_lite.seq_io import read_fasta
1717

1818
order_rank = ["d__", "p__", "c__", "o__", 'f__', 'g__', 's__']
19+
1920
##################################################
2021
############MISC UTILITIES########################
2122
##################################################
@@ -244,4 +245,3 @@ def __exit__(self, exc_type, exc_val, exc_tb):
244245

245246
def __del__(self):
246247
self.tqdm.close()
247-

0 commit comments

Comments
 (0)