Debian Codegraph @

MANUAL.markdown

raw symbols SCIP
1
2
3 <!--
4 ! This manual is written in "markdown" format and thus contains some
5 ! distracting formatting clutter. See 'MANUAL' for an easier-to-read version
6 ! of this text document, or see the HTML manual online.
7 ! -->
8
9 Introduction
10 ============
11
12 What is Centrifuge?
13 -----------------
14
15 [Centrifuge] is a novel microbial classification engine that enables
16 rapid, accurate, and sensitive labeling of reads and quantification of
17 species on desktop computers. The system uses a novel indexing scheme
18 based on the Burrows-Wheeler transform (BWT) and the Ferragina-Manzini
19 (FM) index, optimized specifically for the metagenomic classification
20 problem. Centrifuge requires a relatively small index (5.8 GB for all
21 complete bacterial and viral genomes plus the human genome) and
22 classifies sequences at a very high speed, allowing it to process the
23 millions of reads from a typical high-throughput DNA sequencing run
24 within a few minutes. Together these advances enable timely and
25 accurate analysis of large metagenomics data sets on conventional
26 desktop computers.
27
28 [Centrifuge]: http://www.ccb.jhu.edu/software/centrifuge
29
30 [Burrows-Wheeler Transform]: http://en.wikipedia.org/wiki/Burrows-Wheeler_transform
31 [FM Index]: http://en.wikipedia.org/wiki/FM-index
32
33 [GPLv3 license]: http://www.gnu.org/licenses/gpl-3.0.html
34
35
36 Obtaining Centrifuge
37 ==================
38
39 Download Centrifuge and binaries from the Releases sections on the right side.
40 Binaries are available for Intel architectures (`x86_64`) running Linux, and Mac OS X.
41
42 Building from source
43 --------------------
44
45 Building Centrifuge from source requires a GNU-like environment with GCC, GNU Make
46 and other basics. It should be possible to build Centrifuge on most vanilla Linux
47 installations or on a Mac installation with [Xcode] installed. Centrifuge can
48 also be built on Windows using [Cygwin] or [MinGW] (MinGW recommended). For a
49 MinGW build the choice of what compiler is to be used is important since this
50 will determine if a 32 or 64 bit code can be successfully compiled using it. If
51 there is a need to generate both 32 and 64 bit on the same machine then a multilib
52 MinGW has to be properly installed. [MSYS], the [zlib] library, and depending on
53 architecture [pthreads] library are also required. We are recommending a 64 bit
54 build since it has some clear advantages in real life research problems. In order
55 to simplify the MinGW setup it might be worth investigating popular MinGW personal
56 builds since these are coming already prepared with most of the toolchains needed.
57
58 First, download the [source package] from the Releases secion on the right side.
59 Unzip the file, change to the unzipped directory, and build the
60 Centrifuge tools by running GNU `make` (usually with the command `make`, but
61 sometimes with `gmake`) with no arguments. If building with MinGW, run `make`
62 from the MSYS environment.
63
64 Centrifuge is using the multithreading software model in order to speed up
65 execution times on SMP architectures where this is possible. On POSIX
66 platforms (like linux, Mac OS, etc) it needs the pthread library. Although
67 it is possible to use pthread library on non-POSIX platform like Windows, due
68 to performance reasons Centrifuge will try to use Windows native multithreading
69 if possible.
70
71 For the support of SRA data access in HISAT2, please download and install the [NCBI-NGS] toolkit.
72 When running `make`, specify additional variables as follow.
73 `make USE_SRA=1 NCBI_NGS_DIR=/path/to/NCBI-NGS-directory NCBI_VDB_DIR=/path/to/NCBI-NGS-directory`,
74 where `NCBI_NGS_DIR` and `NCBI_VDB_DIR` will be used in Makefile for -I and -L compilation options.
75 For example, $(NCBI_NGS_DIR)/include and $(NCBI_NGS_DIR)/lib64 will be used.
76
77 [Cygwin]: http://www.cygwin.com/
78 [MinGW]: http://www.mingw.org/
79 [MSYS]: http://www.mingw.org/wiki/msys
80 [zlib]: http://cygwin.com/packages/mingw-zlib/
81 [pthreads]: http://sourceware.org/pthreads-win32/
82 [GnuWin32]: http://gnuwin32.sf.net/packages/coreutils.htm
83 [Xcode]: http://developer.apple.com/xcode/
84 [Github site]: https://github.com/infphilo/centrifuge
85 [NCBI-NGS]: https://github.com/ncbi/ngs/wiki/Downloads
86
87 Running Centrifuge
88 =============
89
90 Adding to PATH
91 --------------
92
93 By adding your new Centrifuge directory to your [PATH environment variable], you
94 ensure that whenever you run `centrifuge`, `centrifuge-build`, `centrifuge-download` or `centrifuge-inspect`
95 from the command line, you will get the version you just installed without
96 having to specify the entire path. This is recommended for most users. To do
97 this, follow your operating system's instructions for adding the directory to
98 your [PATH].
99
100 If you would like to install Centrifuge by copying the Centrifuge executable files
101 to an existing directory in your [PATH], make sure that you copy all the
102 executables, including `centrifuge`, `centrifuge-class`, `centrifuge-build`, `centrifuge-build-bin`, `centrifuge-download` `centrifuge-inspect`
103 and `centrifuge-inspect-bin`. Furthermore you need the programs
104 in the scripts/ folder if you opt for genome compression in the database construction.
105
106 [PATH environment variable]: http://en.wikipedia.org/wiki/PATH_(variable)
107 [PATH]: http://en.wikipedia.org/wiki/PATH_(variable)
108
109
110 Before running Centrifuge
111 -----------------
112
113 Classification is considerably different from alignment in that classification is performed on a large set of genomes as opposed to on just one reference genome as in alignment. Currently, an enormous number of complete genomes are available at the GenBank (e.g. >4,000 bacterial genomes, >10,000 viral genomes, …). These genomes are organized in a taxonomic tree where each genome is located at the bottom of the tree, at the strain or subspecies level. On the taxonomic tree, genomes have ancestors usually situated at the species level, and those ancestors also have ancestors at the genus level and so on up the family level, the order level, class level, phylum, kingdom, and finally at the root level.
114
115 Given the gigantic number of genomes available, which continues to expand at a rapid rate, and the development of the taxonomic tree, which continues to evolve with new advancements in research, we have designed Centrifuge to be flexible and general enough to reflect this huge database. We provide several standard indexes that will meet most of users’ needs (see the side panel - Indexes). In our approach our indexes not only include raw genome sequences, but also genome names/sizes and taxonomic trees. This enables users to perform additional analyses on Centrifuge’s classification output without the need to download extra database sources. This also eliminates the potential issue of discrepancy between the indexes we provide and the databases users may otherwise download. We plan to provide a couple of additional standard indexes in the near future, and update the indexes on a regular basis.
116
117 We encourage first time users to take a look at and follow a [`small example`] that illustrates how to build an index, how to run Centrifuge using the index, how to interpret the classification results, and how to extract additional genomic information from the index. For those who choose to build customized indexes, please take a close look at the following description.
118
119 Database download and index building
120 -----------------
121
122 Centrifuge indexes can be built with arbritary sequences. Standard choices are
123 all of the complete bacterial and viral genomes, or using the sequences that
124 are part of the BLAST nt database. Centrifuge always needs the
125 nodes.dmp file from the NCBI taxonomy dump to build the taxonomy tree,
126 as well as a sequence ID to taxonomy ID map. The map is a tab-separated
127 file with the sequence ID to taxonomy ID map.
128
129 To download all of the complete archaeal, viral, and bacterial genomes from RefSeq, and
130 build the index:
131
132 Centrifuge indices can be build on arbritary sequences. Usually an ensemble of
133 genomes is used - such as all complete microbial genomes in the RefSeq database,
134 or all sequences in the BLAST nt database.
135
136
137 To map sequence identifiers to taxonomy IDs, and taxonomy IDs to names and
138 its parents, three files are necessary in addition to the sequence files:
139
140 - taxonomy tree: typically nodes.dmp from the NCBI taxonomy dump. Links taxonomy IDs to their parents
141 - names file: typically names.dmp from the NCBI taxonomy dump. Links taxonomy IDs to their scientific name
142 - a tab-separated sequence ID to taxonomy ID mapping
143
144 When using the provided scripts to download the genomes, these files are automatically downloaded or generated.
145 When using a custom taxonomy or sequence files, please refer to the section `TODO` to learn more about their format.
146
147 ### Building index on all complete bacterial and viral genomes
148
149 Use `centrifuge-download` to download genomes from NCBI. The following two commands download
150 the NCBI taxonomy to `taxonomy/` in the current directory, and all complete archaeal,
151 bacterial and viral genomes to `library/`. Low-complexity regions in the genomes are masked after
152 download (parameter `-m`) using blast+'s `dustmasker`. `centrifuge-download` outputs tab-separated
153 sequence ID to taxonomy ID mappings to standard out, which are required by `centrifuge-build`.
154
155 centrifuge-download -o taxonomy taxonomy
156 centrifuge-download -o library -m -d "archaea,bacteria,viral" refseq > seqid2taxid.map
157
158 To build the index, first concatenate all downloaded sequences into a single file, and then
159 run `centrifuge-build`:
160
161 cat library/*/*.fna > input-sequences.fna
162
163 ## build centrifuge index with 4 threads
164 centrifuge-build -p 4 --conversion-table seqid2taxid.map \
165 --taxonomy-tree taxonomy/nodes.dmp --name-table taxonomy/names.dmp \
166 input-sequences.fna abv
167
168 After building the index, all files except the index *.[123].cf files may be removed.
169 If you also want to include the human and/or the mouse genome, add their sequences to
170 the library folder before building the index with one of the following commands:
171
172 After the index building, all but the *.[123].cf index files may be removed. I.e. the files in
173 the `library/` and `taxonomy/` directories are no longer needed.
174
175 ### Adding human or mouse genome to the index
176 The human and mouse genomes can also be downloaded using `centrifuge-download`. They are in the
177 domain "vertebrate_mammalian" (argument `-d`), are assembled at the chromosome level (argument `-a`)
178 and categorized as reference genomes by RefSeq (`-c`). The argument `-t` takes a comma-separated
179 list of taxonomy IDs - e.g. `9606` for human and `10090` for mouse:
180
181 # download mouse and human reference genomes
182 centrifuge-download -o library -d "vertebrate_mammalian" -a "Chromosome" -t 9606,10090 -c 'reference genome' refseq >> seqid2taxid.map
183 # only human
184 centrifuge-download -o library -d "vertebrate_mammalian" -a "Chromosome" -t 9606 -c 'reference genome' refseq >> seqid2taxid.map
185 # only mouse
186 centrifuge-download -o library -d "vertebrate_mammalian" -a "Chromosome" -t 10090 -c 'reference genome' refseq >> seqid2taxid.map
187
188
189 ### nt database
190
191 NCBI BLAST's nt database contains all spliced non-redundant coding
192 sequences from multiplpe databases, inferred from genommic
193 sequences. Traditionally used with BLAST, a download of the FASTA is
194 provided on the NCBI homepage. Building an index with any database
195 requires the user to creates a sequence ID to taxonomy ID map that
196 can be generated from a GI taxid dump:
197
198 wget ftp://ftp.ncbi.nih.gov/blast/db/FASTA/nt.gz
199 gunzip nt.gz && mv -v nt nt.fa
200
201 # Get mapping file
202 wget ftp://ftp.ncbi.nih.gov/pub/taxonomy/gi_taxid_nucl.dmp.gz
203 gunzip -c gi_taxid_nucl.dmp.gz | sed 's/^/gi|/' > gi_taxid_nucl.map
204
205 # build index using 16 cores and a small bucket size, which will require less memory
206 centrifuge-build -p 16 --bmax 1342177280 --conversion-table gi_taxid_nucl.map \
207 --taxonomy-tree taxonomy/nodes.dmp --name-table taxonomy/names.dmp \
208 nt.fa nt
209
210
211
212 ### Custom database
213
214 To build a custom database, you need the provide the follwing four files to `centrifuge-build`:
215
216 - `--conversion-table`: tab-separated file mapping sequence IDs to taxonomy IDs. Sequence IDs are the header up to the first space or second pipe (`|`).
217 - `--taxonomy-tree`: `\t|\t`-separated file mapping taxonomy IDs to their parents and rank, up to the root of the tree. When using NCBI taxonomy IDs, this will be the `nodes.dmp` from `ftp://ftp.ncbi.nlm.nih.gov/pub/taxonomy/taxdump.tar.gz`.
218 - `--name-table`: '\t|\t'-separated file mapping taxonomy IDs to a name. A further column (typically column 4) must specify `scientific name`. When using NCBI taxonomy IDs, `names.dmp` is the appropriate file.
219 - reference sequences: The ID of the sequences are the header up to the first space or second pipe (`|`)
220
221 When using custom taxonomy IDs, use only positive integers greater-equal to `1` and use `1` for the root of the tree.
222
223 #### More info on `--taxonomy-tree` and `--name-table`
224
225 The format of these files are based on `nodes.dmp` and `names.dmp` from the NCBI taxonomy database dump.
226
227 - Field terminator is `\t|\t`
228 - Row terminator is `\t|\n`
229
230 The `taxonomy-tree` / nodes.dmp file consists of taxonomy nodes. The description for each node includes the following
231 fields:
232
233 tax_id -- node id in GenBank taxonomy database
234 parent tax_id -- parent node id in GenBank taxonomy database
235 rank -- rank of this node (superkingdom, kingdom, ..., no rank)
236
237 Further fields are ignored.
238
239 The `name-table` / names.dmp is the taxonomy names file:
240
241 tax_id -- the id of node associated with this name
242 name_txt -- name itself
243 unique name -- the unique variant of this name if name not unique
244 name class -- (scientific name, synonym, common name, ...)
245
246 `name class` **has** to be `scientific name` to be included in the build. All other lines are ignored
247
248 #### Example
249
250 *Conversion table `ex.conv`*:
251
252 Seq1 11
253 Seq2 12
254 Seq3 13
255 Seq4 11
256
257
258 *Taxonomy tree `ex.tree`*:
259
260 1 | 1 | root
261 10 | 1 | kingdom
262 11 | 10 | species
263 12 | 10 | species
264 13 | 1 | species
265
266 *Name table `ex.name`*:
267
268 1 | root | | scientific name |
269 10 | Bacteria | | scientific name |
270 11 | Bacterium A | | scientific name |
271 12 | Bacterium B | | scientific name |
272 12 | Some other species | | scientific name |
273
274 *Reference sequences `ex.fa`*:
275
276 >Seq1
277 AAAACGTACGA.....
278 >Seq2
279 AAAACGTACGA.....
280 >Seq3
281 AAAACGTACGA.....
282 >Seq4
283 AAAACGTACGA.....
284
285 To build the database, call
286
287 centrifuge-build --conversion-table ex.conv \
288 --taxonomy-tree ex.tree --name-table ex.name \
289 ex.fa ex
290
291 which results in three index files named `ex.1.cf`, `ex.2.cf` and `ex.3.cf`.
292
293
294 ### Centrifuge classification output
295
296 The following example shows classification assignments for a read. The assignment output has 8 columns.
297
298 readID seqID taxID score 2ndBestScore hitLength queryLength numMatches
299 1_1 gi|4 9646 4225 0 80 80 1
300
301 The first column is the read ID from a raw sequencing read (e.g., 1_1 in the example).
302 The second column is the sequence ID of the genomic sequence, where the read is classified (e.g., gi|4).
303 The third column is the taxonomic ID of the genomic sequence in the second column (e.g., 9646).
304 The fourth column is the score for the classification, which is the weighted sum of hits (e.g., 4225)
305 The fifth column is the score for the next best classification (e.g., 0).
306 The sixth column is a pair of two numbers: (1) an approximate number of base pairs of the read that match the genomic sequence and (2) the length of a read or the combined length of mate pairs (e.g., 80 / 80).
307 The seventh column is a pair of two numbers: (1) an approximate number of base pairs of the read that match the genomic sequence and (2) the length of a read or the combined length of mate pairs (e.g., 80 / 80).
308 The eighth column is the number of classifications for this read, indicating how many assignments were made (e.g.,1).
309
310 ### Centrifuge summary output (the default filename is centrifuge_report.tsv)
311
312 The following example shows a classification summary for each genome or taxonomic unit. The assignment output has 7 columns.
313
314 name taxID taxRank genomeSize numReads numUniqueReads abundance
315 Wigglesworthia glossinidia endosymbiont of Glossina brevipalpis 36870 leaf 703004 5981 5964 0.0152317
316
317 The first column is the name of a genome, or the name corresponding to a taxonomic ID (the second column) at a rank higher than the strain (e.g., Wigglesworthia glossinidia endosymbiont of Glossina brevipalpis).
318 The second column is the taxonomic ID (e.g., 36870).
319 The third column is the taxonomic rank (e.g., leaf).
320 The fourth column is the length of the genome sequence (e.g., 703004).
321 The fifth column is the number of reads classified to this genomic sequence including multi-classified reads (e.g., 5981).
322 The sixth column is the number of reads uniquely classified to this genomic sequence (e.g., 5964).
323 The seventh column is the proportion of this genome normalized by its genomic length (e.g., 0.0152317).
324
325 As the GenBank database is incomplete (i.e., many more genomes remain to be identified and added), and reads have sequencing errors, classification programs including Centrifuge often report many false assignments. In order to perform more conservative analyses, users may want to discard assignments for reads having a matching length (8th column in the output of Centrifuge) of 40% or lower. It may be also helpful to use a score (4th column) for filtering out some assignments. Our future research plans include working on developing methods that estimate confidence scores for assignments.
326
327 ### Kraken-style report
328
329 `centrifuge-kreport` can be used to make a Kraken-style report from the Centrifuge output including taxonomy information:
330
331 `centrifuge-kreport -x <centrifuge index> <centrifuge out file>`
332
333
334 Inspecting the Centrifuge index
335 -----------------------
336
337 The index can be inspected with `centrifuge-inspect`. To extract raw sequences:
338
339 centrifuge-inspect <centrifuge index>
340
341 Extract the sequence ID to taxonomy ID conversion table from the index
342
343 centrifuge-inspect --conversion-table <centrifuge index>
344
345 Extract the taxonomy tree from the index:
346
347 centrifuge-inspect --taxonomy-tree <centrifuge index>
348
349 Extract the lengths of the sequences from the index (each row has two columns: taxonomic ID and length):
350
351 centrifuge-inspect --size-table <centrifuge index>
352
353 Extract the names from the index (each row has two columns: taxonomic ID and name):
354
355 centrifuge-inspect --name-table <centrifuge index>
356
357
358
359 Wrapper
360 -------
361
362 The `centrifuge`, `centrifuge-build` and `centrifuge-inspect` executables are actually
363 wrapper scripts that call binary programs as appropriate. Also, the `centrifuge` wrapper
364 provides some key functionality, like the ability to handle compressed inputs,
365 and the functionality for [`--un`], [`--al`] and related options.
366
367 It is recommended that you always run the centrifuge wrappers and not run the
368 binaries directly.
369
370 Performance tuning
371 ------------------
372
373 1. If your computer has multiple processors/cores, use `-p NTHREADS`
374
375 The [`-p`] option causes Centrifuge to launch a specified number of parallel
376 search threads. Each thread runs on a different processor/core and all
377 threads find alignments in parallel, increasing alignment throughput by
378 approximately a multiple of the number of threads (though in practice,
379 speedup is somewhat worse than linear).
380
381 Command Line
382 ------------
383
384
385 ### Usage
386
387 centrifuge [options]* -x <centrifuge-idx> {-1 <m1> -2 <m2> | -U <r> | --sra-acc <SRA accession number>} [--report-file <report file name> -S <classification output file name>]
388
389 ### Main arguments
390
391 <table><tr><td>
392
393 [`-x`]: #centrifuge-options-x
394
395 -x <centrifuge-idx>
396
397 </td><td>
398
399 The basename of the index for the reference genomes. The basename is the name of
400 any of the index files up to but not including the final `.1.cf` / etc.
401 `centrifuge` looks for the specified index first in the current directory,
402 then in the directory specified in the `CENTRIFUGE_INDEXES` environment variable.
403
404 </td></tr><tr><td>
405
406 [`-1`]: #centrifuge-options-1
407
408 -1 <m1>
409
410 </td><td>
411
412 Comma-separated list of files containing mate 1s (filename usually includes
413 `_1`), e.g. `-1 flyA_1.fq,flyB_1.fq`. Sequences specified with this option must
414 correspond file-for-file and read-for-read with those specified in `<m2>`. Reads
415 may be a mix of different lengths. If `-` is specified, `centrifuge` will read the
416 mate 1s from the "standard in" or "stdin" filehandle.
417
418 </td></tr><tr><td>
419
420 [`-2`]: #centrifuge-options-2
421
422 -2 <m2>
423
424 </td><td>
425
426 Comma-separated list of files containing mate 2s (filename usually includes
427 `_2`), e.g. `-2 flyA_2.fq,flyB_2.fq`. Sequences specified with this option must
428 correspond file-for-file and read-for-read with those specified in `<m1>`. Reads
429 may be a mix of different lengths. If `-` is specified, `centrifuge` will read the
430 mate 2s from the "standard in" or "stdin" filehandle.
431
432 </td></tr><tr><td>
433
434 [`-U`]: #centrifuge-options-U
435
436 -U <r>
437
438 </td><td>
439
440 Comma-separated list of files containing unpaired reads to be aligned, e.g.
441 `lane1.fq,lane2.fq,lane3.fq,lane4.fq`. Reads may be a mix of different lengths.
442 If `-` is specified, `centrifuge` gets the reads from the "standard in" or "stdin"
443 filehandle.
444
445 </td></tr><tr><td>
446
447 [`--sra-acc`]: #hisat2-options-sra-acc
448
449 --sra-acc <SRA accession number>
450
451 </td><td>
452
453 Comma-separated list of SRA accession numbers, e.g. `--sra-acc SRR353653,SRR353654`.
454 Information about read types is available at http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?sp=runinfo&acc=<b>sra-acc</b>&retmode=xml,
455 where <b>sra-acc</b> is SRA accession number. If users run HISAT2 on a computer cluster, it is recommended to disable SRA-related caching (see the instruction at [SRA-MANUAL]).
456
457 [SRA-MANUAL]: https://github.com/ncbi/sra-tools/wiki/Toolkit-Configuration
458
459 </td></tr><tr><td>
460
461 [`-S`]: #centrifuge-options-S
462
463 -S <filename>
464
465 </td><td>
466
467 File to write classification results to. By default, assignments are written to the
468 "standard out" or "stdout" filehandle (i.e. the console).
469
470 </td></tr><tr><td>
471
472 [`--report-file`]: #centrifuge-options-report-file
473
474 --report-file <filename>
475
476 </td><td>
477
478 File to write a classification summary to (default: centrifuge_report.tsv).
479
480 </td></tr></table>
481
482 ### Options
483
484 #### Input options
485
486 <table>
487 <tr><td id="centrifuge-options-q">
488
489 [`-q`]: #centrifuge-options-q
490
491 -q
492
493 </td><td>
494
495 Reads (specified with `<m1>`, `<m2>`, `<s>`) are FASTQ files. FASTQ files
496 usually have extension `.fq` or `.fastq`. FASTQ is the default format. See
497 also: [`--solexa-quals`] and [`--int-quals`].
498
499 </td></tr>
500 <tr><td id="centrifuge-options-qseq">
501
502 [`--qseq`]: #centrifuge-options-qseq
503
504 --qseq
505
506 </td><td>
507
508 Reads (specified with `<m1>`, `<m2>`, `<s>`) are QSEQ files. QSEQ files usually
509 end in `_qseq.txt`. See also: [`--solexa-quals`] and [`--int-quals`].
510
511 </td></tr>
512 <tr><td id="centrifuge-options-f">
513
514 [`-f`]: #centrifuge-options-f
515
516 -f
517
518 </td><td>
519
520 Reads (specified with `<m1>`, `<m2>`, `<s>`) are FASTA files. FASTA files
521 usually have extension `.fa`, `.fasta`, `.mfa`, `.fna` or similar. FASTA files
522 do not have a way of specifying quality values, so when `-f` is set, the result
523 is as if `--ignore-quals` is also set.
524
525 </td></tr>
526 <tr><td id="centrifuge-options-r">
527
528 [`-r`]: #centrifuge-options-r
529
530 -r
531
532 </td><td>
533
534 Reads (specified with `<m1>`, `<m2>`, `<s>`) are files with one input sequence
535 per line, without any other information (no read names, no qualities). When
536 `-r` is set, the result is as if `--ignore-quals` is also set.
537
538 </td></tr>
539 <tr><td id="centrifuge-options-c">
540
541 [`-c`]: #centrifuge-options-c
542
543 -c
544
545 </td><td>
546
547 The read sequences are given on command line. I.e. `<m1>`, `<m2>` and
548 `<singles>` are comma-separated lists of reads rather than lists of read files.
549 There is no way to specify read names or qualities, so `-c` also implies
550 `--ignore-quals`.
551
552 </td></tr>
553 <tr><td id="centrifuge-options-s">
554
555 [`-s`/`--skip`]: #centrifuge-options-s
556 [`-s`]: #centrifuge-options-s
557
558 -s/--skip <int>
559
560 </td><td>
561
562 Skip (i.e. do not align) the first `<int>` reads or pairs in the input.
563
564 </td></tr>
565 <tr><td id="centrifuge-options-u">
566
567 [`-u`/`--qupto`]: #centrifuge-options-u
568 [`-u`]: #centrifuge-options-u
569
570 -u/--qupto <int>
571
572 </td><td>
573
574 Align the first `<int>` reads or read pairs from the input (after the
575 [`-s`/`--skip`] reads or pairs have been skipped), then stop. Default: no limit.
576
577 </td></tr>
578 <tr><td id="centrifuge-options-5">
579
580 [`-5`/`--trim5`]: #centrifuge-options-5
581 [`-5`]: #centrifuge-options-5
582
583 -5/--trim5 <int>
584
585 </td><td>
586
587 Trim `<int>` bases from 5' (left) end of each read before alignment (default: 0).
588
589 </td></tr>
590 <tr><td id="centrifuge-options-3">
591
592 [`-3`/`--trim3`]: #centrifuge-options-3
593 [`-3`]: #centrifuge-options-3
594
595 -3/--trim3 <int>
596
597 </td><td>
598
599 Trim `<int>` bases from 3' (right) end of each read before alignment (default:
600 0).
601
602 </td></tr><tr><td id="centrifuge-options-phred33-quals">
603
604 [`--phred33`]: #centrifuge-options-phred33-quals
605
606 --phred33
607
608 </td><td>
609
610 Input qualities are ASCII chars equal to the [Phred quality] plus 33. This is
611 also called the "Phred+33" encoding, which is used by the very latest Illumina
612 pipelines.
613
614 [Phred quality]: http://en.wikipedia.org/wiki/Phred_quality_score
615
616 </td></tr>
617 <tr><td id="centrifuge-options-phred64-quals">
618
619 [`--phred64`]: #centrifuge-options-phred64-quals
620
621 --phred64
622
623 </td><td>
624
625 Input qualities are ASCII chars equal to the [Phred quality] plus 64. This is
626 also called the "Phred+64" encoding.
627
628 </td></tr>
629 <tr><td id="centrifuge-options-solexa-quals">
630
631 [`--solexa-quals`]: #centrifuge-options-solexa-quals
632
633 --solexa-quals
634
635 </td><td>
636
637 Convert input qualities from [Solexa][Phred quality] (which can be negative) to
638 [Phred][Phred quality] (which can't). This scheme was used in older Illumina GA
639 Pipeline versions (prior to 1.3). Default: off.
640
641 </td></tr>
642 <tr><td id="centrifuge-options-int-quals">
643
644 [`--int-quals`]: #centrifuge-options-int-quals
645
646 --int-quals
647
648 </td><td>
649
650 Quality values are represented in the read input file as space-separated ASCII
651 integers, e.g., `40 40 30 40`..., rather than ASCII characters, e.g., `II?I`....
652 Integers are treated as being on the [Phred quality] scale unless
653 [`--solexa-quals`] is also specified. Default: off.
654
655 </td></tr></table>
656
657 #### Classification
658
659 <table>
660
661 <tr><td id="centrifuge-options-min-hitlen">
662
663 [`--min-hitlen`]: #centrifuge-options-min-hitlen
664
665 --min-hitlen <int>
666
667 </td><td>
668
669 Minimum length of partial hits, which must be greater than 15 (default: 22)"
670
671 </td></tr>
672
673 <tr><td id="centrifuge-options-k">
674
675 [`-k`]: #centrifuge-options-k
676
677 -k <int>
678
679 </td><td>
680
681 It searches for at most `<int>` distinct, primary assignments for each read or pair.
682 Primary assignments mean assignments whose assignment score is equal or higher than any other assignments.
683 If there are more primary assignments than this value,
684 the search will merge some of the assignments into a higher taxonomic rank.
685 The assignment score for a paired-end assignment equals the sum of the assignment scores of the individual mates.
686 Default: 5
687
688 </td></tr>
689
690 <tr><td id="centrifuge-options-host-taxids">
691
692 [`--host-taxids`]: #centrifuge-options-host-taxids
693
694 --host-taxids
695
696 </td><td>
697
698 A comma-separated list of taxonomic IDs that will be preferred in classification procedure.
699 The descendants from these IDs will also be preferred. In case some of a read's assignments correspond to
700 these taxonomic IDs, only those corresponding assignments will be reported.
701
702 </td></tr>
703
704 <tr><td id="centrifuge-options-exclude-taxids">
705
706 [`--exclude-taxids`]: #centrifuge-options-exclude-taxids
707
708 --exclude-taxids
709
710 </td><td>
711
712 A comma-separated list of taxonomic IDs that will be excluded in classification procedure.
713 The descendants from these IDs will also be exclude.
714
715 </td></tr>
716
717 </table>
718
719
720 <!--
721 #### Alignment options
722
723 <table>
724
725 <tr><td id="centrifuge-options-n-ceil">
726
727 [`--n-ceil`]: #centrifuge-options-n-ceil
728
729 --n-ceil <func>
730
731 </td><td>
732
733 Sets a function governing the maximum number of ambiguous characters (usually
734 `N`s and/or `.`s) allowed in a read as a function of read length. For instance,
735 specifying `-L,0,0.15` sets the N-ceiling function `f` to `f(x) = 0 + 0.15 * x`,
736 where x is the read length. See also: [setting function options]. Reads
737 exceeding this ceiling are [filtered out]. Default: `L,0,0.15`.
738
739 [filtered out]: #filtering
740
741 </td></tr>
742
743 <tr><td id="centrifuge-options-ignore-quals">
744
745 [`--ignore-quals`]: #centrifuge-options-ignore-quals
746
747 --ignore-quals
748
749 </td><td>
750
751 When calculating a mismatch penalty, always consider the quality value at the
752 mismatched position to be the highest possible, regardless of the actual value.
753 I.e. input is treated as though all quality values are high. This is also the
754 default behavior when the input doesn't specify quality values (e.g. in [`-f`],
755 [`-r`], or [`-c`] modes).
756
757 </td></tr>
758 <tr><td id="centrifuge-options-nofw">
759
760 [`--nofw`]: #centrifuge-options-nofw
761
762 --nofw/--norc
763
764 </td><td>
765
766 If `--nofw` is specified, `centrifuge` will not attempt to align unpaired reads to
767 the forward (Watson) reference strand. If `--norc` is specified, `centrifuge` will
768 not attempt to align unpaired reads against the reverse-complement (Crick)
769 reference strand. In paired-end mode, `--nofw` and `--norc` pertain to the
770 fragments; i.e. specifying `--nofw` causes `centrifuge` to explore only those
771 paired-end configurations corresponding to fragments from the reverse-complement
772 (Crick) strand. Default: both strands enabled.
773
774 </td></tr>
775
776 </table>
777
778 #### Paired-end options
779
780 <table>
781
782 <tr><td id="centrifuge-options-fr">
783
784 [`--fr`/`--rf`/`--ff`]: #centrifuge-options-fr
785 [`--fr`]: #centrifuge-options-fr
786 [`--rf`]: #centrifuge-options-fr
787 [`--ff`]: #centrifuge-options-fr
788
789 --fr/--rf/--ff
790
791 </td><td>
792
793 The upstream/downstream mate orientations for a valid paired-end alignment
794 against the forward reference strand. E.g., if `--fr` is specified and there is
795 a candidate paired-end alignment where mate 1 appears upstream of the reverse
796 complement of mate 2 and the fragment length constraints ([`-I`] and [`-X`]) are
797 met, that alignment is valid. Also, if mate 2 appears upstream of the reverse
798 complement of mate 1 and all other constraints are met, that too is valid.
799 `--rf` likewise requires that an upstream mate1 be reverse-complemented and a
800 downstream mate2 be forward-oriented. ` --ff` requires both an upstream mate 1
801 and a downstream mate 2 to be forward-oriented. Default: `--fr` (appropriate
802 for Illumina's Paired-end Sequencing Assay).
803
804 </td></tr></table>
805 -->
806
807 #### Output options
808
809 <table>
810
811 <tr><td id="centrifuge-options-t">
812
813 [`-t`/`--time`]: #centrifuge-options-t
814 [`-t`]: #centrifuge-options-t
815
816 -t/--time
817
818 </td><td>
819
820 Print the wall-clock time required to load the index files and align the reads.
821 This is printed to the "standard error" ("stderr") filehandle. Default: off.
822
823 </td></tr>
824
825 <!--
826 <tr><td id="centrifuge-options-un">
827
828 [`--un`]: #centrifuge-options-un
829 [`--un-gz`]: #centrifuge-options-un
830 [`--un-bz2`]: #centrifuge-options-un
831
832 --un <path>
833 --un-gz <path>
834 --un-bz2 <path>
835
836 </td><td>
837
838 Write unpaired reads that fail to align to file at `<path>`. These reads
839 correspond to the SAM records with the FLAGS `0x4` bit set and neither the
840 `0x40` nor `0x80` bits set. If `--un-gz` is specified, output will be gzip
841 compressed. If `--un-bz2` is specified, output will be bzip2 compressed. Reads
842 written in this way will appear exactly as they did in the input file, without
843 any modification (same sequence, same name, same quality string, same quality
844 encoding). Reads will not necessarily appear in the same order as they did in
845 the input.
846
847 </td></tr>
848 <tr><td id="centrifuge-options-al">
849
850 [`--al`]: #centrifuge-options-al
851 [`--al-gz`]: #centrifuge-options-al
852 [`--al-bz2`]: #centrifuge-options-al
853
854 --al <path>
855 --al-gz <path>
856 --al-bz2 <path>
857
858 </td><td>
859
860 Write unpaired reads that align at least once to file at `<path>`. These reads
861 correspond to the SAM records with the FLAGS `0x4`, `0x40`, and `0x80` bits
862 unset. If `--al-gz` is specified, output will be gzip compressed. If `--al-bz2`
863 is specified, output will be bzip2 compressed. Reads written in this way will
864 appear exactly as they did in the input file, without any modification (same
865 sequence, same name, same quality string, same quality encoding). Reads will
866 not necessarily appear in the same order as they did in the input.
867
868 </td></tr>
869 <tr><td id="centrifuge-options-un-conc">
870
871 [`--un-conc`]: #centrifuge-options-un-conc
872 [`--un-conc-gz`]: #centrifuge-options-un-conc
873 [`--un-conc-bz2`]: #centrifuge-options-un-conc
874
875 --un-conc <path>
876 --un-conc-gz <path>
877 --un-conc-bz2 <path>
878
879 </td><td>
880
881 Write paired-end reads that fail to align concordantly to file(s) at `<path>`.
882 These reads correspond to the SAM records with the FLAGS `0x4` bit set and
883 either the `0x40` or `0x80` bit set (depending on whether it's mate #1 or #2).
884 `.1` and `.2` strings are added to the filename to distinguish which file
885 contains mate #1 and mate #2. If a percent symbol, `%`, is used in `<path>`,
886 the percent symbol is replaced with `1` or `2` to make the per-mate filenames.
887 Otherwise, `.1` or `.2` are added before the final dot in `<path>` to make the
888 per-mate filenames. Reads written in this way will appear exactly as they did
889 in the input files, without any modification (same sequence, same name, same
890 quality string, same quality encoding). Reads will not necessarily appear in
891 the same order as they did in the inputs.
892
893 </td></tr>
894 <tr><td id="centrifuge-options-al-conc">
895
896 [`--al-conc`]: #centrifuge-options-al-conc
897 [`--al-conc-gz`]: #centrifuge-options-al-conc
898 [`--al-conc-bz2`]: #centrifuge-options-al-conc
899
900 --al-conc <path>
901 --al-conc-gz <path>
902 --al-conc-bz2 <path>
903
904 </td><td>
905
906 Write paired-end reads that align concordantly at least once to file(s) at
907 `<path>`. These reads correspond to the SAM records with the FLAGS `0x4` bit
908 unset and either the `0x40` or `0x80` bit set (depending on whether it's mate #1
909 or #2). `.1` and `.2` strings are added to the filename to distinguish which
910 file contains mate #1 and mate #2. If a percent symbol, `%`, is used in
911 `<path>`, the percent symbol is replaced with `1` or `2` to make the per-mate
912 filenames. Otherwise, `.1` or `.2` are added before the final dot in `<path>` to
913 make the per-mate filenames. Reads written in this way will appear exactly as
914 they did in the input files, without any modification (same sequence, same name,
915 same quality string, same quality encoding). Reads will not necessarily appear
916 in the same order as they did in the inputs.
917
918 </td></tr>
919 -->
920
921 <tr><td id="centrifuge-options-quiet">
922
923 [`--quiet`]: #centrifuge-options-quiet
924
925 --quiet
926
927 </td><td>
928
929 Print nothing besides alignments and serious errors.
930
931 </td></tr>
932 <tr><td id="centrifuge-options-met-file">
933
934 [`--met-file`]: #centrifuge-options-met-file
935
936 --met-file <path>
937
938 </td><td>
939
940 Write `centrifuge` metrics to file `<path>`. Having alignment metric can be useful
941 for debugging certain problems, especially performance issues. See also:
942 [`--met`]. Default: metrics disabled.
943
944 </td></tr>
945 <tr><td id="centrifuge-options-met-stderr">
946
947 [`--met-stderr`]: #centrifuge-options-met-stderr
948
949 --met-stderr
950
951 </td><td>
952
953 Write `centrifuge` metrics to the "standard error" ("stderr") filehandle. This is
954 not mutually exclusive with [`--met-file`]. Having alignment metric can be
955 useful for debugging certain problems, especially performance issues. See also:
956 [`--met`]. Default: metrics disabled.
957
958 </td></tr>
959 <tr><td id="centrifuge-options-met">
960
961 [`--met`]: #centrifuge-options-met
962
963 --met <int>
964
965 </td><td>
966
967 Write a new `centrifuge` metrics record every `<int>` seconds. Only matters if
968 either [`--met-stderr`] or [`--met-file`] are specified. Default: 1.
969
970 </td></tr>
971 </table>
972
973 #### Performance options
974
975 <table><tr>
976
977 <td id="centrifuge-options-o">
978
979 [`-o`/`--offrate`]: #centrifuge-options-o
980 [`-o`]: #centrifuge-options-o
981 [`--offrate`]: #centrifuge-options-o
982
983 -o/--offrate <int>
984
985 </td><td>
986
987 Override the offrate of the index with `<int>`. If `<int>` is greater
988 than the offrate used to build the index, then some row markings are
989 discarded when the index is read into memory. This reduces the memory
990 footprint of the aligner but requires more time to calculate text
991 offsets. `<int>` must be greater than the value used to build the
992 index.
993
994 </td></tr>
995 <tr><td id="centrifuge-options-p">
996
997 [`-p`/`--threads`]: #centrifuge-options-p
998 [`-p`]: #centrifuge-options-p
999
1000 -p/--threads NTHREADS
1001
1002 </td><td>
1003
1004 Launch `NTHREADS` parallel search threads (default: 1). Threads will run on
1005 separate processors/cores and synchronize when parsing reads and outputting
1006 alignments. Searching for alignments is highly parallel, and speedup is close
1007 to linear. Increasing `-p` increases Centrifuge's memory footprint. E.g. when
1008 aligning to a human genome index, increasing `-p` from 1 to 8 increases the
1009 memory footprint by a few hundred megabytes. This option is only available if
1010 `bowtie` is linked with the `pthreads` library (i.e. if `BOWTIE_PTHREADS=0` is
1011 not specified at build time).
1012
1013 </td></tr>
1014 <tr><td id="centrifuge-options-reorder">
1015
1016 [`--reorder`]: #centrifuge-options-reorder
1017
1018 --reorder
1019
1020 </td><td>
1021
1022 Guarantees that output records are printed in an order corresponding to the
1023 order of the reads in the original input file, even when [`-p`] is set greater
1024 than 1. Specifying `--reorder` and setting [`-p`] greater than 1 causes Centrifuge
1025 to run somewhat slower and use somewhat more memory then if `--reorder` were
1026 not specified. Has no effect if [`-p`] is set to 1, since output order will
1027 naturally correspond to input order in that case.
1028
1029 </td></tr>
1030 <tr><td id="centrifuge-options-mm">
1031
1032 [`--mm`]: #centrifuge-options-mm
1033
1034 --mm
1035
1036 </td><td>
1037
1038 Use memory-mapped I/O to load the index, rather than typical file I/O.
1039 Memory-mapping allows many concurrent `bowtie` processes on the same computer to
1040 share the same memory image of the index (i.e. you pay the memory overhead just
1041 once). This facilitates memory-efficient parallelization of `bowtie` in
1042 situations where using [`-p`] is not possible or not preferable.
1043
1044 </td></tr></table>
1045
1046 #### Other options
1047
1048 <table>
1049 <tr><td id="centrifuge-options-qc-filter">
1050
1051 [`--qc-filter`]: #centrifuge-options-qc-filter
1052
1053 --qc-filter
1054
1055 </td><td>
1056
1057 Filter out reads for which the QSEQ filter field is non-zero. Only has an
1058 effect when read format is [`--qseq`]. Default: off.
1059
1060 </td></tr>
1061 <tr><td id="centrifuge-options-seed">
1062
1063 [`--seed`]: #centrifuge-options-seed
1064
1065 --seed <int>
1066
1067 </td><td>
1068
1069 Use `<int>` as the seed for pseudo-random number generator. Default: 0.
1070
1071 </td></tr>
1072 <tr><td id="centrifuge-options-non-deterministic">
1073
1074 [`--non-deterministic`]: #centrifuge-options-non-deterministic
1075
1076 --non-deterministic
1077
1078 </td><td>
1079
1080 Normally, Centrifuge re-initializes its pseudo-random generator for each read. It
1081 seeds the generator with a number derived from (a) the read name, (b) the
1082 nucleotide sequence, (c) the quality sequence, (d) the value of the [`--seed`]
1083 option. This means that if two reads are identical (same name, same
1084 nucleotides, same qualities) Centrifuge will find and report the same classification(s)
1085 for both, even if there was ambiguity. When `--non-deterministic` is specified,
1086 Centrifuge re-initializes its pseudo-random generator for each read using the
1087 current time. This means that Centrifuge will not necessarily report the same
1088 classification for two identical reads. This is counter-intuitive for some users,
1089 but might be more appropriate in situations where the input consists of many
1090 identical reads.
1091
1092 </td></tr>
1093 <tr><td id="centrifuge-options-version">
1094
1095 [`--version`]: #centrifuge-options-version
1096
1097 --version
1098
1099 </td><td>
1100
1101 Print version information and quit.
1102
1103 </td></tr>
1104 <tr><td id="centrifuge-options-h">
1105
1106 -h/--help
1107
1108 </td><td>
1109
1110 Print usage information and quit.
1111
1112 </td></tr></table>
1113
1114
1115 The `centrifuge-build` indexer
1116 ===========================
1117
1118 `centrifuge-build` builds a Centrifuge index from a set of DNA sequences.
1119 `centrifuge-build` outputs a set of 6 files with suffixes `.1.cf`, `.2.cf`, and
1120 `.3.cf`. These files together
1121 constitute the index: they are all that is needed to align reads to that
1122 reference. The original sequence FASTA files are no longer used by Centrifuge
1123 once the index is built.
1124
1125 Use of Karkkainen's [blockwise algorithm] allows `centrifuge-build` to trade off
1126 between running time and memory usage. `centrifuge-build` has two options
1127 governing how it makes this trade: [`--bmax`]/[`--bmaxdivn`],
1128 and [`--dcv`]. By default, `centrifuge-build` will automatically search for the
1129 settings that yield the best running time without exhausting memory. This
1130 behavior can be disabled using the [`-a`/`--noauto`] option.
1131
1132 The indexer provides options pertaining to the "shape" of the index, e.g.
1133 [`--offrate`](#centrifuge-build-options-o) governs the fraction of [Burrows-Wheeler]
1134 rows that are "marked" (i.e., the density of the suffix-array sample; see the
1135 original [FM Index] paper for details). All of these options are potentially
1136 profitable trade-offs depending on the application. They have been set to
1137 defaults that are reasonable for most cases according to our experiments. See
1138 [Performance tuning] for details.
1139
1140 The Centrifuge index is based on the [FM Index] of Ferragina and Manzini, which in
1141 turn is based on the [Burrows-Wheeler] transform. The algorithm used to build
1142 the index is based on the [blockwise algorithm] of Karkkainen.
1143
1144 [Blockwise algorithm]: http://portal.acm.org/citation.cfm?id=1314852
1145 [Burrows-Wheeler]: http://en.wikipedia.org/wiki/Burrows-Wheeler_transform
1146 [Performance tuning]: #performance-tuning
1147
1148 Command Line
1149 ------------
1150
1151 Usage:
1152
1153 centrifuge-build [options]* --conversion-table <table_in> --taxonomy-tree <taxonomy_in> --name-table <table_in2> <reference_in> <cf_base>
1154
1155 ### Main arguments
1156
1157 <table><tr><td>
1158
1159 <reference_in>
1160
1161 </td><td>
1162
1163 A comma-separated list of FASTA files containing the reference sequences to be
1164 aligned to, or, if [`-c`](#centrifuge-build-options-c) is specified, the sequences
1165 themselves. E.g., `<reference_in>` might be `chr1.fa,chr2.fa,chrX.fa,chrY.fa`,
1166 or, if [`-c`](#centrifuge-build-options-c) is specified, this might be
1167 `GGTCATCCT,ACGGGTCGT,CCGTTCTATGCGGCTTA`.
1168
1169 </td></tr><tr><td>
1170
1171 <cf_base>
1172
1173 </td><td>
1174
1175 The basename of the index files to write. By default, `centrifuge-build` writes
1176 files named `NAME.1.cf`, `NAME.2.cf`, and `NAME.3.cf`, where `NAME` is `<cf_base>`.
1177
1178 </td></tr></table>
1179
1180 ### Options
1181
1182 <table><tr><td>
1183
1184 -f
1185
1186 </td><td>
1187
1188 The reference input files (specified as `<reference_in>`) are FASTA files
1189 (usually having extension `.fa`, `.mfa`, `.fna` or similar).
1190
1191 </td></tr><tr><td id="centrifuge-build-options-c">
1192
1193 -c
1194
1195 </td><td>
1196
1197 The reference sequences are given on the command line. I.e. `<reference_in>` is
1198 a comma-separated list of sequences rather than a list of FASTA files.
1199
1200 </td></tr>
1201 <tr><td id="centrifuge-build-options-a">
1202
1203 [`-a`/`--noauto`]: #centrifuge-build-options-a
1204
1205 -a/--noauto
1206
1207 </td><td>
1208
1209 Disable the default behavior whereby `centrifuge-build` automatically selects
1210 values for the [`--bmax`], [`--dcv`] and [`--packed`] parameters according to
1211 available memory. Instead, user may specify values for those parameters. If
1212 memory is exhausted during indexing, an error message will be printed; it is up
1213 to the user to try new parameters.
1214
1215 </td></tr><tr><td id="centrifuge-build-options-p">
1216
1217 [`-p`]: #centrifuge-build-options-p
1218
1219 -p/--threads <int>
1220
1221 </td><td>
1222
1223 Launch `NTHREADS` parallel search threads (default: 1).
1224
1225 </td></tr><tr><td id="centrifuge-build-options-conversion-table">
1226
1227 [`--conversion-table`]: #centrifuge-build-options-conversion-table
1228
1229 --conversion-table <file>
1230
1231 </td><td>
1232
1233 List of UIDs (unique ID) and corresponding taxonomic IDs.
1234
1235 </td></tr><tr><td id="centrifuge-build-options-taxonomy-tree">
1236
1237 [`--taxonomy-tree`]: #centrifuge-build-options-taxonomy-tree
1238
1239 --taxonomy-tree <file>
1240
1241 </td><td>
1242
1243 Taxonomic tree (e.g. nodes.dmp).
1244
1245 </td></tr><tr><td id="centrifuge-build-options-name-table">
1246
1247 [`--taxonomy-tree`]: #centrifuge-build-options-name-table
1248
1249 --name-table <file>
1250
1251 </td><td>
1252
1253 Name table (e.g. names.dmp).
1254
1255 </td></tr><tr><td id="centrifuge-build-options-taxonomy-tree">
1256
1257 [`--size-table`]: #centrifuge-build-options-size-table
1258
1259 --size-table <file>
1260
1261 </td><td>
1262
1263 List of taxonomic IDs and lengths of the sequences belonging to the same taxonomic IDs.
1264
1265 </td></tr><tr><td id="centrifuge-build-options-bmax">
1266
1267 [`--bmax`]: #centrifuge-build-options-bmax
1268
1269 --bmax <int>
1270
1271 </td><td>
1272
1273 The maximum number of suffixes allowed in a block. Allowing more suffixes per
1274 block makes indexing faster, but increases peak memory usage. Setting this
1275 option overrides any previous setting for [`--bmax`], or [`--bmaxdivn`].
1276 Default (in terms of the [`--bmaxdivn`] parameter) is [`--bmaxdivn`] 4. This is
1277 configured automatically by default; use [`-a`/`--noauto`] to configure manually.
1278
1279 </td></tr><tr><td id="centrifuge-build-options-bmaxdivn">
1280
1281 [`--bmaxdivn`]: #centrifuge-build-options-bmaxdivn
1282
1283 --bmaxdivn <int>
1284
1285 </td><td>
1286
1287 The maximum number of suffixes allowed in a block, expressed as a fraction of
1288 the length of the reference. Setting this option overrides any previous setting
1289 for [`--bmax`], or [`--bmaxdivn`]. Default: [`--bmaxdivn`] 4. This is
1290 configured automatically by default; use [`-a`/`--noauto`] to configure manually.
1291
1292 </td></tr><tr><td id="centrifuge-build-options-dcv">
1293
1294 [`--dcv`]: #centrifuge-build-options-dcv
1295
1296 --dcv <int>
1297
1298 </td><td>
1299
1300 Use `<int>` as the period for the difference-cover sample. A larger period
1301 yields less memory overhead, but may make suffix sorting slower, especially if
1302 repeats are present. Must be a power of 2 no greater than 4096. Default: 1024.
1303 This is configured automatically by default; use [`-a`/`--noauto`] to configure
1304 manually.
1305
1306 </td></tr><tr><td id="centrifuge-build-options-nodc">
1307
1308 [`--nodc`]: #centrifuge-build-options-nodc
1309
1310 --nodc
1311
1312 </td><td>
1313
1314 Disable use of the difference-cover sample. Suffix sorting becomes
1315 quadratic-time in the worst case (where the worst case is an extremely
1316 repetitive reference). Default: off.
1317
1318 </td></tr><tr><td id="centrifuge-build-options-o">
1319
1320 -o/--offrate <int>
1321
1322 </td><td>
1323
1324 To map alignments back to positions on the reference sequences, it's necessary
1325 to annotate ("mark") some or all of the [Burrows-Wheeler] rows with their
1326 corresponding location on the genome.
1327 [`-o`/`--offrate`](#centrifuge-build-options-o) governs how many rows get marked:
1328 the indexer will mark every 2^`<int>` rows. Marking more rows makes
1329 reference-position lookups faster, but requires more memory to hold the
1330 annotations at runtime. The default is 4 (every 16th row is marked; for human
1331 genome, annotations occupy about 680 megabytes).
1332
1333 </td></tr><tr><td>
1334
1335 -t/--ftabchars <int>
1336
1337 </td><td>
1338
1339 The ftab is the lookup table used to calculate an initial [Burrows-Wheeler]
1340 range with respect to the first `<int>` characters of the query. A larger
1341 `<int>` yields a larger lookup table but faster query times. The ftab has size
1342 4^(`<int>`+1) bytes. The default setting is 10 (ftab is 4MB).
1343
1344 </td></tr><tr><td>
1345
1346 --seed <int>
1347
1348 </td><td>
1349
1350 Use `<int>` as the seed for pseudo-random number generator.
1351
1352 </td></tr><tr><td>
1353
1354 --kmer-count <int>
1355
1356 </td><td>
1357
1358 Use `<int>` as kmer-size for counting the distinct number of k-mers in the input sequences.
1359
1360 </td></tr><tr><td>
1361
1362 -q/--quiet
1363
1364 </td><td>
1365
1366 `centrifuge-build` is verbose by default. With this option `centrifuge-build` will
1367 print only error messages.
1368
1369 </td></tr><tr><td>
1370
1371 -h/--help
1372
1373 </td><td>
1374
1375 Print usage information and quit.
1376
1377 </td></tr><tr><td>
1378
1379 --version
1380
1381 </td><td>
1382
1383 Print version information and quit.
1384
1385 </td></tr></table>
1386
1387 The `centrifuge-inspect` index inspector
1388 =====================================
1389
1390 `centrifuge-inspect` extracts information from a Centrifuge index about what kind of
1391 index it is and what reference sequences were used to build it. When run without
1392 any options, the tool will output a FASTA file containing the sequences of the
1393 original references (with all non-`A`/`C`/`G`/`T` characters converted to `N`s).
1394 It can also be used to extract just the reference sequence names using the
1395 [`-n`/`--names`] option or a more verbose summary using the [`-s`/`--summary`]
1396 option.
1397
1398 Command Line
1399 ------------
1400
1401 Usage:
1402
1403 centrifuge-inspect [options]* <cf_base>
1404
1405 ### Main arguments
1406
1407 <table><tr><td>
1408
1409 <cf_base>
1410
1411 </td><td>
1412
1413 The basename of the index to be inspected. The basename is name of any of the
1414 index files but with the `.X.cf` suffix omitted.
1415 `centrifuge-inspect` first looks in the current directory for the index files, then
1416 in the directory specified in the `Centrifuge_INDEXES` environment variable.
1417
1418 </td></tr></table>
1419
1420 ### Options
1421
1422 <table><tr><td>
1423
1424 -a/--across <int>
1425
1426 </td><td>
1427
1428 When printing FASTA output, output a newline character every `<int>` bases
1429 (default: 60).
1430
1431 </td></tr><tr><td id="centrifuge-inspect-options-n">
1432
1433 [`-n`/`--names`]: #centrifuge-inspect-options-n
1434
1435 -n/--names
1436
1437 </td><td>
1438
1439 Print reference sequence names, one per line, and quit.
1440
1441 </td></tr><tr><td id="centrifuge-inspect-options-s">
1442
1443 [`-s`/`--summary`]: #centrifuge-inspect-options-s
1444
1445 -s/--summary
1446
1447 </td><td>
1448
1449 Print a summary that includes information about index settings, as well as the
1450 names and lengths of the input sequences. The summary has this format:
1451
1452 Colorspace <0 or 1>
1453 SA-Sample 1 in <sample>
1454 FTab-Chars <chars>
1455 Sequence-1 <name> <len>
1456 Sequence-2 <name> <len>
1457 ...
1458 Sequence-N <name> <len>
1459
1460 Fields are separated by tabs. Colorspace is always set to 0 for Centrifuge.
1461
1462 </td></tr><tr><td id="centrifuge-inspect-options-conversion-table">
1463
1464 [`--conversion-table`]: #centrifuge-inspect-options-conversion-table
1465
1466 --conversion-table
1467
1468 </td><td>
1469
1470 Print a list of UIDs (unique ID) and corresponding taxonomic IDs.
1471
1472 </td></tr><tr><td id="centrifuge-inspect-options-taxonomy-tree">
1473
1474 [`--taxonomy-tree`]: #centrifuge-inspect-options-taxonomy-tree
1475
1476 --taxonomy-tree
1477
1478 </td><td>
1479
1480 Print taxonomic tree.
1481
1482 </td></tr><tr><td id="centrifuge-inspect-options-name-table">
1483
1484 [`--taxonomy-tree`]: #centrifuge-inspect-options-name-table
1485
1486 --name-table
1487
1488 </td><td>
1489
1490 Print name table.
1491
1492 </td></tr><tr><td id="centrifuge-inspect-options-taxonomy-tree">
1493
1494 [`--size-table`]: #centrifuge-inspect-options-size-table
1495
1496 --size-table
1497
1498 </td><td>
1499
1500 Print a list of taxonomic IDs and lengths of the sequences belonging to the same taxonomic IDs.
1501
1502 </td></tr><tr><td>
1503
1504 -v/--verbose
1505
1506 </td><td>
1507
1508 Print verbose output (for debugging).
1509
1510 </td></tr><tr><td>
1511
1512 --version
1513
1514 </td><td>
1515
1516 Print version information and quit.
1517
1518 </td></tr><tr><td>
1519
1520 -h/--help
1521
1522 </td><td>
1523
1524 Print usage information and quit.
1525
1526 </td></tr></table>
1527
1528 [`small example`]: #centrifuge-example
1529
1530 Getting started with Centrifuge
1531 ===================================================
1532
1533 Centrifuge comes with some example files to get you started. The example files
1534 are not scientifically significant; these files will simply let you start running Centrifuge and
1535 downstream tools right away.
1536
1537 First follow the manual instructions to [obtain Centrifuge]. Set the `CENTRIFUGE_HOME`
1538 environment variable to point to the new Centrifuge directory containing the
1539 `centrifuge`, `centrifuge-build` and `centrifuge-inspect` binaries. This is important,
1540 as the `CENTRIFUGE_HOME` variable is used in the commands below to refer to that
1541 directory.
1542
1543 [obtain Centrifuge]: #obtaining-centrifuge
1544
1545 Indexing a reference genome
1546 ---------------------------
1547
1548 To create an index for two small sequences included with Centrifuge, create a new temporary directory (it doesn't matter where), change into that directory, and run:
1549
1550 $CENTRIFUGE_HOME/centrifuge-build --conversion-table $CENTRIFUGE_HOME/example/reference/gi_to_tid.dmp --taxonomy-tree $CENTRIFUGE_HOME/example/reference/nodes.dmp --name-table $CENTRIFUGE_HOME/example/reference/names.dmp $CENTRIFUGE_HOME/example/reference/test.fa test
1551
1552 The command should print many lines of output then quit. When the command
1553 completes, the current directory will contain ten new files that all start with
1554 `test` and end with `.1.cf`, `.2.cf`, `.3.cf`. These files constitute the index - you're done!
1555
1556 You can use `centrifuge-build` to create an index for a set of FASTA files obtained
1557 from any source, including sites such as [UCSC], [NCBI], and [Ensembl]. When
1558 indexing multiple FASTA files, specify all the files using commas to separate
1559 file names. For more details on how to create an index with `centrifuge-build`,
1560 see the [manual section on index building]. You may also want to bypass this
1561 process by obtaining a pre-built index.
1562
1563 [UCSC]: http://genome.ucsc.edu/cgi-bin/hgGateway
1564 [NCBI]: http://www.ncbi.nlm.nih.gov/sites/genome
1565 [Ensembl]: http://www.ensembl.org/
1566 [manual section on index building]: #the-centrifuge-build-indexer
1567 [using a pre-built index]: #using-a-pre-built-index
1568
1569 Classifying example reads
1570 ----------------------
1571
1572 Stay in the directory created in the previous step, which now contains the
1573 `test` index files. Next, run:
1574
1575 $CENTRIFUGE_HOME/centrifuge -f -x test $CENTRIFUGE_HOME/example/reads/input.fa
1576
1577 This runs the Centrifuge classifier, which classifies a set of unpaired reads to the
1578 the genomes using the index generated in the previous step.
1579 The classification results are reported to stdout, and a
1580 short classification summary is written to centrifuge-species_report.tsv.
1581
1582 You will see something like this:
1583
1584 readID seqID taxID score 2ndBestScore hitLength numMatches
1585 C_1 gi|7 9913 4225 4225 80 2
1586 C_1 gi|4 9646 4225 4225 80 2
1587 C_2 gi|4 9646 4225 4225 80 2
1588 C_2 gi|7 9913 4225 4225 80 2
1589 C_3 gi|7 9913 4225 4225 80 2
1590 C_3 gi|4 9646 4225 4225 80 2
1591 C_4 gi|4 9646 4225 4225 80 2
1592 C_4 gi|7 9913 4225 4225 80 2
1593 1_1 gi|4 9646 4225 0 80 1
1594 1_2 gi|4 9646 4225 0 80 1
1595 2_1 gi|7 9913 4225 0 80 1
1596 2_2 gi|7 9913 4225 0 80 1
1597 2_3 gi|7 9913 4225 0 80 1
1598 2_4 gi|7 9913 4225 0 80 1
1599 2_5 gi|7 9913 4225 0 80 1
1600 2_6 gi|7 9913 4225 0 80 1