Skip to main content

Pairwise ANI (Average Nucleotide Identity) visualization tool

Project description

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

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

3. ANI result visualization **with hierarchical clustering**:
   $ pairwiseANIviz --rowCluster --colCluster ani_result.txt

Runjia Ji, 2023

Contact

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

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

pairwiseaniviz-1.3.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pairwiseaniviz-1.3-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file pairwiseaniviz-1.3.tar.gz.

File metadata

  • Download URL: pairwiseaniviz-1.3.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pairwiseaniviz-1.3.tar.gz
Algorithm Hash digest
SHA256 ea2e228c146ef1b0a8d98f60308845a32f328ac6414652296b02dfd81f42a148
MD5 1e22d85cf8cb6bd32e794bd32cf8b9a3
BLAKE2b-256 04a54bde05f8dffeb2335eb4094e0edfde2799fa43da5d4c689370ab3caf53c9

See more details on using hashes here.

File details

Details for the file pairwiseaniviz-1.3-py3-none-any.whl.

File metadata

  • Download URL: pairwiseaniviz-1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pairwiseaniviz-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 93c2c7d0ef9743a77ddc8b9a9e91fd6d4065b635030e12b4c44796af5c4ac2b7
MD5 fbce8cbb6fdd925cb1aa81f9a2d895a5
BLAKE2b-256 cb1292510b38de9ba762e747f3f6334ff59973cef4866a7d73dd3bccec5f794a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page