Skip to main content

pairwiseANIviz

PyPI version Downloads Downloads Downloads

Pairwise ANI (Average Nucleotide Identity) visulization tool. This tool is designed to help visualize the results of pairwise comparisons among multiple genomes.

First, Scipy is used to perform hierarchical/agglomerative clustering, followed by generating a clustermap using Seaborn that supports various Matplotlib colormaps.

Main features

  • Support various matplotlib colormaps
  • Taxonomic classification result can be included to illustrate different taxa
  • Specific outrange ANI values can be set (eg. 95% ANI values)
  • Multi-format outputs (JPG, PNG, TIFF, SVG, PDF, EPS)

Example

1. Using different matplotlib colormaps

Figure

2. With taxonomy indicated by different palettes

Figure

3. With ANI values illustrated

Figure

4. With outrange ANI values (95%) colored red

Figure

Installation

# Dependencies: Matplotlib, Seaborn, Scipy, Pandas
# Install pairwiseANIviz using pip
pip install pairwiseANIviz==1.3

Usage

overallUsage

Options

usage: pairwiseANIviz [options] anifile

positional arguments:
  anifile               File containing pairwise ANI analysis result.

options:
  -h, --help            show this help message and exit
  -v, --version         Show pairwiseANIviz version number and exit.
  -o OUTDIR, --outdir OUTDIR
                        Directory to save the output figures (default 'pairwiseANIviz').
  --method {single,complete,average,weighted,centroid,median,ward}
                        Linkage method to use for calculating clusters (default 'average').
                         See https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html#scipy.cluster.hierarchy.linkage
  --metric {braycurtis,canberra,chebyshev,cityblock,correlation,cosine,dice,euclidean,hamming,jaccard,jensenshannon,kulczynski1,mahalanobis,matching,minkowski,rogerstanimoto,russellrao,seuclidean,sokalmichener,sokalsneath,sqeuclidean,yule}
                        The distance metric to use (default 'euclidean').
                         See https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.pdist.html#scipy.spatial.distance.pdist
  -cmap COLORMAP, --colormap COLORMAP
                        Matplotlib colormap used when drawing the heatmap of ANI values (default 'Blues').
                         See https://matplotlib.org/stable/users/explain/colors/colormaps.html
  --figWidth FIGWIDTH   Figure width (default '15').
  --figHeight FIGHEIGHT
                        Figure height (default '15').
  --linewidth LINEWIDTH
                        Line width of the main heatmap (default 0.5)
  --linecolor LINECOLOR
                        Line color of the main heatmap (default 'grey').
  --rowCluster          Draw the row cluster.
  --colCluster          Draw the column cluster.
  --annotation          Show ANI values on the plot.
  --outrangeValue OUTRANGEVALUE
                        Cells have ANI values over specific threshold set to red (eg. cells have ANI value >=0.95 set to red) (default 100).
  -c CLASSIFICATIONFILE, --classificationFile CLASSIFICATIONFILE
                        File containing classification result generated by GTDBTk(https://github.com/Ecogenomics/GTDBTk).
  -t {domain,phylum,class,order,family,genus,species}, --taxaLevel {domain,phylum,class,order,family,genus,species}
                        Taxa level illustrated on the plot.
                         Choose from "domain, phylum, class, order, family, genus, species".
                         Note that this parameter only works if classification result was input.
  --colorPalette COLORPALETTE
                        Color palette used to return a specified number of evenly spaced hues which are then used to illustrate different taxa (default 'hls').
                         Note that this parameter only works if classification result was input.

General usage
----------------
1. ANI result visulization **without classification info**:
   $ pairwiseANIviz ani_result.txt --rowCluster --colCluster

2. ANI result visulization **with classification info**:
   $ pairwiseANIviz ani_result.txt --classificationFile classification_result.tsv --rowCluster --colCluster

Runjia Ji, 2023

Example usage

Suppose you have a txt file (genome_list.txt) contain a list of genomes/MAGs waiting for pairwise comparison, each line is a genome/MAG.

You can choose either fastANI or skani for the pairwise ANI calculation.

Option1. Use fastANI

fastANI --ql genome_list.txt --rl genome_list.txt -t 2 -o ani_result.txt

Option2. Use skani

skani dist --ql genome_list.txt --rl genome_list.txt -t 2 -o ani_result.txt

Then simply run:

pairwiseANIviz ani_result.txt --rowCluster --colCluster

You can adjust the linewidth, colormap, figuresize, wheather to show the x/y labels etc. based on the visualization results. Note that if you don't assign a new output folder, everytime you run it will rewrite the default output.

Citation

If you use pairwiseANIviz in your research, please cite our related paper:

Ji, R., Wan, J., Liu, J. et al. Linking morphology, genome, and metabolic activity of uncultured magnetotactic Nitrospirota at the single-cell level. Microbiome 12, 158 (2024). https://doi.org/10.1186/s40168-024-01837-6

Contact

If you have any questions using pairwiseANIviz, feel free to open an issue or contact me jirunjia@gmail.com.

Release files for pairwiseANIviz 1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pairwiseANIviz 1.4
File Size Uploaded
pairwiseaniviz-1.4.tar.gz 9.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pairwiseANIviz 1.4
File Interpreter ABI Platform
pairwiseaniviz-1.4-py3-none-any.whl Python 3 none any Details

Total release size: 19.8 kB

Release files / pairwiseaniviz-1.4.tar.gz

Download URL pairwiseaniviz-1.4.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
edb434a8a9e12d1e7332bda11a0350c2f3c19188dde8aeb6dd46c98a82aab8c7
BLAKE2b-256 checksum
How to use checksums
9573e64fc84290f1b76a5ec6445966c208a2b460d6bd317cb43279db755e0569
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / pairwiseaniviz-1.4-py3-none-any.whl

Download URL pairwiseaniviz-1.4-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2900f935968bd9ca891286dde4b2db58bb986e074e17b601bc2f19b088519b47
BLAKE2b-256 checksum
How to use checksums
27d54fc054c17f18d175a56c3b81a7fd51257e56689e4522a6995f590c74e9e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

1.4 This release

2 release files

1.3

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page