MetaPont 0.1.1__tar.gz → 0.1.2__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.
- metapont-0.1.2/PKG-INFO +224 -0
- metapont-0.1.2/README.md +202 -0
- {metapont-0.1.1 → metapont-0.1.2}/pyproject.toml +1 -1
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/__init__.py +1 -1
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/pipeline.py +6 -4
- metapont-0.1.2/src/MetaPont.egg-info/PKG-INFO +224 -0
- metapont-0.1.1/PKG-INFO +0 -368
- metapont-0.1.1/README.md +0 -346
- metapont-0.1.1/src/MetaPont.egg-info/PKG-INFO +0 -368
- {metapont-0.1.1 → metapont-0.1.2}/LICENSE +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/setup.cfg +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/analysis.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/cli.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/compat.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/constants.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/layout.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/old/Contig_Coverage_Summary.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/old/Extract_By_Function.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/old/Extract_By_Taxa.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/old/Extract_Function_By_Taxa.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/old/Extract_Reads_By_Function.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/old/Function_By_Taxa.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/old/MetaPont_Combine.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/old/Report_Contig_Lineage.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/old/__init__.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/old/constants.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont/parsers.py +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont.egg-info/SOURCES.txt +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont.egg-info/dependency_links.txt +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont.egg-info/entry_points.txt +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont.egg-info/requires.txt +0 -0
- {metapont-0.1.1 → metapont-0.1.2}/src/MetaPont.egg-info/top_level.txt +0 -0
metapont-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: MetaPont
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Integrated analysis of metagenomic assembly, readmapping, Kraken2 and eggNOG-mapper outputs.
|
|
5
|
+
Author-email: Nicholas Dimonaco <nicholas@dimonaco.co.uk>
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
|
+
Project-URL: Homepage, https://github.com/TheHuwsLab/MetaPont
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/TheHuwsLab/MetaPont/issues
|
|
9
|
+
Keywords: metagenomics,bioinformatics,genomics,Kraken2,eggNOG-mapper,readmapping
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Provides-Extra: plots
|
|
18
|
+
Requires-Dist: matplotlib>=3.7; extra == "plots"
|
|
19
|
+
Provides-Extra: test
|
|
20
|
+
Requires-Dist: pytest>=7.0; extra == "test"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# MetaPont v0.1.2
|
|
24
|
+
|
|
25
|
+
MetaPont integrates existing metagenomic workflow outputs into per-sample and
|
|
26
|
+
cross-sample tables for contigs, taxonomy, readmapping support, and eggNOG-mapper
|
|
27
|
+
functional annotations. It is designed for outputs from the
|
|
28
|
+
[HuwsLab Metagenomic Workflow](https://github.com/TheHuwsLab/Metagenomic_Workflow),
|
|
29
|
+
but does not run assembly, readmapping, Kraken2, or eggNOG-mapper itself.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
MetaPont requires Python 3.10 or later and has no required third-party runtime
|
|
34
|
+
dependencies.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install MetaPont
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Check the installed version and available commands with:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
metapont --version
|
|
44
|
+
metapont --help
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Input layout
|
|
48
|
+
|
|
49
|
+
Pass MetaPont the directory containing sample directories. Sample directories
|
|
50
|
+
are selected when their names start with one of the comma-separated prefixes
|
|
51
|
+
provided with `--prefix`.
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
workflow-output/
|
|
55
|
+
├── E1.0/
|
|
56
|
+
│ ├── E1.0_metaspades/contigs.fasta
|
|
57
|
+
│ ├── E1.0_pyrodigal/
|
|
58
|
+
│ ├── E1.0_eggnog_mapper/
|
|
59
|
+
│ │ └── E1.0_pyrodigal_eggnog_mapped.emapper.annotations
|
|
60
|
+
│ ├── E1.0_kraken2/
|
|
61
|
+
│ │ ├── E1.0_kraken2.txt
|
|
62
|
+
│ │ └── E1.0_kraken2_report.txt
|
|
63
|
+
│ └── E1.0_readmapped/
|
|
64
|
+
│ ├── E1.0_readmapped_contig_summary.txt
|
|
65
|
+
│ └── E1.0_readmapped_cds_summary.txt
|
|
66
|
+
└── E2.0/
|
|
67
|
+
└── ...
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
MetaPont discovers common workflow naming variants and searches within each
|
|
71
|
+
sample directory for the relevant files. The main inputs are:
|
|
72
|
+
|
|
73
|
+
| Input | Used for |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| eggNOG-mapper `.emapper.annotations` | Gene annotations and functional features |
|
|
76
|
+
| Kraken2 contig classifications and report | Contig taxonomic assignments and lineages |
|
|
77
|
+
| Readmapping contig summary | Contig lengths, mapped-read counts, and mapping proportions |
|
|
78
|
+
| Readmapping CDS summary | Read support attributed to annotated genes |
|
|
79
|
+
| Contig FASTA | Contig inventory and lengths when a readmapping contig summary is absent |
|
|
80
|
+
|
|
81
|
+
Inputs are discovered independently, so incomplete samples can still be
|
|
82
|
+
included. Missing or stale outputs are reported as warnings; MetaPont does not
|
|
83
|
+
rerun missing upstream analyses. Kraken2 assignments shorter than the selected
|
|
84
|
+
minimum contig length are omitted from taxonomy attribution by default. This
|
|
85
|
+
filter does not rerun Kraken2.
|
|
86
|
+
|
|
87
|
+
## Commands
|
|
88
|
+
|
|
89
|
+
### Build integrated results
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
metapont run \
|
|
93
|
+
--root-dir /path/to/workflow-output \
|
|
94
|
+
--prefix E
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
`--prefix` accepts comma-separated values, for example `E,L,P`. By default,
|
|
98
|
+
results are written under `ROOT/MetaPont_Results`. Override that location with
|
|
99
|
+
`--output-dir`.
|
|
100
|
+
|
|
101
|
+
Useful options:
|
|
102
|
+
|
|
103
|
+
| Option | Default | Description |
|
|
104
|
+
| --- | --- | --- |
|
|
105
|
+
| `--force` | Off | Regenerate outputs even when the input signature matches a cached run. |
|
|
106
|
+
| `--no-heal-flags` | Off | Do not recreate missing upstream success flags when their outputs are complete and current. |
|
|
107
|
+
| `--min-contig-length N` | `2500` | Minimum Kraken2-assigned contig length retained for taxonomy attribution; use `0` to disable the filter. |
|
|
108
|
+
| `--taxon-function-abundance` | Off | Build the expanded taxon-by-function table. This can use substantial memory and disk space. |
|
|
109
|
+
| `--plots` | Off | Write optional quick-look PNG plots. Requires the `plots` installation extra. |
|
|
110
|
+
|
|
111
|
+
`metapont combine` is an alias for `metapont run`. The `metapont-combine`
|
|
112
|
+
command is also available for compatibility with the earlier combine command.
|
|
113
|
+
|
|
114
|
+
### Audit sample inputs
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
metapont inventory --root-dir /path/to/workflow-output --prefix E
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The inventory reports discovered inputs, expected outputs, success flags, and
|
|
121
|
+
warnings for each sample. Add `--heal-flags` to recreate a missing stage flag
|
|
122
|
+
only when its corresponding output files are complete and current.
|
|
123
|
+
|
|
124
|
+
### Summarise readmapping coverage
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
metapont coverage \
|
|
128
|
+
--root-dir /path/to/workflow-output \
|
|
129
|
+
--prefix E \
|
|
130
|
+
--read-length 150
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
The optional read length adds an approximate mapped-read coverage estimate.
|
|
134
|
+
Without `--output`, the TSV is written to
|
|
135
|
+
`MetaPont_Results/summary/contig_coverage_summary.tsv`.
|
|
136
|
+
|
|
137
|
+
### Query functions and taxa
|
|
138
|
+
|
|
139
|
+
Find taxa supporting a functional ID:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
metapont query-function \
|
|
143
|
+
--root-dir /path/to/workflow-output \
|
|
144
|
+
--function-id GO:0016597 \
|
|
145
|
+
--category GO \
|
|
146
|
+
--rank Genus \
|
|
147
|
+
--top 10 \
|
|
148
|
+
--output go_taxa.tsv
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Omit `--category` to search all supported annotation categories. `--top`
|
|
152
|
+
limits the results to the highest-support taxa per sample. Alternatively,
|
|
153
|
+
provide `--gene-table` to query a particular integrated gene table, or
|
|
154
|
+
`--output-dir` to select a non-default results directory.
|
|
155
|
+
|
|
156
|
+
Find the most supported features associated with a taxon:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
metapont query-taxon \
|
|
160
|
+
--root-dir /path/to/workflow-output \
|
|
161
|
+
--taxon Bacillus \
|
|
162
|
+
--category GO \
|
|
163
|
+
--rank Genus \
|
|
164
|
+
--top 20 \
|
|
165
|
+
--output bacillus_go.tsv
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Taxon matching is case-insensitive and searches the chosen rank as well as the
|
|
169
|
+
full lineage. `--category` is required for this query. Both query commands
|
|
170
|
+
accept an explicit `--gene-table` path; plain TSV and gzip-compressed TSV files
|
|
171
|
+
are supported.
|
|
172
|
+
|
|
173
|
+
## Results
|
|
174
|
+
|
|
175
|
+
The default output tree is:
|
|
176
|
+
|
|
177
|
+
```text
|
|
178
|
+
MetaPont_Results/
|
|
179
|
+
├── combined/
|
|
180
|
+
│ ├── all_contigs.tsv.gz
|
|
181
|
+
│ └── gene_annotations.tsv.gz
|
|
182
|
+
├── functional/
|
|
183
|
+
│ ├── functional_abundance.tsv
|
|
184
|
+
│ ├── matrices/
|
|
185
|
+
│ └── taxon_function_abundance.tsv
|
|
186
|
+
├── inventory/
|
|
187
|
+
│ └── sample_inventory.tsv
|
|
188
|
+
├── metadata/
|
|
189
|
+
│ ├── input_signature.json
|
|
190
|
+
│ └── run_manifest.json
|
|
191
|
+
├── per_sample_contigs/
|
|
192
|
+
│ └── SAMPLE_Contigs.tsv.gz
|
|
193
|
+
├── summary/
|
|
194
|
+
│ ├── pipeline_warnings.tsv
|
|
195
|
+
│ ├── sample_inventory.tsv
|
|
196
|
+
│ └── sample_summary.tsv
|
|
197
|
+
└── taxonomy/
|
|
198
|
+
└── taxonomy_abundance.tsv
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The main tables are tab-delimited; `.tsv.gz` files are gzip-compressed TSVs.
|
|
202
|
+
Functional matrices are written separately for every supported annotation
|
|
203
|
+
category, with both gene counts and gene read-support values. The optional
|
|
204
|
+
taxon-function abundance table contains taxon/category/feature combinations
|
|
205
|
+
across taxonomic ranks.
|
|
206
|
+
|
|
207
|
+
Supported functional categories include `COG`, `eggNOG_OG`, `GO`, `EC`,
|
|
208
|
+
`KEGG_KO`, `KEGG_Pathway`, `KEGG_Module`, `KEGG_Reaction`, `KEGG_rclass`,
|
|
209
|
+
`BRITE`, `KEGG_TC`, `CAZy`, `BiGG_Reaction`, and `PFAM`.
|
|
210
|
+
|
|
211
|
+
`Gene_Read_Support` is derived from read-to-CDS overlaps in the CDS summary; it
|
|
212
|
+
is not a count of unique reads across genes. A read can support multiple genes
|
|
213
|
+
or annotations, so functional support values are not mutually exclusive.
|
|
214
|
+
Taxonomic relative abundance uses total mapped-read support as its denominator.
|
|
215
|
+
|
|
216
|
+
Samples with missing or stale workflow outputs are retained where possible and
|
|
217
|
+
listed in `summary/pipeline_warnings.tsv`. A clean run writes
|
|
218
|
+
`MetaPont_analysis.success`; a run with warnings writes
|
|
219
|
+
`completed_with_warnings.flag`.
|
|
220
|
+
|
|
221
|
+
## License
|
|
222
|
+
|
|
223
|
+
MetaPont is distributed under the
|
|
224
|
+
[GNU General Public License v3.0 or later](LICENSE).
|
metapont-0.1.2/README.md
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# MetaPont v0.1.2
|
|
2
|
+
|
|
3
|
+
MetaPont integrates existing metagenomic workflow outputs into per-sample and
|
|
4
|
+
cross-sample tables for contigs, taxonomy, readmapping support, and eggNOG-mapper
|
|
5
|
+
functional annotations. It is designed for outputs from the
|
|
6
|
+
[HuwsLab Metagenomic Workflow](https://github.com/TheHuwsLab/Metagenomic_Workflow),
|
|
7
|
+
but does not run assembly, readmapping, Kraken2, or eggNOG-mapper itself.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
MetaPont requires Python 3.10 or later and has no required third-party runtime
|
|
12
|
+
dependencies.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install MetaPont
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Check the installed version and available commands with:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
metapont --version
|
|
22
|
+
metapont --help
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Input layout
|
|
26
|
+
|
|
27
|
+
Pass MetaPont the directory containing sample directories. Sample directories
|
|
28
|
+
are selected when their names start with one of the comma-separated prefixes
|
|
29
|
+
provided with `--prefix`.
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
workflow-output/
|
|
33
|
+
├── E1.0/
|
|
34
|
+
│ ├── E1.0_metaspades/contigs.fasta
|
|
35
|
+
│ ├── E1.0_pyrodigal/
|
|
36
|
+
│ ├── E1.0_eggnog_mapper/
|
|
37
|
+
│ │ └── E1.0_pyrodigal_eggnog_mapped.emapper.annotations
|
|
38
|
+
│ ├── E1.0_kraken2/
|
|
39
|
+
│ │ ├── E1.0_kraken2.txt
|
|
40
|
+
│ │ └── E1.0_kraken2_report.txt
|
|
41
|
+
│ └── E1.0_readmapped/
|
|
42
|
+
│ ├── E1.0_readmapped_contig_summary.txt
|
|
43
|
+
│ └── E1.0_readmapped_cds_summary.txt
|
|
44
|
+
└── E2.0/
|
|
45
|
+
└── ...
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
MetaPont discovers common workflow naming variants and searches within each
|
|
49
|
+
sample directory for the relevant files. The main inputs are:
|
|
50
|
+
|
|
51
|
+
| Input | Used for |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| eggNOG-mapper `.emapper.annotations` | Gene annotations and functional features |
|
|
54
|
+
| Kraken2 contig classifications and report | Contig taxonomic assignments and lineages |
|
|
55
|
+
| Readmapping contig summary | Contig lengths, mapped-read counts, and mapping proportions |
|
|
56
|
+
| Readmapping CDS summary | Read support attributed to annotated genes |
|
|
57
|
+
| Contig FASTA | Contig inventory and lengths when a readmapping contig summary is absent |
|
|
58
|
+
|
|
59
|
+
Inputs are discovered independently, so incomplete samples can still be
|
|
60
|
+
included. Missing or stale outputs are reported as warnings; MetaPont does not
|
|
61
|
+
rerun missing upstream analyses. Kraken2 assignments shorter than the selected
|
|
62
|
+
minimum contig length are omitted from taxonomy attribution by default. This
|
|
63
|
+
filter does not rerun Kraken2.
|
|
64
|
+
|
|
65
|
+
## Commands
|
|
66
|
+
|
|
67
|
+
### Build integrated results
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
metapont run \
|
|
71
|
+
--root-dir /path/to/workflow-output \
|
|
72
|
+
--prefix E
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`--prefix` accepts comma-separated values, for example `E,L,P`. By default,
|
|
76
|
+
results are written under `ROOT/MetaPont_Results`. Override that location with
|
|
77
|
+
`--output-dir`.
|
|
78
|
+
|
|
79
|
+
Useful options:
|
|
80
|
+
|
|
81
|
+
| Option | Default | Description |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| `--force` | Off | Regenerate outputs even when the input signature matches a cached run. |
|
|
84
|
+
| `--no-heal-flags` | Off | Do not recreate missing upstream success flags when their outputs are complete and current. |
|
|
85
|
+
| `--min-contig-length N` | `2500` | Minimum Kraken2-assigned contig length retained for taxonomy attribution; use `0` to disable the filter. |
|
|
86
|
+
| `--taxon-function-abundance` | Off | Build the expanded taxon-by-function table. This can use substantial memory and disk space. |
|
|
87
|
+
| `--plots` | Off | Write optional quick-look PNG plots. Requires the `plots` installation extra. |
|
|
88
|
+
|
|
89
|
+
`metapont combine` is an alias for `metapont run`. The `metapont-combine`
|
|
90
|
+
command is also available for compatibility with the earlier combine command.
|
|
91
|
+
|
|
92
|
+
### Audit sample inputs
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
metapont inventory --root-dir /path/to/workflow-output --prefix E
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The inventory reports discovered inputs, expected outputs, success flags, and
|
|
99
|
+
warnings for each sample. Add `--heal-flags` to recreate a missing stage flag
|
|
100
|
+
only when its corresponding output files are complete and current.
|
|
101
|
+
|
|
102
|
+
### Summarise readmapping coverage
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
metapont coverage \
|
|
106
|
+
--root-dir /path/to/workflow-output \
|
|
107
|
+
--prefix E \
|
|
108
|
+
--read-length 150
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The optional read length adds an approximate mapped-read coverage estimate.
|
|
112
|
+
Without `--output`, the TSV is written to
|
|
113
|
+
`MetaPont_Results/summary/contig_coverage_summary.tsv`.
|
|
114
|
+
|
|
115
|
+
### Query functions and taxa
|
|
116
|
+
|
|
117
|
+
Find taxa supporting a functional ID:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
metapont query-function \
|
|
121
|
+
--root-dir /path/to/workflow-output \
|
|
122
|
+
--function-id GO:0016597 \
|
|
123
|
+
--category GO \
|
|
124
|
+
--rank Genus \
|
|
125
|
+
--top 10 \
|
|
126
|
+
--output go_taxa.tsv
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Omit `--category` to search all supported annotation categories. `--top`
|
|
130
|
+
limits the results to the highest-support taxa per sample. Alternatively,
|
|
131
|
+
provide `--gene-table` to query a particular integrated gene table, or
|
|
132
|
+
`--output-dir` to select a non-default results directory.
|
|
133
|
+
|
|
134
|
+
Find the most supported features associated with a taxon:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
metapont query-taxon \
|
|
138
|
+
--root-dir /path/to/workflow-output \
|
|
139
|
+
--taxon Bacillus \
|
|
140
|
+
--category GO \
|
|
141
|
+
--rank Genus \
|
|
142
|
+
--top 20 \
|
|
143
|
+
--output bacillus_go.tsv
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Taxon matching is case-insensitive and searches the chosen rank as well as the
|
|
147
|
+
full lineage. `--category` is required for this query. Both query commands
|
|
148
|
+
accept an explicit `--gene-table` path; plain TSV and gzip-compressed TSV files
|
|
149
|
+
are supported.
|
|
150
|
+
|
|
151
|
+
## Results
|
|
152
|
+
|
|
153
|
+
The default output tree is:
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
MetaPont_Results/
|
|
157
|
+
├── combined/
|
|
158
|
+
│ ├── all_contigs.tsv.gz
|
|
159
|
+
│ └── gene_annotations.tsv.gz
|
|
160
|
+
├── functional/
|
|
161
|
+
│ ├── functional_abundance.tsv
|
|
162
|
+
│ ├── matrices/
|
|
163
|
+
│ └── taxon_function_abundance.tsv
|
|
164
|
+
├── inventory/
|
|
165
|
+
│ └── sample_inventory.tsv
|
|
166
|
+
├── metadata/
|
|
167
|
+
│ ├── input_signature.json
|
|
168
|
+
│ └── run_manifest.json
|
|
169
|
+
├── per_sample_contigs/
|
|
170
|
+
│ └── SAMPLE_Contigs.tsv.gz
|
|
171
|
+
├── summary/
|
|
172
|
+
│ ├── pipeline_warnings.tsv
|
|
173
|
+
│ ├── sample_inventory.tsv
|
|
174
|
+
│ └── sample_summary.tsv
|
|
175
|
+
└── taxonomy/
|
|
176
|
+
└── taxonomy_abundance.tsv
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The main tables are tab-delimited; `.tsv.gz` files are gzip-compressed TSVs.
|
|
180
|
+
Functional matrices are written separately for every supported annotation
|
|
181
|
+
category, with both gene counts and gene read-support values. The optional
|
|
182
|
+
taxon-function abundance table contains taxon/category/feature combinations
|
|
183
|
+
across taxonomic ranks.
|
|
184
|
+
|
|
185
|
+
Supported functional categories include `COG`, `eggNOG_OG`, `GO`, `EC`,
|
|
186
|
+
`KEGG_KO`, `KEGG_Pathway`, `KEGG_Module`, `KEGG_Reaction`, `KEGG_rclass`,
|
|
187
|
+
`BRITE`, `KEGG_TC`, `CAZy`, `BiGG_Reaction`, and `PFAM`.
|
|
188
|
+
|
|
189
|
+
`Gene_Read_Support` is derived from read-to-CDS overlaps in the CDS summary; it
|
|
190
|
+
is not a count of unique reads across genes. A read can support multiple genes
|
|
191
|
+
or annotations, so functional support values are not mutually exclusive.
|
|
192
|
+
Taxonomic relative abundance uses total mapped-read support as its denominator.
|
|
193
|
+
|
|
194
|
+
Samples with missing or stale workflow outputs are retained where possible and
|
|
195
|
+
listed in `summary/pipeline_warnings.tsv`. A clean run writes
|
|
196
|
+
`MetaPont_analysis.success`; a run with warnings writes
|
|
197
|
+
`completed_with_warnings.flag`.
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
MetaPont is distributed under the
|
|
202
|
+
[GNU General Public License v3.0 or later](LICENSE).
|
|
@@ -285,7 +285,8 @@ def _contig_row(sample_name: str, base: dict[str, Any], tax: dict[str, Any] | No
|
|
|
285
285
|
return out
|
|
286
286
|
|
|
287
287
|
|
|
288
|
-
def _input_signature(samples: list[SamplePaths], min_contig_length: int
|
|
288
|
+
def _input_signature(samples: list[SamplePaths], min_contig_length: int,
|
|
289
|
+
include_taxon_function_abundance: bool) -> dict[str, Any]:
|
|
289
290
|
records = []
|
|
290
291
|
for sample in samples:
|
|
291
292
|
selected = [
|
|
@@ -306,7 +307,8 @@ def _input_signature(samples: list[SamplePaths], min_contig_length: int) -> dict
|
|
|
306
307
|
return {"version": __version__, "signature": digest, "parameters": parameters, "inputs": records}
|
|
307
308
|
|
|
308
309
|
|
|
309
|
-
def _valid_cached_outputs(output_root: Path, signature: dict[str, Any], force: bool,
|
|
310
|
+
def _valid_cached_outputs(output_root: Path, signature: dict[str, Any], force: bool,
|
|
311
|
+
samples: list[SamplePaths], include_taxon_function_abundance: bool) -> bool:
|
|
310
312
|
manifest = output_root / "metadata" / "input_signature.json"
|
|
311
313
|
required = [
|
|
312
314
|
output_root / "combined" / "all_contigs.tsv.gz",
|
|
@@ -357,8 +359,8 @@ def run_analysis(root_dir: str | Path, prefixes: str, output_dir: str | Path | N
|
|
|
357
359
|
with (dirs["inventory"] / "flag_healing.log").open("a", encoding="utf-8") as handle:
|
|
358
360
|
handle.write("\n".join(healed_events) + "\n")
|
|
359
361
|
|
|
360
|
-
signature = _input_signature(samples, min_contig_length)
|
|
361
|
-
if _valid_cached_outputs(output_root, signature, force, samples):
|
|
362
|
+
signature = _input_signature(samples, min_contig_length, include_taxon_function_abundance)
|
|
363
|
+
if _valid_cached_outputs(output_root, signature, force, samples, include_taxon_function_abundance):
|
|
362
364
|
warnings_path = dirs["summary"] / "pipeline_warnings.tsv"
|
|
363
365
|
has_warnings = _nonempty(warnings_path) and sum(1 for _ in warnings_path.open(encoding="utf-8")) > 1
|
|
364
366
|
complete_flag = output_root / "MetaPont_analysis.success"
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: MetaPont
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Integrated analysis of metagenomic assembly, readmapping, Kraken2 and eggNOG-mapper outputs.
|
|
5
|
+
Author-email: Nicholas Dimonaco <nicholas@dimonaco.co.uk>
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
|
+
Project-URL: Homepage, https://github.com/TheHuwsLab/MetaPont
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/TheHuwsLab/MetaPont/issues
|
|
9
|
+
Keywords: metagenomics,bioinformatics,genomics,Kraken2,eggNOG-mapper,readmapping
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Provides-Extra: plots
|
|
18
|
+
Requires-Dist: matplotlib>=3.7; extra == "plots"
|
|
19
|
+
Provides-Extra: test
|
|
20
|
+
Requires-Dist: pytest>=7.0; extra == "test"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# MetaPont v0.1.2
|
|
24
|
+
|
|
25
|
+
MetaPont integrates existing metagenomic workflow outputs into per-sample and
|
|
26
|
+
cross-sample tables for contigs, taxonomy, readmapping support, and eggNOG-mapper
|
|
27
|
+
functional annotations. It is designed for outputs from the
|
|
28
|
+
[HuwsLab Metagenomic Workflow](https://github.com/TheHuwsLab/Metagenomic_Workflow),
|
|
29
|
+
but does not run assembly, readmapping, Kraken2, or eggNOG-mapper itself.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
MetaPont requires Python 3.10 or later and has no required third-party runtime
|
|
34
|
+
dependencies.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install MetaPont
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Check the installed version and available commands with:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
metapont --version
|
|
44
|
+
metapont --help
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Input layout
|
|
48
|
+
|
|
49
|
+
Pass MetaPont the directory containing sample directories. Sample directories
|
|
50
|
+
are selected when their names start with one of the comma-separated prefixes
|
|
51
|
+
provided with `--prefix`.
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
workflow-output/
|
|
55
|
+
├── E1.0/
|
|
56
|
+
│ ├── E1.0_metaspades/contigs.fasta
|
|
57
|
+
│ ├── E1.0_pyrodigal/
|
|
58
|
+
│ ├── E1.0_eggnog_mapper/
|
|
59
|
+
│ │ └── E1.0_pyrodigal_eggnog_mapped.emapper.annotations
|
|
60
|
+
│ ├── E1.0_kraken2/
|
|
61
|
+
│ │ ├── E1.0_kraken2.txt
|
|
62
|
+
│ │ └── E1.0_kraken2_report.txt
|
|
63
|
+
│ └── E1.0_readmapped/
|
|
64
|
+
│ ├── E1.0_readmapped_contig_summary.txt
|
|
65
|
+
│ └── E1.0_readmapped_cds_summary.txt
|
|
66
|
+
└── E2.0/
|
|
67
|
+
└── ...
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
MetaPont discovers common workflow naming variants and searches within each
|
|
71
|
+
sample directory for the relevant files. The main inputs are:
|
|
72
|
+
|
|
73
|
+
| Input | Used for |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| eggNOG-mapper `.emapper.annotations` | Gene annotations and functional features |
|
|
76
|
+
| Kraken2 contig classifications and report | Contig taxonomic assignments and lineages |
|
|
77
|
+
| Readmapping contig summary | Contig lengths, mapped-read counts, and mapping proportions |
|
|
78
|
+
| Readmapping CDS summary | Read support attributed to annotated genes |
|
|
79
|
+
| Contig FASTA | Contig inventory and lengths when a readmapping contig summary is absent |
|
|
80
|
+
|
|
81
|
+
Inputs are discovered independently, so incomplete samples can still be
|
|
82
|
+
included. Missing or stale outputs are reported as warnings; MetaPont does not
|
|
83
|
+
rerun missing upstream analyses. Kraken2 assignments shorter than the selected
|
|
84
|
+
minimum contig length are omitted from taxonomy attribution by default. This
|
|
85
|
+
filter does not rerun Kraken2.
|
|
86
|
+
|
|
87
|
+
## Commands
|
|
88
|
+
|
|
89
|
+
### Build integrated results
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
metapont run \
|
|
93
|
+
--root-dir /path/to/workflow-output \
|
|
94
|
+
--prefix E
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
`--prefix` accepts comma-separated values, for example `E,L,P`. By default,
|
|
98
|
+
results are written under `ROOT/MetaPont_Results`. Override that location with
|
|
99
|
+
`--output-dir`.
|
|
100
|
+
|
|
101
|
+
Useful options:
|
|
102
|
+
|
|
103
|
+
| Option | Default | Description |
|
|
104
|
+
| --- | --- | --- |
|
|
105
|
+
| `--force` | Off | Regenerate outputs even when the input signature matches a cached run. |
|
|
106
|
+
| `--no-heal-flags` | Off | Do not recreate missing upstream success flags when their outputs are complete and current. |
|
|
107
|
+
| `--min-contig-length N` | `2500` | Minimum Kraken2-assigned contig length retained for taxonomy attribution; use `0` to disable the filter. |
|
|
108
|
+
| `--taxon-function-abundance` | Off | Build the expanded taxon-by-function table. This can use substantial memory and disk space. |
|
|
109
|
+
| `--plots` | Off | Write optional quick-look PNG plots. Requires the `plots` installation extra. |
|
|
110
|
+
|
|
111
|
+
`metapont combine` is an alias for `metapont run`. The `metapont-combine`
|
|
112
|
+
command is also available for compatibility with the earlier combine command.
|
|
113
|
+
|
|
114
|
+
### Audit sample inputs
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
metapont inventory --root-dir /path/to/workflow-output --prefix E
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The inventory reports discovered inputs, expected outputs, success flags, and
|
|
121
|
+
warnings for each sample. Add `--heal-flags` to recreate a missing stage flag
|
|
122
|
+
only when its corresponding output files are complete and current.
|
|
123
|
+
|
|
124
|
+
### Summarise readmapping coverage
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
metapont coverage \
|
|
128
|
+
--root-dir /path/to/workflow-output \
|
|
129
|
+
--prefix E \
|
|
130
|
+
--read-length 150
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
The optional read length adds an approximate mapped-read coverage estimate.
|
|
134
|
+
Without `--output`, the TSV is written to
|
|
135
|
+
`MetaPont_Results/summary/contig_coverage_summary.tsv`.
|
|
136
|
+
|
|
137
|
+
### Query functions and taxa
|
|
138
|
+
|
|
139
|
+
Find taxa supporting a functional ID:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
metapont query-function \
|
|
143
|
+
--root-dir /path/to/workflow-output \
|
|
144
|
+
--function-id GO:0016597 \
|
|
145
|
+
--category GO \
|
|
146
|
+
--rank Genus \
|
|
147
|
+
--top 10 \
|
|
148
|
+
--output go_taxa.tsv
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Omit `--category` to search all supported annotation categories. `--top`
|
|
152
|
+
limits the results to the highest-support taxa per sample. Alternatively,
|
|
153
|
+
provide `--gene-table` to query a particular integrated gene table, or
|
|
154
|
+
`--output-dir` to select a non-default results directory.
|
|
155
|
+
|
|
156
|
+
Find the most supported features associated with a taxon:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
metapont query-taxon \
|
|
160
|
+
--root-dir /path/to/workflow-output \
|
|
161
|
+
--taxon Bacillus \
|
|
162
|
+
--category GO \
|
|
163
|
+
--rank Genus \
|
|
164
|
+
--top 20 \
|
|
165
|
+
--output bacillus_go.tsv
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Taxon matching is case-insensitive and searches the chosen rank as well as the
|
|
169
|
+
full lineage. `--category` is required for this query. Both query commands
|
|
170
|
+
accept an explicit `--gene-table` path; plain TSV and gzip-compressed TSV files
|
|
171
|
+
are supported.
|
|
172
|
+
|
|
173
|
+
## Results
|
|
174
|
+
|
|
175
|
+
The default output tree is:
|
|
176
|
+
|
|
177
|
+
```text
|
|
178
|
+
MetaPont_Results/
|
|
179
|
+
├── combined/
|
|
180
|
+
│ ├── all_contigs.tsv.gz
|
|
181
|
+
│ └── gene_annotations.tsv.gz
|
|
182
|
+
├── functional/
|
|
183
|
+
│ ├── functional_abundance.tsv
|
|
184
|
+
│ ├── matrices/
|
|
185
|
+
│ └── taxon_function_abundance.tsv
|
|
186
|
+
├── inventory/
|
|
187
|
+
│ └── sample_inventory.tsv
|
|
188
|
+
├── metadata/
|
|
189
|
+
│ ├── input_signature.json
|
|
190
|
+
│ └── run_manifest.json
|
|
191
|
+
├── per_sample_contigs/
|
|
192
|
+
│ └── SAMPLE_Contigs.tsv.gz
|
|
193
|
+
├── summary/
|
|
194
|
+
│ ├── pipeline_warnings.tsv
|
|
195
|
+
│ ├── sample_inventory.tsv
|
|
196
|
+
│ └── sample_summary.tsv
|
|
197
|
+
└── taxonomy/
|
|
198
|
+
└── taxonomy_abundance.tsv
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The main tables are tab-delimited; `.tsv.gz` files are gzip-compressed TSVs.
|
|
202
|
+
Functional matrices are written separately for every supported annotation
|
|
203
|
+
category, with both gene counts and gene read-support values. The optional
|
|
204
|
+
taxon-function abundance table contains taxon/category/feature combinations
|
|
205
|
+
across taxonomic ranks.
|
|
206
|
+
|
|
207
|
+
Supported functional categories include `COG`, `eggNOG_OG`, `GO`, `EC`,
|
|
208
|
+
`KEGG_KO`, `KEGG_Pathway`, `KEGG_Module`, `KEGG_Reaction`, `KEGG_rclass`,
|
|
209
|
+
`BRITE`, `KEGG_TC`, `CAZy`, `BiGG_Reaction`, and `PFAM`.
|
|
210
|
+
|
|
211
|
+
`Gene_Read_Support` is derived from read-to-CDS overlaps in the CDS summary; it
|
|
212
|
+
is not a count of unique reads across genes. A read can support multiple genes
|
|
213
|
+
or annotations, so functional support values are not mutually exclusive.
|
|
214
|
+
Taxonomic relative abundance uses total mapped-read support as its denominator.
|
|
215
|
+
|
|
216
|
+
Samples with missing or stale workflow outputs are retained where possible and
|
|
217
|
+
listed in `summary/pipeline_warnings.tsv`. A clean run writes
|
|
218
|
+
`MetaPont_analysis.success`; a run with warnings writes
|
|
219
|
+
`completed_with_warnings.flag`.
|
|
220
|
+
|
|
221
|
+
## License
|
|
222
|
+
|
|
223
|
+
MetaPont is distributed under the
|
|
224
|
+
[GNU General Public License v3.0 or later](LICENSE).
|