Skip to content

Commit 74c4047

Browse files
authored
Merge pull request #18 from moshi4/develop
Bump to v2.0.0
2 parents 538e7da + f1268aa commit 74c4047

File tree

127 files changed

+81601
-25749
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+81601
-25749
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,39 @@ on:
1111
jobs:
1212
CI:
1313
runs-on: ${{ matrix.os }}
14+
defaults:
15+
run:
16+
shell: bash
1417
strategy:
1518
matrix:
1619
os: [ubuntu-latest]
17-
python-version: ["3.8", "3.9", "3.10", "3.11"]
20+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1821
steps:
1922
- name: Checkout
2023
uses: actions/checkout@v4
2124

22-
- name: Setup Python ${{ matrix.python-version}}
23-
uses: actions/setup-python@v5
24-
with:
25-
python-version: ${{ matrix.python-version }}
26-
27-
- name: Install Poetry
25+
- name: Install Rye
2826
run: |
29-
curl -sSL https://install.python-poetry.org | python3 -
30-
echo "$HOME/.local/bin" >> $GITHUB_PATH
27+
curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash
28+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
3129
32-
- name: Install Dependencies
33-
run: poetry install -n
30+
- name: Setup Python ${{matrix.python-version}} & Dependencies
31+
run: |
32+
rye pin ${{ matrix.python-version }}
33+
rye sync --update-all --all-features
3434
3535
- name: Run ruff lint check
36-
run: poetry run ruff check --diff
36+
run: rye run ruff check --diff
3737

3838
- name: Run ruff format check
39-
run: poetry run ruff format --check --diff
39+
run: rye run ruff format --check --diff
4040

4141
- name: Run pytest
42-
run: poetry run pytest
42+
run: rye run pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=src | tee pytest-coverage.txt
43+
44+
- name: Pytest Coverage Comment
45+
uses: MishaKav/pytest-coverage-comment@main
46+
with:
47+
pytest-coverage-path: pytest-coverage.txt
48+
junitxml-path: pytest.xml
49+
if: ${{ matrix.os=='ubuntu-latest' && matrix.python-version=='3.12' }}

.github/workflows/publish_to_pypi.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Publish to PyPI
22
on:
33
release:
44
types: [released]
5+
workflow_dispatch:
56

67
jobs:
78
publish_to_pypi:
@@ -14,18 +15,13 @@ jobs:
1415
- name: Checkout
1516
uses: actions/checkout@v4
1617

17-
- name: Setup Python 3.12
18-
uses: actions/setup-python@v5
19-
with:
20-
python-version: 3.12
21-
22-
- name: Install Poetry
18+
- name: Install Rye
2319
run: |
24-
curl -sSL https://install.python-poetry.org | python3 -
25-
echo "$HOME/.local/bin" >> $GITHUB_PATH
20+
curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" bash
21+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
2622
2723
- name: Build
28-
run: poetry build
24+
run: rye build
2925

3026
- name: Publish
31-
run: poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD
27+
run: rye publish -u $PYPI_USERNAME --token $PYPI_PASSWORD -y

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
output/
22
example/
33
.vscode/
4+
notebooks/
5+
**.fna.gz
46

57
# Byte-compiled / optimized / DLL files
68
__pycache__/
@@ -60,7 +62,7 @@ coverage.xml
6062
*.pot
6163

6264
# Django stuff:
63-
*.log
65+
# *.log
6466
local_settings.py
6567
db.sqlite3
6668
db.sqlite3-journal

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/astral-sh/ruff-pre-commit
5+
rev: v0.11.6
6+
hooks:
7+
- id: ruff
8+
name: ruff lint check
9+
types_or: [python, pyi]
10+
args: [--fix]
11+
- id: ruff-format
12+
name: ruff format check
13+
types_or: [python, pyi]

README.md

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Fig2. ANI clustermap between all-vs-all 18 genomes. If no similarity detected by
2020

2121
## Installation
2222

