Observed since 20 Oct, 17:35 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Publication-quality AMR + Virulence heatmap with phylogenetic tree from abricate output
Publication-quality AMR and Virulence gene heatmap with phylogenetic tree from abricate output.
abriplot takes the TSV files produced by abricate (CARD and VFDB databases) and a Newick phylogenetic tree, and produces a single publication-ready figure with:

pip install abriplot
No Biopython required — pure Python Newick parser included.
abriplot \
--input_dir /path/to/abricate_results/ \
--tree /path/to/tree.nwk \
--output figure.pdf
This produces figure.pdf and figure.png in the current directory.
usage: abriplot [-h] --input_dir DIR --tree FILE [--output FILE] [--title TEXT]
[--min_identity FLOAT] [--min_coverage FLOAT]
[--top_amr INT] [--top_vf INT]
required arguments:
--input_dir DIR Directory containing *__card.tsv and *__vfdb.tsv files
--tree FILE Newick tree file (.nwk / .tree)
output:
--output FILE Output path — pdf, png, or svg [default: abriplot_figure.pdf]
--title TEXT Figure title [default: 'Phylogenetic Distribution of AMR
and Virulence Genes']
filtering:
--min_identity FLOAT Minimum % identity threshold [default: 80]
--min_coverage FLOAT Minimum % coverage threshold [default: 80]
--top_amr INT Keep only the N most prevalent AMR genes [default: all]
--top_vf INT Keep only the N most prevalent virulence genes [default: all]
# Custom title for a publication
abriplot --input_dir results/ --tree tree.nwk --output fig1.pdf \
--title "AMR gene distribution in V. cholerae (2002–2019)"
# Tighter figure — top 40 AMR genes, top 25 VF genes
abriplot --input_dir results/ --tree tree.nwk --output fig1.pdf \
--top_amr 40 --top_vf 25
# Stricter filtering
abriplot --input_dir results/ --tree tree.nwk --output fig1.pdf \
--min_identity 95 --min_coverage 90
abricate output files must follow the naming convention:
<sample>__card.tsv
<sample>__vfdb.tsv
These are produced automatically when you run abricate with the --db card and --db vfdb flags. Example abricate command:
abricate --db card assembly.fasta > sample__card.tsv
abricate --db vfdb assembly.fasta > sample__vfdb.tsv
from abriplot.io import load_all
from abriplot.newick import tip_order
from abriplot.plot import (build_matrix, order_by_tree,
sort_genes_by_prevalence, make_figure)
with open("tree.nwk") as f:
ordered_tips, root, leaves = tip_order(f.read())
amr_records, vf_records = load_all("results/", min_id=80, min_cov=80)
amr_mat, amr_meta = build_matrix(amr_records)
vf_mat, _ = build_matrix(vf_records)
amr_mat = order_by_tree(amr_mat, ordered_tips)
vf_mat = order_by_tree(vf_mat, ordered_tips).reindex(amr_mat.index, fill_value=0)
amr_mat = sort_genes_by_prevalence(amr_mat)
vf_mat = sort_genes_by_prevalence(vf_mat)
make_figure(amr_mat, vf_mat, amr_meta, root, leaves,
amr_mat.index.tolist(), "figure.pdf",
title="My custom title")
MIT © [Sushant Nimbhokar]
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.4 | 13 Apr 2026 | 4 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 17:35 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:f57f59a6c16fd5dcfc2b5b260eedbd5c10ee28967887e5ae9f70dbfeb672dbf8