# ANIclustermap
![Python3](https://img.shields.io/badge/Language-Python3-steelblue)
![OS](https://img.shields.io/badge/OS-Mac_|_Linux-steelblue)
![License](https://img.shields.io/badge/License-MIT-steelblue)
[![Latest PyPI version](https://img.shields.io/pypi/v/aniclustermap.svg)](https://pypi.python.org/pypi/aniclustermap)
[![Bioconda](https://img.shields.io/conda/vn/bioconda/aniclustermap.svg?color=green)](https://anaconda.org/bioconda/aniclustermap)
## Overview
ANIclustermap is easy-to-use tool for drawing ANI(Average Nucleotide Identity) clustermap between all-vs-all microbial genomes.
ANI between all-vs-all genomes are calculated by [fastANI](https://github.com/ParBLiSS/FastANI)
(or [skani](https://github.com/bluenote-1577/skani)) and clustermap is drawn using seaborn.
![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/normal_dataset/ANIclustermap.png)
Fig1. ANI clustermap between all-vs-all 33 genomes.
![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/small_dataset/ANIclustermap_annotation.png)
Fig2. ANI clustermap between all-vs-all 18 genomes. If no similarity detected by fastANI, filled in gray.
## Installation
`Python 3.8 or later` is required for installation.
[fastANI](https://github.com/ParBLiSS/FastANI) or [skani](https://github.com/bluenote-1577/skani) is required to calculate ANI.
**Install bioconda package:**
conda install -c conda-forge -c bioconda aniclustermap
**Install PyPI stable package:**
pip install aniclustermap
## Workflow
Description of ANIclustermap's automated workflow.
1. Calculate ANI between all-vs-all microbial genomes by fastANI (or skani).
If no similarity detected by fastANI, NA is output. In that case, NA is replaced by 0.0.
If previous result available at the time of re-run, reuse previous result.
2. Clustering ANI matrix by scipy's UPGMA method.
3. Using clustered matrix, draw ANI clustermap by seaborn.
## Usage
### Basic Command
ANIclustermap -i [Genome fasta directory] -o [output directory]
### Options
$ ANIclustermap --help
usage: ANIclustermap -i [Genome fasta directory] -o [output directory]
Draw ANI(Average Nucleotide Identity) clustermap
optional arguments:
-i I, --indir I Input genome fasta directory (*.fa|*.fna[.gz]|*.fasta)
-o O, --outdir O Output directory
-m , --mode ANI calculation mode ('fastani'[default]|'skani')
-t , --thread_num Thread number parameter (Default: MaxThread - 1)
--overwrite Overwrite previous ANI calculation result (Default: OFF)
--fig_width Figure width (Default: 10)
--fig_height Figure height (Default: 10)
--dendrogram_ratio Dendrogram ratio to figsize (Default: 0.15)
--cmap_colors cmap interpolation colors parameter (Default: 'lime,yellow,red')
--cmap_gamma cmap gamma parameter (Default: 1.0)
--cmap_ranges Range values (e.g. 80,90,95,100) for discrete cmap (Default: None)
--cbar_pos Colorbar position (Default: (0.02, 0.8, 0.05, 0.18))
--annotation Show ANI value annotation (Default: OFF)
--annotation_fmt Annotation value format (Default: '.3g')
-v, --version Print version information
-h, --help Show this help message and exit
### Example Command
7 genomes minimal dataset. Click [here](https://github.com/moshi4/ANIclustermap/wiki/dataset/minimal_dataset.zip) to download dataset (Size=3.6MB).
ANIclustermap -i ./minimal_dataset/ -o ./ANIclustermap_result
## Output Contents
ANIclustermap outputs 3 types of files.
- **`ANIclustermap.[png|svg]`** ([example1](https://github.com/moshi4/ANIclustermap/blob/main/example/output/05_normal_dataset/ANIclustermap.png), [example2](https://github.com/moshi4/ANIclustermap/blob/main/example/output/06_normal_dataset_annotation/ANIclustermap.png))
ANI clustermap result figure.
- **`ANIclustermap_matrix.tsv`** ([example](https://github.com/moshi4/ANIclustermap/blob/main/example/output/05_normal_dataset/ANIclustermap_matrix.tsv))
Clustered all-vs-all ANI matrix.
- **`ANIclustermap_dendrogram.nwk`** ([example](https://github.com/moshi4/ANIclustermap/blob/main/example/output/05_normal_dataset/ANIclustermap_dendrogram.nwk))
Newick format clustering dendrogram.
## Gallery
Example gallery of 33 genomes normal dataset.
If you want to try it for yourself, click [here](https://github.com/moshi4/ANIclustermap/wiki/dataset/normal_dataset.zip) to donwload dataset (Size=63.5MB).
**Normal parameter:**
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \
--fig_width 15
![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/01_ANIclustermap.png)
**Change cmap_gamma parameter:**
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \
--fig_width 15 --cmap_gamma 0.5
![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/02_ANIclustermap.png)
**Change cmap_colors(=white,orange,red) paramter:**
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \
--fig_width 15 --cmap_colors white,orange,red
![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/03_ANIclustermap.png)
**Change cmap_ranges paramter:**
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \
--fig_width 15 --cmap_ranges 80,85,90,92.5,95,97.5,100
> See [this issue](https://github.com/moshi4/ANIclustermap/issues/1) for more details.
![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/04_ANIclustermap.png)
**Add ANI value annotation parameter:**
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \
--fig_width 20 --fig_height 15 --annotation
![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/05_ANIclustermap.png)
Raw data
{
"_id": null,
"home_page": "https://github.com/moshi4/ANIclustermap/",
"name": "aniclustermap",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "bioinformatics, genomics, phylogenetics, visualization, clustermap",
"author": "moshi",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/d8/dc/bde99ebe1cd8633d513f6e551995583953056312c5e4410a84821dcfcd0f/aniclustermap-1.4.0.tar.gz",
"platform": null,
"description": "# ANIclustermap\n\n![Python3](https://img.shields.io/badge/Language-Python3-steelblue)\n![OS](https://img.shields.io/badge/OS-Mac_|_Linux-steelblue)\n![License](https://img.shields.io/badge/License-MIT-steelblue)\n[![Latest PyPI version](https://img.shields.io/pypi/v/aniclustermap.svg)](https://pypi.python.org/pypi/aniclustermap)\n[![Bioconda](https://img.shields.io/conda/vn/bioconda/aniclustermap.svg?color=green)](https://anaconda.org/bioconda/aniclustermap) \n\n## Overview\n\nANIclustermap is easy-to-use tool for drawing ANI(Average Nucleotide Identity) clustermap between all-vs-all microbial genomes.\nANI between all-vs-all genomes are calculated by [fastANI](https://github.com/ParBLiSS/FastANI)\n(or [skani](https://github.com/bluenote-1577/skani)) and clustermap is drawn using seaborn.\n\n![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/normal_dataset/ANIclustermap.png) \nFig1. ANI clustermap between all-vs-all 33 genomes.\n\n![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/small_dataset/ANIclustermap_annotation.png) \nFig2. ANI clustermap between all-vs-all 18 genomes. If no similarity detected by fastANI, filled in gray.\n\n## Installation\n\n`Python 3.8 or later` is required for installation.\n[fastANI](https://github.com/ParBLiSS/FastANI) or [skani](https://github.com/bluenote-1577/skani) is required to calculate ANI. \n\n**Install bioconda package:**\n\n conda install -c conda-forge -c bioconda aniclustermap\n\n**Install PyPI stable package:**\n\n pip install aniclustermap\n\n## Workflow\n\nDescription of ANIclustermap's automated workflow.\n\n1. Calculate ANI between all-vs-all microbial genomes by fastANI (or skani). \n If no similarity detected by fastANI, NA is output. In that case, NA is replaced by 0.0. \n If previous result available at the time of re-run, reuse previous result.\n2. Clustering ANI matrix by scipy's UPGMA method. \n3. Using clustered matrix, draw ANI clustermap by seaborn. \n\n## Usage\n\n### Basic Command\n\n ANIclustermap -i [Genome fasta directory] -o [output directory]\n\n### Options\n\n $ ANIclustermap --help\n usage: ANIclustermap -i [Genome fasta directory] -o [output directory]\n\n Draw ANI(Average Nucleotide Identity) clustermap\n\n optional arguments:\n -i I, --indir I Input genome fasta directory (*.fa|*.fna[.gz]|*.fasta)\n -o O, --outdir O Output directory\n -m , --mode ANI calculation mode ('fastani'[default]|'skani')\n -t , --thread_num Thread number parameter (Default: MaxThread - 1)\n --overwrite Overwrite previous ANI calculation result (Default: OFF)\n --fig_width Figure width (Default: 10)\n --fig_height Figure height (Default: 10)\n --dendrogram_ratio Dendrogram ratio to figsize (Default: 0.15)\n --cmap_colors cmap interpolation colors parameter (Default: 'lime,yellow,red')\n --cmap_gamma cmap gamma parameter (Default: 1.0)\n --cmap_ranges Range values (e.g. 80,90,95,100) for discrete cmap (Default: None)\n --cbar_pos Colorbar position (Default: (0.02, 0.8, 0.05, 0.18))\n --annotation Show ANI value annotation (Default: OFF)\n --annotation_fmt Annotation value format (Default: '.3g')\n -v, --version Print version information\n -h, --help Show this help message and exit\n\n### Example Command\n\n7 genomes minimal dataset. Click [here](https://github.com/moshi4/ANIclustermap/wiki/dataset/minimal_dataset.zip) to download dataset (Size=3.6MB).\n\n ANIclustermap -i ./minimal_dataset/ -o ./ANIclustermap_result\n\n## Output Contents\n\nANIclustermap outputs 3 types of files.\n\n- **`ANIclustermap.[png|svg]`** ([example1](https://github.com/moshi4/ANIclustermap/blob/main/example/output/05_normal_dataset/ANIclustermap.png), [example2](https://github.com/moshi4/ANIclustermap/blob/main/example/output/06_normal_dataset_annotation/ANIclustermap.png)) \n ANI clustermap result figure.\n\n- **`ANIclustermap_matrix.tsv`** ([example](https://github.com/moshi4/ANIclustermap/blob/main/example/output/05_normal_dataset/ANIclustermap_matrix.tsv)) \n Clustered all-vs-all ANI matrix.\n\n- **`ANIclustermap_dendrogram.nwk`** ([example](https://github.com/moshi4/ANIclustermap/blob/main/example/output/05_normal_dataset/ANIclustermap_dendrogram.nwk)) \n Newick format clustering dendrogram.\n\n## Gallery\n\nExample gallery of 33 genomes normal dataset. \nIf you want to try it for yourself, click [here](https://github.com/moshi4/ANIclustermap/wiki/dataset/normal_dataset.zip) to donwload dataset (Size=63.5MB).\n\n**Normal parameter:**\n\n ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \\\n --fig_width 15\n\n![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/01_ANIclustermap.png) \n\n**Change cmap_gamma parameter:**\n\n ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \\ \n --fig_width 15 --cmap_gamma 0.5\n\n![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/02_ANIclustermap.png) \n\n**Change cmap_colors(=white,orange,red) paramter:**\n\n ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \\ \n --fig_width 15 --cmap_colors white,orange,red\n\n![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/03_ANIclustermap.png) \n\n**Change cmap_ranges paramter:**\n\n ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \\ \n --fig_width 15 --cmap_ranges 80,85,90,92.5,95,97.5,100\n\n> See [this issue](https://github.com/moshi4/ANIclustermap/issues/1) for more details.\n\n![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/04_ANIclustermap.png) \n\n**Add ANI value annotation parameter:**\n\n ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \\ \n --fig_width 20 --fig_height 15 --annotation\n\n![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/05_ANIclustermap.png) \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A tool for drawing ANI clustermap between all-vs-all microbial genomes",
"version": "1.4.0",
"project_urls": {
"Homepage": "https://github.com/moshi4/ANIclustermap/",
"Repository": "https://github.com/moshi4/ANIclustermap/"
},
"split_keywords": [
"bioinformatics",
" genomics",
" phylogenetics",
" visualization",
" clustermap"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e98b87e95abcd0e486086c4bb4c575a5666f938f59a01987b267c9b877cab8f0",
"md5": "96e1ea69e681f6354ebe306a1502f113",
"sha256": "25f0731cc511d251c7bda28a3b501e15efd12ac0e73b789b1c32196016b7cb9e"
},
"downloads": -1,
"filename": "aniclustermap-1.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "96e1ea69e681f6354ebe306a1502f113",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 291103,
"upload_time": "2024-07-13T03:44:38",
"upload_time_iso_8601": "2024-07-13T03:44:38.517190Z",
"url": "https://files.pythonhosted.org/packages/e9/8b/87e95abcd0e486086c4bb4c575a5666f938f59a01987b267c9b877cab8f0/aniclustermap-1.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d8dcbde99ebe1cd8633d513f6e551995583953056312c5e4410a84821dcfcd0f",
"md5": "afd841096f180d3f94b4b4b4345c9ff7",
"sha256": "c0542543ee14801d448ad9aff1abc4d7c225f94dcae21601e7c4f93bf1b63f26"
},
"downloads": -1,
"filename": "aniclustermap-1.4.0.tar.gz",
"has_sig": false,
"md5_digest": "afd841096f180d3f94b4b4b4345c9ff7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 7311320,
"upload_time": "2024-07-13T03:44:40",
"upload_time_iso_8601": "2024-07-13T03:44:40.473491Z",
"url": "https://files.pythonhosted.org/packages/d8/dc/bde99ebe1cd8633d513f6e551995583953056312c5e4410a84821dcfcd0f/aniclustermap-1.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-13 03:44:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "moshi4",
"github_project": "ANIclustermap",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aniclustermap"
}