Anvi-run-antismash and anvi-script-gen-antismash-matrix#2745
Open
jessika-fuessel wants to merge 2 commits into
Open
Anvi-run-antismash and anvi-script-gen-antismash-matrix#2745jessika-fuessel wants to merge 2 commits into
jessika-fuessel wants to merge 2 commits into
Conversation
Two new programs for biosynthetic gene cluster (BGC) analysis with antiSMASH. Anvi-run-antismash runs antiSMASH on anvi'o's contig-dbs and stores the functional annotations in the functions table. antiSMASH provides four annotation sources: antiSMASH (smCOG annotation) which comes in an antiSMASH database that the user has to download separately. For gene annotations antiSMASH uses HMMER. Then the antiSMASH_ROLE, which describes the specific role of a gene within the BGC, the antiSMASH_DOMAIN, which describes within-gene functional domains and the antiSMASH_REGION, which describes which BGC region a gene belongs to. For anvi-run-antismash to work, antiSMASH needs to be installed in a separate conda environment because it shares dependencies with anvi'o, but prefers different versions of these. You can run anvi-run-antismash on a single contig-db using the usual -c or on several contig-dbs using an -e external-genomes.txt. It skips already annotated databases, auto-discovers the antismash executable across conda environments (--antismash-dir to override), keeps a lean browsable HTML report plus per-region and per-gene TAB-delimited summaries by default (--include-detailed-output adds the heavy ClusterBlast/MIBiG/smCOG-tree analyses and the .gbk/JSON files), and saves the antiSMASH log next to the output. anvi-script-gen-antismash-matrix uses already annotated contig-dbs and can use external- and internal-genomes files to create a matrix of annotations across contig-dbs or bins in a collection. You can choose which antiSMASH annotation to use, either --genes or --regions. --regions builds a per-cluster matrix (rows are BGC product types, cells are cluster counts); --genes builds a per-gene matrix (rows are gene signatures) plus a per-gene bridge file that links each cell back to individual genes. Each mode writes a frequency matrix and a presence/absence matrix; databases never annotated with antiSMASH are reported as NA (unknown), not 0. Includes fully documented help pages for both programs (with antiSMASH and bcbio-gff setup notes) and the pyproject.toml entry points.
bdd1f4c to
17e98a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to include an option in anvi'o to annotate BCG with antiSMASH and store the annotations along with other functional annotations in the contig-db. The program anvi-run-antismash generates annotations of the individual genes in BGCs using HMMER and smCOG, antiSMASH's own database for of secondary-metabolism Clusters of Orthologous Groups, and it annotates BGC by 'region', which include several genes but a common 'biosynthetic goal'. antiSMASH needs to be run in its own conda environments as several of it's dependencies overlapp with those of anvi'o, but it requires different versions. However, once it is installed and you run it from your anvi'o environment, anvi'o will find it (or if not, there is an optional flag pointing to the location of antiSMASH).
Running the program creates four individual annotations that annotate the same genes, but at different levels:
antiSMASH(smCOG individual gene functional annotation)antiSMASH_ROLE(biosynthetic / regulatory / transport / ...)antiSMASH_DOMAIN(each biosynthetic domain the gene carries)antiSMASH_REGION(which BGC region the gene belongs to)If user would like to run it on several contig-dbs, it can accept an external-genome file and will annotate all contig-dbs listed.
anvi-run-antismash creates a new directory for each contig-db within it sores two dataframes, the 'antismash_genes.txt and the antismash_regions.txt. It also creates a browsable html output and stores a set of files needed to generate that interactive output.
The script anvi-script-gen-antismash-matrix relies on the stored antiSMASH annotations and creates a matrix across genomes either for --regions or --genes based on the external-genomes.txt. It also creates a 'per gene-bride' document linking each matrix cell to individual genes.
While my main motivation to integrate antiSMASH into anvi'o came from my need to annotate biosynthetic gene clusters in the TREC metagenomes, there is also a feature request from May 2026 #2619 suggesting the same. I wanted to ping Guillermo Rangel-Pineros, who created the feature request, in case they have some more suggestions for additional features, improving the code, testing the tool....
I created the code with the help of Claude AI.