|
8 | 8 |
|
9 | 9 | - [Install](#install) |
10 | 10 | - [From Conda](#from-conda) |
11 | | - - [Requirements](#conda-requirements) |
12 | 11 | - [From Source](#from-source) |
13 | | - - [Requirements](#source-requirements) |
14 | 12 | - [Run](#run) |
15 | | - - [Commands](#commands) |
16 | 13 | - [refstats](#refstats) |
17 | | - - [Parameters](#refstats-parameters) |
18 | | - - [Run](#run-refstats) |
19 | | - - [Filters](#refstats-filters) |
20 | | - - [Write BAM After Filtering](#write-bam-after-filtering) |
21 | | - - [Add Taxonomy To BAM Files](#add-taxonomy-to-bam-files) |
22 | 14 | - [taxstats](#taxstats) |
23 | | - - [Parameters](#taxstats-parameters) |
24 | | - - [Run](#run-taxstats) |
25 | | - - [Filters](#taxstats-filters) |
26 | | - - [Relation To refstats Taxonomy Tags](#relation-to-refstats-taxonomy-tags) |
27 | 15 | - [alnfilt](#alnfilt) |
28 | | - - [Parameters](#alnfilt-parameters) |
29 | | -- [Output Columns](#output-columns) |
| 16 | +- [Output](#output-columns) |
30 | 17 | - [Taxonomy Files](#taxonomy-files) |
31 | 18 | - [Input Notes](#input-notes) |
32 | | -- [Testing](#testing) |
33 | 19 |
|
34 | 20 | Unicorn computes alignment-based statistics from SAM/BAM files. It is aimed at |
35 | 21 | metagenomic and reference-screening workflows where the same alignment file may |
@@ -107,34 +93,34 @@ command for reference-level filtering, coverage metrics, and adding taxonomy tag |
107 | 93 | to filtered BAM files. |
108 | 94 |
|
109 | 95 | ```bash |
110 | | -unicorn refstats -h |
111 | | -unicorn 2.5.0 c414a07 |
112 | | - May 27 2026 13:08:46 |
| 96 | +unicorn 2.5.1 b53cd7e |
| 97 | + Jun 4 2026 13:36:20 |
113 | 98 | ./unicorn refstats [options] -b <in.bam>|<in.sam> |
114 | 99 | Options: |
115 | 100 | -b <str> Input bam|sam [Required] |
116 | 101 | -t <int>, --threads <int> Number of threads [4] |
117 | 102 | -o <str>, --outbam <str> Output BAM file with filtered references |
118 | | - --outstat <str> Output statistics file |
119 | | - --[FILTER] <PARAM> Apply reference filter "FILTER" with parameter "PARAM" |
120 | | - For example "--minreads 100" to filter out references with |
121 | | - less than 100 reads. |
122 | | - Available filters: |
123 | | - - minrefl <int> Minimum reference length to consider [1] |
124 | | - - minreads <int> Minimum number of reads per reference [1] |
125 | | - - minalnas <int> Minimum alignment score [-Inf] |
126 | | - - maxdust <int> Maximum alignment dust score [100] |
| 103 | + -k <int>, --ksize <int> kmer size for duplicity computation [17] |
| 104 | + --outstat <str> Print statistics to file <str> [stdout] |
| 105 | + --[FILTER] <PARAM> Apply filter "FILTER" with parameter "PARAM" |
| 106 | + Example: "--minreads 100" to filter out references with |
| 107 | + less than 100 reads. |
| 108 | + Filters: |
| 109 | + - minreflen <int> Minimum reference length to consider [1] |
| 110 | + - minreads <int> Minimum number of reads per reference [1] |
| 111 | + - minalnas <int> Minimum alignment score [-Inf] |
| 112 | + - maxdust <int> Maximum alignment dust score [100] |
127 | 113 | --names <str> Taxonomy nodeid to name mapping file. |
128 | 114 | --nodes <str> Taxonomy nodeid to parent nodeid mapping file. |
129 | | - --acc2tax <str> Accession to taxid mapping file or .khash file. |
130 | | - -k <int> kmer size for duplicity computation [17] |
| 115 | + --acc2tax <str> Accession to taxid mapping file. |
131 | 116 | Report taxid of reference sequence. Enabled automatically when |
132 | 117 | --acc2tax, --names and --nodes are provided. |
133 | 118 | taxid is reported in bam records in custom: |
134 | 119 | XT:i:<taxid> tag and |
135 | | - XR:i:<taxid> tag |
136 | | - In column 2 in the output statistics file. |
137 | | - --rank <str> Taxonomic rank for XR tag. [genus] |
| 120 | + XR:i:<taxid> tag in. |
| 121 | + taxid column 2 in the output statistics file. |
| 122 | + --rank <str> Taxonomic rank for XR tag. [genus] |
| 123 | + --qsize <int> Size of queue for coordinate sorted input bam files [1024] |
138 | 124 | --verbose Print libunicorn's messages. |
139 | 125 | -h print this help message |
140 | 126 | ``` |
@@ -195,33 +181,30 @@ can either assign alignments to taxa from an accession map, or consume BAM files |
195 | 181 | that already contain Unicorn `XT` and `XR` tags. |
196 | 182 |
|
197 | 183 | ```bash |
198 | | -unicorn 2.5.0 c414a07 |
199 | | - May 27 2026 13:08:46 |
| 184 | +unicorn 2.5.1 b53cd7e |
| 185 | + Jun 4 2026 13:36:20 |
200 | 186 | ./unicorn taxstats [options] -b <in.bam>|<in.sam> |
201 | 187 | Options: |
202 | 188 | -b <str> Input bam|sam |
203 | | - -a <str> | --acc2tax <str> Accession to taxid mapping file or .khash file. |
204 | | - Providing a .khash file is much faster. |
205 | | - If omitted, taxonomy names/nodes are still loaded but accession lookup is disabled. |
206 | | - -n <str> | --names <str> Taxonomy names file. |
207 | | - -d <str> | --nodes <str> Taxonomy nodes file |
208 | | - -k <int> kmer size for duplicity computation [17] |
209 | 189 | -t <int>, --threads <int> Number of threads [4] |
210 | | - --qsize <int> Size of queue for taxstats computation [1024] |
211 | | - --outstat <str> Output statistics file [/dev/stdout] |
| 190 | + -k <int>, --ksize <int> kmer size for duplicity computation [17] |
| 191 | + --outstat <str> Print statistics to file <str> [stdout] |
212 | 192 | --[FILTER] <PARAM> Apply filter "FILTER" with parameter "PARAM" |
213 | 193 | For example "--minreads 100" to filter out taxids with |
214 | 194 | less than 100 reads. |
215 | 195 | Available filters: |
216 | | - - minrefl <int> Minimum reference length. [0] |
| 196 | + - minrefl <int> Minimum reference length. [1] |
217 | 197 | - minreads <int> Minimum number of reads per taxid. [1] |
218 | 198 | - minmani <float> Minimum mean ANI per taxid. [0] |
219 | 199 | - minalnas <int> Minimum alignment score [-Inf] |
220 | 200 | - maxdust <int> Maximum alignment dust score [100] |
221 | | - --rank <str> Taxonomic rank to summarize by. [genus] |
222 | | - --verbose Prints libunicorn's messages. |
223 | | - -h Print this help message |
224 | | -[unicorn::unicorn_taxstats] Total time: 0.000025 seconds |
| 201 | + --acc2tax <str> Accession to taxid mapping file or .khash file. |
| 202 | + --names <str> Taxonomy names file. |
| 203 | + --nodes <str> Taxonomy nodes file |
| 204 | + --rank <str> Taxonomic rank to summarize by. [genus] |
| 205 | + --qsize <int> Size of queue for XR sorted input bam files [1024] |
| 206 | + --verbose Prints libunicorn's messages. |
| 207 | + -h Print this help message |
225 | 208 | ``` |
226 | 209 |
|
227 | 210 | Run `taxstats` from an accession map: |
|
0 commit comments