23-
`Python 3.8 or later` is required for installation.
23+
`Python 3.9 or later` is required for installation.
2424
[fastANI](https://github.com/ParBLiSS/FastANI) or [skani](https://github.com/bluenote-1577/skani) is required to calculate ANI.
2525

2626
**Install bioconda package:**
@@ -38,7 +38,7 @@ Description of ANIclustermap's automated workflow.
3838
1. Calculate ANI between all-vs-all microbial genomes by fastANI (or skani).
3939
If no similarity detected by fastANI, NA is output. In that case, NA is replaced by 0.0.
4040
If previous result available at the time of re-run, reuse previous result.
41-
2. Clustering ANI matrix by scipy's UPGMA method.
41+
2. Clustering ANI matrix by scipy UPGMA method.
4242
3. Using clustered matrix, draw ANI clustermap by seaborn.
4343

4444
## Usage
@@ -50,37 +50,40 @@ Description of ANIclustermap's automated workflow.
5050
### Options
5151

5252
$ ANIclustermap --help
53-
usage: ANIclustermap -i [Genome fasta directory] -o [output directory]
54-
55-
Draw ANI(Average Nucleotide Identity) clustermap
56-
57-
optional arguments:
58-
-i I, --indir I Input genome fasta directory (*.fa|*.fna[.gz]|*.fasta)
59-
-o O, --outdir O Output directory
60-
-m , --mode ANI calculation mode ('fastani'[default]|'skani')
61-
-t , --thread_num Thread number parameter (Default: MaxThread - 1)
62-
--overwrite Overwrite previous ANI calculation result (Default: OFF)
63-
--fig_width Figure width (Default: 10)
64-
--fig_height Figure height (Default: 10)
65-
--dendrogram_ratio Dendrogram ratio to figsize (Default: 0.15)
66-
--cmap_colors cmap interpolation colors parameter (Default: 'lime,yellow,red')
67-
--cmap_gamma cmap gamma parameter (Default: 1.0)
68-
--cmap_ranges Range values (e.g. 80,90,95,100) for discrete cmap (Default: None)
69-
--cbar_pos Colorbar position (Default: (0.02, 0.8, 0.05, 0.18))
70-
--annotation Show ANI value annotation (Default: OFF)
71-
--annotation_fmt Annotation value format (Default: '.3g')
72-
-v, --version Print version information
73-
-h, --help Show this help message and exit
53+
54+
Usage: ANIclustermap [OPTIONS]
55+
56+
Draw ANI(Average Nucleotide Identity) clustermap
57+
58+
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────╮
59+
│ * --indir -i Input genome fasta directory (*.fa|*.fna[.gz]|*.fasta) [required] │
60+
│ * --outdir -o Output directory [required] │
61+
│ --mode ANI calculation tool (fastani|skani) [default: fastani] │
62+
│ --thread_num -t Thread number parameter [default: MaxThread - 1] │
63+
│ --overwrite Overwrite previous ANI calculation result │
64+
│ --fig_width Figure width [default: 10] │
65+
│ --fig_height Figure height [default: 10] │
66+
│ --dendrogram_ratio Dendrogram ratio to figsize [default: 0.15] │
67+
│ --cmap_colors cmap interpolation colors parameter [default: lime,yellow,red] │
68+
│ --cmap_gamma cmap gamma parameter [default: 1.0] │
69+
│ --cmap_ranges Range values (e.g. 80,90,95,100) for discrete cmap │
70+
│ --cbar_pos Colorbar position [default: 0.02, 0.85, 0.04, 0.15] │
71+
│ --annotation Show ANI value annotation │
72+
│ --annotation_fmt Annotation value format [default: .3g] │
73+
│ --quiet No print log on screen │
74+
│ --version -v Print version information │
75+
│ --help -h Show this message and exit. │
76+
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
7477

7578
### Example Command
7679

77-
7 genomes minimal dataset. Click [here](https://github.com/moshi4/ANIclustermap/wiki/dataset/minimal_dataset.zip) to download dataset (Size=3.6MB).
80+
7 genomes minimal dataset. Click [here](https://github.com/moshi4/ANIclustermap/raw/main/example/input/minimal_dataset.zip) to download dataset.
7881

7982
ANIclustermap -i ./minimal_dataset/ -o ./ANIclustermap_result
8083

8184
## Output Contents
8285

83-
ANIclustermap outputs 3 types of files.
86+
ANIclustermap outputs 3 types of result files.
8487

8588
- **`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))
8689
ANI clustermap result figure.
@@ -94,32 +97,32 @@ ANIclustermap outputs 3 types of files.
9497
## Gallery
9598

9699
Example gallery of 33 genomes normal dataset.
97-
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).
100+
If you want to try it for yourself, click [here](https://github.com/moshi4/ANIclustermap/raw/main/example/input/normal_dataset.zip) to donwload dataset.
98101

99102
**Normal parameter:**
100103

101-
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \
104+
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result01 \
102105
--fig_width 15
103106

104107
![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/01_ANIclustermap.png)
105108

106109
**Change cmap_gamma parameter:**
107110

108-
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \
111+
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result02 \
109112
--fig_width 15 --cmap_gamma 0.5
110113

111114
![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/02_ANIclustermap.png)
112115

113116
**Change cmap_colors(=white,orange,red) paramter:**
114117

115-
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \
118+
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result03 \
116119
--fig_width 15 --cmap_colors white,orange,red
117120

118121
![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/03_ANIclustermap.png)
119122

120123
**Change cmap_ranges paramter:**
121124

122-
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \
125+
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result04 \
123126
--fig_width 15 --cmap_ranges 80,85,90,92.5,95,97.5,100
124127

125128
> See [this issue](https://github.com/moshi4/ANIclustermap/issues/1) for more details.
@@ -128,7 +131,7 @@ If you want to try it for yourself, click [here](https://github.com/moshi4/ANIcl
128131

129132
**Add ANI value annotation parameter:**
130133

131-
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result \
134+
ANIclustermap -i ./normal_dataset -o ./ANIclustermap_result05 \
132135
--fig_width 20 --fig_height 15 --annotation
133136

134137
![ANIclustermap.png](https://raw.githubusercontent.com/moshi4/ANIclustermap/main/images/gallery/05_ANIclustermap.png)

example/example_run.sh

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,39 @@ OUTDIR=output
33
mkdir -p $OUTDIR
44

55
ANIclustermap -i ./input/minimal_dataset -o ${OUTDIR}/01_minimal_dataset \
6-
--fig_width 8 --fig_height 5
6+
--fig_width 8 --fig_height 5
77

88
ANIclustermap -i ./input/minimal_dataset -o ${OUTDIR}/02_minimal_dataset_annotation \
9-
--fig_width 8 --fig_height 5 --annotation
9+
--fig_width 8 --fig_height 5 --annotation
1010

1111
ANIclustermap -i ./input/small_dataset -o ${OUTDIR}/03_small_dataset \
12-
--fig_width 15
12+
--fig_width 15
1313

1414
ANIclustermap -i ./input/small_dataset -o ${OUTDIR}/04_small_dataset_annotation \
15-
--fig_width 15 --annotation
15+
--fig_width 15 --annotation
1616

1717
ANIclustermap -i ./input/normal_dataset -o ${OUTDIR}/05_normal_dataset \
18-
--fig_width 15
18+
--fig_width 15
1919

2020
ANIclustermap -i ./input/normal_dataset -o ${OUTDIR}/06_normal_dataset_annotation \
21-
--fig_width 20 --annotation
21+
--fig_width 20 --annotation
22+
23+
# Normal parameter
24+
ANIclustermap -i ./input/normal_dataset -o ${OUTDIR}/ANIclustermap_result01 \
25+
--fig_width 15
26+
27+
# Change cmap_gamma parameter
28+
ANIclustermap -i ./input/normal_dataset -o ${OUTDIR}/ANIclustermap_result02 \
29+
--fig_width 15 --cmap_gamma 0.5
30+
31+
# Change cmap_colors parameter
32+
ANIclustermap -i ./input/normal_dataset -o ${OUTDIR}/ANIclustermap_result03 \
33+
--fig_width 15 --cmap_colors white,orange,red
34+
35+
# Change cmap_ranges parameter
36+
ANIclustermap -i ./input/normal_dataset -o ${OUTDIR}/ANIclustermap_result04 \
37+
--fig_width 15 --cmap_ranges 80,85,90,92.5,95,97.5,100
38+
39+
# Add ANI value annotation parameter
40+
ANIclustermap -i ./input/normal_dataset -o ${OUTDIR}/ANIclustermap_result05 \
41+
--fig_width 20 --fig_height 15 --annotation

example/input/minimal_dataset.zip

3.42 MB
Binary file not shown.

example/input/normal_dataset.zip

65.3 MB
Binary file not shown.

example/input/small_dataset.zip

18.4 MB
Binary file not shown.
-508 Bytes
Loading

0 commit comments

Comments
 (0)