A pipeline for De Novo Genomic Annotation of Non-Model Organisms
Project description
amyg: A Pipeline for De Novo Genomic Annotation of Non-Model Organisms
amyg.py is a Python-based annotation pipeline that aims to annotate a de novo sequenced genomes (draft or complete) using RNA-seq evidence. Currently the pipeline:
- Performs GTF processing from StringTie outputs
- Generates gene annotation using GAWN with SwissProt/BLAST integration
- Resolve transcriptome coding potential with TransDecoder, producing longest ORFs, CDS, and peptide sequences for each transcript.
Currently, the pipeline can run through:
- Conda (an environment called
annotate_envwill be created in your system) - Docker (with an auto-built image
myorg/annotate_env:latest)
Synopsis
amyg --help
usage: amyg [-h] [--install {conda,docker}] [--use_conda] [--use_docker] [--threads THREADS] [--force] [--purge_all_envs] [--dups]
[--chunk_size CHUNK_SIZE] [-o OUTPUT] [-a A] [-g G]
annotation pipeline that aims to annotate a de novo sequenced genome using RNA-seq plus optional synteny BLAST for duplicates.
options:
-h, --help show this help message and exit
--install {conda,docker}
Install environment and exit.
--use_conda Run commands in conda env
--use_docker Run commands in docker image
--threads THREADS Number of CPUs (NCPUs) for gawn_config.sh
--force Overwrite database and gawn_config.sh if present
--purge_all_envs Remove the conda env and docker image, then exit.
--dups Enable chunk-based synteny BLAST to find duplicates (will run amyg_syntenyblast.py).
--chunk_size CHUNK_SIZE
Chunk size for synteny-based duplication step (only used if --dups is enabled).
-o OUTPUT, --output OUTPUT
Output directory (must exist)
-a A StringTie GTF
-g G Reference genome (in fasta format)
amyg is the next version of annotate_my_genomes but streamlines the installation and there is no need for separate config files.
Installation
Via pip:
pip install amyg
Then, users can decide to install all requirements via conda or docker as follows:
# 1) Install conda environment:
amyg --install conda
# 2) Install docker image:
amyg --install docker
# 3) Uninstall and purge old envs (optional):
amyg --purge_all_envs
- While Conda is faster, Docker image takes ~47.8 min to build in Ubuntu 24.04.1 LTS. We aimed to create a reproducible and robust local Docker image. Apologies for the delay.
Run
Currently there are two ways to run the pipeline:
1) Docker Mode
mkdir test_docker
amyg \
-a /path/to/my_genome.gtf \
-g /path/to/my_genome.fasta \
-o ./test_docker \
--threads 25 \
--use_docker \
--force
--threads 25sets number of cpus (NCPUs) for BLAST-based GAWN annotation.- The output is placed in
./test_docker. The main results of the pipeline will be inside i.e:./test_docker/amyg_20250101_150629/final_results/
2) Conda Mode
mkdir test_conda
amyg \
-a /path/to/my_genome.gtf \
-g /path/to/my_genome.fasta \
-o ./test_conda \
--threads 25 \
--use_conda \
--force
- The output is placed in
./test_conda. The main results of the pipeline will be inside i.e:./test_conda/amyg_20250101_150629/final_results/
Notes:
- Ctrl+C kills all running Docker containers, ensuring no stuck processes.
--forceoverwrites existing database/ and gawn_config.sh if they are in the output folder. We reccomend to run the pipeline fresh using this flag.
Detailed Steps
-
Download SwissProt
- Automatically fetches
swissprot.tar.gzfrom the NCBI BLAST FTP server and unpacks it into thedatabase/folder.
- Automatically fetches
-
Create
gawn_config.sh- Docker mode sets
SWISSPROT_DBto/data/database/swissprot. - Conda mode copies SwissProt into
gawn/03_dataand setsSWISSPROT_DBto03_data/swissprot.
- Docker mode sets
-
Run GAWN
- BLAST progress is monitored every 60 seconds, logging how many lines appear in
transcriptome.swissprot.
- BLAST progress is monitored every 60 seconds, logging how many lines appear in
-
TransDecoder
- Discovers longest ORFs and predicts coding regions.
-
Annotate GTF
- Downloads
annotate_gtf.pyand merges final hits intofinal_annotated.gtf. - Outputs organized to
final_results/, with any remaining TransDecoder files moved totransdecoder_results/.
- Downloads
-
Usage with Optional
--dups--dups enables chunk-based synteny BLAST viaamyg_syntenyblast.pyto identify potential duplicated regions. --chunk_size controls the size of each FASTA split for BLAST runs when --dups is used.
Organizes final results in final_results/ subfolder and leftover TransDecoder outputs in transdecoder_results/.
Interested in genome-wide duplications? please run with --dups flag
1) Docker Mode
mkdir test_docker
amyg \
-a /path/to/my_genome.gtf \
-g /path/to/my_genome.fasta \
-o ./test_docker \
--threads 25 \
--use_docker \
--force \
--dups \
--chunk_size 20000
2) Conda Mode
mkdir test_conda
amyg \
-a /path/to/my_genome.gtf \
-g /path/to/my_genome.fasta \
-o ./test_conda \
--threads 25 \
--use_conda \
--force \
--dups \
--chunk_size 20000
- Enabling
--dupsflag will also enable--chunk_sizethat will slice the genome (default at 20000 bp) and will test synteny comparing all fragments vs all, and at the end will reconstruct genomic segment with strong duplication evidence across the genome. Also, it will producefinal_annotated_dups.gtfwhich contains the annotation of duplicated genes on thefinal_annotated.gtffile - The results of the pipeline will be inside i.e:
./output_folder/amyg_20250101_150629/final_results/
Plot duplications
- Inside i.e.:
amyg_20250101_150629/final_resultsusers can do the following
wget https://raw.githubusercontent.com/cfarkas/amyg/refs/heads/main/scripts/plot_dups.py
chmod 755 plot_dups.py
python plot_dups.py \
-a transcriptome_annotation_table.tsv \
-g final_annotated_dups.gtf \
-s synteny_blocks.csv \
-o ./
This script will produce two stacked bar plots.
Plot A:
- Sorted contigs with percentage of Ancient (green), Recent (orange), Other (gray) genes
Plot B:
- Classify all duplications (either “ancient” or “recent”) as:
- "intra-only" (blue) if contig is found ONLY in self-synteny blocks
- "inter-only" (red) if contig is found ONLY in cross-synteny blocks
- "both" (black) if contig is found in both self- & cross-synteny
- "other" (gray) if duplication_type ∉ {ancient,recent} OR contig not found in synteny at all So the bar shows how we partition the entire set of duplicated genes among (intra-only, inter-only, both).
Requirements
- Python 3.7+
- Miniconda or Docker installed on your system
- Enough disk space for BLAST DB and GTF/FASTA inputs
Troubleshooting
Ctrl+C in the middle of a run Kills Docker containers so you don’t have to manually do it.
Permission
Make sure you have write access to your output directory and local Docker permissions.
License
This project is licensed under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file amyg-0.1.1.tar.gz.
File metadata
- Download URL: amyg-0.1.1.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6646f62d74bd9294defee70fb6ed488cd1701f3e233b48a6ef5d9db005ff64a
|
|
| MD5 |
92a43548ebe84153462d654f2dd1999b
|
|
| BLAKE2b-256 |
2bce9d4d490533749d5f385aa125207074e4ac05980a9fe962814fd372b30610
|
File details
Details for the file amyg-0.1.1-py3-none-any.whl.
File metadata
- Download URL: amyg-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a23b5ea60664bfd03fc32c24918b538b7643985583f8ce03c16db426c24f7d2b
|
|
| MD5 |
976bfd99eb89b4ae13d4dbbd9cfdaae8
|
|
| BLAKE2b-256 |
61ff844d753cf4a7e0b0a7b2b91ef56ffdbf471fec56a0bcdf0335264ec4caf8
|