virusdicer 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dmitry Bespiatykh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,208 @@
1
+ Metadata-Version: 2.4
2
+ Name: virusdicer
3
+ Version: 0.1.1
4
+ Summary: CLI toolkit for building distance-based proteomic virus phylogenies from protein or nucleotide inputs
5
+ Author: Dmitry Bespiatykh
6
+ Classifier: Programming Language :: Python
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: click
19
+ Requires-Dist: pyrodigal-gv
20
+ Provides-Extra: dev
21
+ Requires-Dist: black; extra == "dev"
22
+ Requires-Dist: pytest; extra == "dev"
23
+ Requires-Dist: pytest-cov; extra == "dev"
24
+ Dynamic: license-file
25
+
26
+ <p align="center">
27
+ <img src="https://github.com/dbespiatykh/VirusDicer/blob/main/assets/logo.png?raw=true" alt="virusdicer logo" height=200>
28
+ </p>
29
+ <hr>
30
+
31
+ `VirusDicer` is a command-line toolkit for building distance-based proteomic
32
+ virus phylogenies from protein or nucleotide inputs.
33
+
34
+ ## Workflow
35
+
36
+ <!-- workflow-mermaid:start -->
37
+ <details>
38
+ <summary>Show workflow chart</summary>
39
+
40
+ ```mermaid
41
+ flowchart TD
42
+ input[Input sequences or table] --> mode{Input type}
43
+ mode -->|--in-fna| orfs[Predict ORFs with pyrodigal-gv]
44
+ mode -->|--in-faa| faa[Prepare protein FASTA]
45
+ mode -->|--in-dmnd-tab| dmnd[DIAMOND output table]
46
+ orfs --> faa
47
+ faa --> blast[DIAMOND makedb + blastp]
48
+ blast --> dmnd
49
+ dmnd --> filter[Filter DIAMOND hits]
50
+ filter --> best[Best hit per query protein and target genome]
51
+ best --> score[Symmetric genome bitscore matrix]
52
+ score --> dice[Dice distance matrix]
53
+ dice --> support{Support replicates?}
54
+ support -->|yes| reps[Bootstrap or jackknife replicates]
55
+ reps --> tree[BioNJ tree with midpoint rooting]
56
+ support -->|no| tree
57
+ tree --> final[Final Newick tree]
58
+ ```
59
+
60
+ Dice distance:
61
+
62
+ $$
63
+ D_{AB} = 1 - \frac{2AB}{AA + BB}
64
+ $$
65
+
66
+ where `AB` is the symmetric bitscore between genomes `A` and `B`, and `AA`
67
+ and `BB` are their self bitscores.
68
+ </details>
69
+ <!-- workflow-mermaid:end -->
70
+
71
+ ## Installation
72
+
73
+ External dependencies:
74
+
75
+ - [DIAMOND](https://github.com/bbuchfink/diamond) (tested with v2.1.24)
76
+ - [R](https://cran.r-project.org/) (tested with v4.5.3)
77
+ - R package [ape](https://cran.r-project.org/web/packages/ape/index.html) (tested with v5.8.1)
78
+
79
+ ### If you have all the external dependencies:
80
+
81
+ ```bash
82
+ python3 -m venv venv
83
+ source venv/bin/activate
84
+ pip install virusdicer
85
+ ```
86
+
87
+ ### Conda:
88
+ ```bash
89
+ conda env create --file https://raw.githubusercontent.com/dbespiatykh/VirusDicer/refs/heads/main/environment.yml
90
+ conda activate virusdicer
91
+ virusdicer -h
92
+ ```
93
+
94
+ ## Usage
95
+ ```
96
+ Usage: virusdicer [OPTIONS]
97
+
98
+ `VirusDicer` builds a distance-based proteomic virus phylogeny.
99
+
100
+ Examples:
101
+ virusdicer --in-fna genomes/ -o virusdicer_out
102
+ virusdicer --in-dmnd-tab hits.tsv -o virusdicer_out
103
+
104
+ Provide either FAA/FNA inputs for a full end-to-end run, or a correctly
105
+ formatted all-vs-all DIAMOND outfmt6 table with self hits and columns:
106
+ qseqid sseqid pident length qlen slen evalue bitscore
107
+
108
+ Options:
109
+ --in-faa TEXT Protein FAA inputs. Provide one or more files or directories. Provide one or more
110
+ values after the option name. [default: all_proteins.faa]
111
+ --in-fna TEXT Nucleotide FASTA inputs used for ORF calling. Provide one or more files or
112
+ directories. Provide one or more values after the option name.
113
+ --in-dmnd-tab TEXT Use an existing DIAMOND outfmt6 table instead of running DIAMOND.
114
+ -o, --output-dir TEXT Write pipeline outputs to this directory. [default: virusdicer_out]
115
+ -t, --threads INTEGER Total worker budget for pyrodigal-gv ORF prediction, DIAMOND, and support
116
+ replicate computation. [default: 4]
117
+ --diamond-sensitivity INTEGER DIAMOND search sensitivity level.
118
+
119
+ 1 default
120
+ 2 fast
121
+ 3 mid-sensitive
122
+ 4 sensitive
123
+ 5 more-sensitive
124
+ 6 very-sensitive (default)
125
+ 7 ultra-sensitive
126
+ --min-pident FLOAT Minimum percent identity retained from DIAMOND hits. [default: 30.0]
127
+ --min-aalen FLOAT Minimum alignment length in amino acids retained from DIAMOND hits. [default:
128
+ 30.0]
129
+ --max-evalue FLOAT Maximum e-value retained from DIAMOND hits. [default: 0.01]
130
+ --min-bitscore FLOAT Minimum bitscore retained from DIAMOND hits. [default: 30.0]
131
+ --min-qcov FLOAT Minimum query coverage retained from DIAMOND hits. Accepts values like 50 or 0.5.
132
+ [default: 0.5]
133
+ --min-scov FLOAT Minimum subject coverage retained from DIAMOND hits. Accepts values like 50 or
134
+ 0.5. [default: 0.5]
135
+ --min-protein-len INTEGER Exclude hits where either protein is shorter than this. [default: 50]
136
+ --id-regex TEXT Regex with one capture group used to derive genome IDs from protein IDs. [default:
137
+ ^(.*)_\d+$]
138
+ --write-score-matrix Write the symmetric genome-vs-genome bitscore matrix.
139
+ --support-mode [bootstrap|jackknife]
140
+ Resampling strategy used when --support-replicates is greater than zero. [default:
141
+ bootstrap]
142
+ --support-replicates INTEGER Number of protein-level support replicates to compute for branch support. [default:
143
+ 0]
144
+ --jackknife-fraction FLOAT Fraction of proteins to keep per genome in each jackknife replicate. [default: 0.5]
145
+ --support-seed INTEGER Random seed for bootstrap or jackknife replicate generation. [default: 1984]
146
+ -v, --version Show the version and exit.
147
+ -h, --help Show this message and exit.
148
+
149
+ ```
150
+
151
+ From nucleotide FASTAs:
152
+
153
+ ```bash
154
+ virusdicer --in-fna genomes/ -o virusdicer_out
155
+ ```
156
+
157
+ From protein FASTAs:
158
+
159
+ ```bash
160
+ virusdicer --in-faa faa/ -o virusdicer_out
161
+ ```
162
+
163
+ From a DIAMOND output table:
164
+
165
+ ```bash
166
+ diamond blastp \
167
+ --query faa \
168
+ --db db \
169
+ --out diamond_output.tsv \
170
+ --outfmt 6 qseqid sseqid pident length qlen slen evalue bitscore \
171
+ --max-target-seqs 0 \
172
+ --evalue 1000.0 \
173
+ --more-sensitive
174
+
175
+
176
+ virusdicer --in-dmnd-tab diamond_output.tsv -o virusdicer_out
177
+ ```
178
+
179
+ With bootstrap support:
180
+
181
+ ```bash
182
+ virusdicer --in-fna genomes/ -o virusdicer_out \
183
+ --support-replicates 1000 \
184
+ --support-mode bootstrap
185
+ ```
186
+
187
+ ## Main output
188
+
189
+ - `virusdicer_out/dice_distance.tsv` - Distance matrix
190
+ - `virusdicer_out/genome_bitscore.tsv` when `--write-score-matrix` is used - Score matrix
191
+ - `virusdicer_out/bionj.nwk` - BioNJ phylogeny
192
+
193
+
194
+ ## Citation
195
+
196
+ - Buchfink, B., Reuter, K. & Drost, HG. Sensitive protein alignments at tree-of-life scale using DIAMOND. Nat Methods 18, 366–368 (2021). https://doi.org/10.1038/s41592-021-01101-x
197
+
198
+ - Emmanuel Paradis, Julien Claude, Korbinian Strimmer, APE: Analyses of Phylogenetics and Evolution in R language, Bioinformatics, Volume 20, Issue 2, January 2004, Pages 289–290, https://doi.org/10.1093/bioinformatics/btg412
199
+
200
+ - O Gascuel, BIONJ: an improved version of the NJ algorithm based on a simple model of sequence data., Molecular Biology and Evolution, Volume 14, Issue 7, Jul 1997, Pages 685–695, https://doi.org/10.1093/oxfordjournals.molbev.a025808
201
+
202
+ - R Core Team (2026). _R: A Language and Environment for Statistical Computing_. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/
203
+
204
+ - Hyatt, D., Chen, GL., LoCascio, P.F. et al. Prodigal: prokaryotic gene recognition and translation initiation site identification. BMC Bioinformatics 11, 119 (2010). https://doi.org/10.1186/1471-2105-11-119
205
+
206
+ - Larralde, M., (2022). Pyrodigal: Python bindings and interface to Prodigal, an efficient method for gene prediction in prokaryotes. Journal of Open Source Software, 7(72), 4296, https://doi.org/10.21105/joss.04296
207
+
208
+ - Camargo, A.P., Roux, S., Schulz, F. et al. Identification of mobile genetic elements with geNomad. Nat Biotechnol 42, 1303–1312 (2024). https://doi.org/10.1038/s41587-023-01953-y
@@ -0,0 +1,183 @@
1
+ <p align="center">
2
+ <img src="https://github.com/dbespiatykh/VirusDicer/blob/main/assets/logo.png?raw=true" alt="virusdicer logo" height=200>
3
+ </p>
4
+ <hr>
5
+
6
+ `VirusDicer` is a command-line toolkit for building distance-based proteomic
7
+ virus phylogenies from protein or nucleotide inputs.
8
+
9
+ ## Workflow
10
+
11
+ <!-- workflow-mermaid:start -->
12
+ <details>
13
+ <summary>Show workflow chart</summary>
14
+
15
+ ```mermaid
16
+ flowchart TD
17
+ input[Input sequences or table] --> mode{Input type}
18
+ mode -->|--in-fna| orfs[Predict ORFs with pyrodigal-gv]
19
+ mode -->|--in-faa| faa[Prepare protein FASTA]
20
+ mode -->|--in-dmnd-tab| dmnd[DIAMOND output table]
21
+ orfs --> faa
22
+ faa --> blast[DIAMOND makedb + blastp]
23
+ blast --> dmnd
24
+ dmnd --> filter[Filter DIAMOND hits]
25
+ filter --> best[Best hit per query protein and target genome]
26
+ best --> score[Symmetric genome bitscore matrix]
27
+ score --> dice[Dice distance matrix]
28
+ dice --> support{Support replicates?}
29
+ support -->|yes| reps[Bootstrap or jackknife replicates]
30
+ reps --> tree[BioNJ tree with midpoint rooting]
31
+ support -->|no| tree
32
+ tree --> final[Final Newick tree]
33
+ ```
34
+
35
+ Dice distance:
36
+
37
+ $$
38
+ D_{AB} = 1 - \frac{2AB}{AA + BB}
39
+ $$
40
+
41
+ where `AB` is the symmetric bitscore between genomes `A` and `B`, and `AA`
42
+ and `BB` are their self bitscores.
43
+ </details>
44
+ <!-- workflow-mermaid:end -->
45
+
46
+ ## Installation
47
+
48
+ External dependencies:
49
+
50
+ - [DIAMOND](https://github.com/bbuchfink/diamond) (tested with v2.1.24)
51
+ - [R](https://cran.r-project.org/) (tested with v4.5.3)
52
+ - R package [ape](https://cran.r-project.org/web/packages/ape/index.html) (tested with v5.8.1)
53
+
54
+ ### If you have all the external dependencies:
55
+
56
+ ```bash
57
+ python3 -m venv venv
58
+ source venv/bin/activate
59
+ pip install virusdicer
60
+ ```
61
+
62
+ ### Conda:
63
+ ```bash
64
+ conda env create --file https://raw.githubusercontent.com/dbespiatykh/VirusDicer/refs/heads/main/environment.yml
65
+ conda activate virusdicer
66
+ virusdicer -h
67
+ ```
68
+
69
+ ## Usage
70
+ ```
71
+ Usage: virusdicer [OPTIONS]
72
+
73
+ `VirusDicer` builds a distance-based proteomic virus phylogeny.
74
+
75
+ Examples:
76
+ virusdicer --in-fna genomes/ -o virusdicer_out
77
+ virusdicer --in-dmnd-tab hits.tsv -o virusdicer_out
78
+
79
+ Provide either FAA/FNA inputs for a full end-to-end run, or a correctly
80
+ formatted all-vs-all DIAMOND outfmt6 table with self hits and columns:
81
+ qseqid sseqid pident length qlen slen evalue bitscore
82
+
83
+ Options:
84
+ --in-faa TEXT Protein FAA inputs. Provide one or more files or directories. Provide one or more
85
+ values after the option name. [default: all_proteins.faa]
86
+ --in-fna TEXT Nucleotide FASTA inputs used for ORF calling. Provide one or more files or
87
+ directories. Provide one or more values after the option name.
88
+ --in-dmnd-tab TEXT Use an existing DIAMOND outfmt6 table instead of running DIAMOND.
89
+ -o, --output-dir TEXT Write pipeline outputs to this directory. [default: virusdicer_out]
90
+ -t, --threads INTEGER Total worker budget for pyrodigal-gv ORF prediction, DIAMOND, and support
91
+ replicate computation. [default: 4]
92
+ --diamond-sensitivity INTEGER DIAMOND search sensitivity level.
93
+
94
+ 1 default
95
+ 2 fast
96
+ 3 mid-sensitive
97
+ 4 sensitive
98
+ 5 more-sensitive
99
+ 6 very-sensitive (default)
100
+ 7 ultra-sensitive
101
+ --min-pident FLOAT Minimum percent identity retained from DIAMOND hits. [default: 30.0]
102
+ --min-aalen FLOAT Minimum alignment length in amino acids retained from DIAMOND hits. [default:
103
+ 30.0]
104
+ --max-evalue FLOAT Maximum e-value retained from DIAMOND hits. [default: 0.01]
105
+ --min-bitscore FLOAT Minimum bitscore retained from DIAMOND hits. [default: 30.0]
106
+ --min-qcov FLOAT Minimum query coverage retained from DIAMOND hits. Accepts values like 50 or 0.5.
107
+ [default: 0.5]
108
+ --min-scov FLOAT Minimum subject coverage retained from DIAMOND hits. Accepts values like 50 or
109
+ 0.5. [default: 0.5]
110
+ --min-protein-len INTEGER Exclude hits where either protein is shorter than this. [default: 50]
111
+ --id-regex TEXT Regex with one capture group used to derive genome IDs from protein IDs. [default:
112
+ ^(.*)_\d+$]
113
+ --write-score-matrix Write the symmetric genome-vs-genome bitscore matrix.
114
+ --support-mode [bootstrap|jackknife]
115
+ Resampling strategy used when --support-replicates is greater than zero. [default:
116
+ bootstrap]
117
+ --support-replicates INTEGER Number of protein-level support replicates to compute for branch support. [default:
118
+ 0]
119
+ --jackknife-fraction FLOAT Fraction of proteins to keep per genome in each jackknife replicate. [default: 0.5]
120
+ --support-seed INTEGER Random seed for bootstrap or jackknife replicate generation. [default: 1984]
121
+ -v, --version Show the version and exit.
122
+ -h, --help Show this message and exit.
123
+
124
+ ```
125
+
126
+ From nucleotide FASTAs:
127
+
128
+ ```bash
129
+ virusdicer --in-fna genomes/ -o virusdicer_out
130
+ ```
131
+
132
+ From protein FASTAs:
133
+
134
+ ```bash
135
+ virusdicer --in-faa faa/ -o virusdicer_out
136
+ ```
137
+
138
+ From a DIAMOND output table:
139
+
140
+ ```bash
141
+ diamond blastp \
142
+ --query faa \
143
+ --db db \
144
+ --out diamond_output.tsv \
145
+ --outfmt 6 qseqid sseqid pident length qlen slen evalue bitscore \
146
+ --max-target-seqs 0 \
147
+ --evalue 1000.0 \
148
+ --more-sensitive
149
+
150
+
151
+ virusdicer --in-dmnd-tab diamond_output.tsv -o virusdicer_out
152
+ ```
153
+
154
+ With bootstrap support:
155
+
156
+ ```bash
157
+ virusdicer --in-fna genomes/ -o virusdicer_out \
158
+ --support-replicates 1000 \
159
+ --support-mode bootstrap
160
+ ```
161
+
162
+ ## Main output
163
+
164
+ - `virusdicer_out/dice_distance.tsv` - Distance matrix
165
+ - `virusdicer_out/genome_bitscore.tsv` when `--write-score-matrix` is used - Score matrix
166
+ - `virusdicer_out/bionj.nwk` - BioNJ phylogeny
167
+
168
+
169
+ ## Citation
170
+
171
+ - Buchfink, B., Reuter, K. & Drost, HG. Sensitive protein alignments at tree-of-life scale using DIAMOND. Nat Methods 18, 366–368 (2021). https://doi.org/10.1038/s41592-021-01101-x
172
+
173
+ - Emmanuel Paradis, Julien Claude, Korbinian Strimmer, APE: Analyses of Phylogenetics and Evolution in R language, Bioinformatics, Volume 20, Issue 2, January 2004, Pages 289–290, https://doi.org/10.1093/bioinformatics/btg412
174
+
175
+ - O Gascuel, BIONJ: an improved version of the NJ algorithm based on a simple model of sequence data., Molecular Biology and Evolution, Volume 14, Issue 7, Jul 1997, Pages 685–695, https://doi.org/10.1093/oxfordjournals.molbev.a025808
176
+
177
+ - R Core Team (2026). _R: A Language and Environment for Statistical Computing_. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/
178
+
179
+ - Hyatt, D., Chen, GL., LoCascio, P.F. et al. Prodigal: prokaryotic gene recognition and translation initiation site identification. BMC Bioinformatics 11, 119 (2010). https://doi.org/10.1186/1471-2105-11-119
180
+
181
+ - Larralde, M., (2022). Pyrodigal: Python bindings and interface to Prodigal, an efficient method for gene prediction in prokaryotes. Journal of Open Source Software, 7(72), 4296, https://doi.org/10.21105/joss.04296
182
+
183
+ - Camargo, A.P., Roux, S., Schulz, F. et al. Identification of mobile genetic elements with geNomad. Nat Biotechnol 42, 1303–1312 (2024). https://doi.org/10.1038/s41587-023-01953-y
@@ -0,0 +1,71 @@
1
+ [build-system]
2
+ build-backend = "setuptools.build_meta"
3
+ requires = ["setuptools>=61"]
4
+
5
+ [project]
6
+ name = "virusdicer"
7
+ dynamic = ["version"]
8
+ description = "CLI toolkit for building distance-based proteomic virus phylogenies from protein or nucleotide inputs"
9
+ readme = { file = "README.md", content-type = "text/markdown" }
10
+ requires-python = ">=3.10"
11
+ authors = [
12
+ { name = "Dmitry Bespiatykh" },
13
+ ]
14
+ classifiers = [
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Environment :: Console",
22
+ "Intended Audience :: Science/Research",
23
+ "Topic :: Scientific/Engineering :: Bio-Informatics",
24
+ ]
25
+ dependencies = [
26
+ "click",
27
+ "pyrodigal-gv",
28
+ ]
29
+
30
+ [project.optional-dependencies]
31
+ dev = [
32
+ "black",
33
+ "pytest",
34
+ "pytest-cov",
35
+ ]
36
+
37
+ [project.scripts]
38
+ virusdicer = "virusdicer.cli:main"
39
+
40
+ [tool.setuptools]
41
+ package-dir = { "" = "src" }
42
+
43
+ [tool.setuptools.dynamic]
44
+ version = { attr = "virusdicer.__version__" }
45
+
46
+ [tool.setuptools.packages.find]
47
+ where = ["src"]
48
+
49
+ [tool.black]
50
+ line-length = 120
51
+ target-version = ["py310"]
52
+ extend-exclude = """
53
+ (
54
+ /venv
55
+ | /__pycache__
56
+ | /codex_.*
57
+ | /virusdicer_out
58
+ )
59
+ """
60
+
61
+ [tool.pytest.ini_options]
62
+ addopts = "--cov=virusdicer --cov-report=term-missing"
63
+ testpaths = ["tests"]
64
+
65
+ [tool.coverage.run]
66
+ branch = true
67
+ source = ["virusdicer"]
68
+
69
+ [tool.coverage.report]
70
+ show_missing = true
71
+ skip_covered = false
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ """
2
+ `VirusDicer` is a CLI toolkit for building distance-based proteomic virus phylogenies from protein or nucleotide inputs.
3
+ """
4
+
5
+ __version__ = "0.1.1"
@@ -0,0 +1,7 @@
1
+ """Module entry point for `python -m virusdicer`."""
2
+
3
+ from virusdicer.cli import main
4
+
5
+
6
+ if __name__ == "__main__":
7
+ main()