Reference

Command-line interface

Complete option reference for centrifuger-build, centrifuger, centrifuger-quant and centrifuger-download.

Every Centrifuger program prints its usage message when run without arguments. This page collects those options in one place.

centrifuger-build#

Builds a searchable index from reference sequences and an NCBI-style taxonomy. See building an index for worked examples.

text
Usage: ./centrifuger-build [OPTIONS]

Required#

OptionDescription
-r FILEReference sequence file. Repeat -r to give more than one input file.
-l FILEList of reference sequence files, one path per row. A second column may carry the taxonomy ID mapping. Use instead of -r.
--taxonomy-tree FILETaxonomy tree, i.e. the nodes.dmp file.
--name-table FILEName table, i.e. the names.dmp file.

-r and -l are alternatives; supply one of them.

Optional#

OptionDefaultDescription
--conversion-table FILE—seqID to taxID conversion file. When not set, -l is expected and its file must have two columns, file taxID.
-o STRINGcentrifugerOutput prefix.
-t INT1Number of threads.
--proteingenomeReference consists of protein sequences.
--build-mem STRnot usedAutomatically infer --bmax and --dcv to match a memory constraint. Accepts T, G, M, K suffixes.
--bmax INT16777216Block size for blockwise suffix array sorting.
--dcv INT4096Difference cover period.
--offrate INT4SA/offset is sampled every 2^INT BWT characters.
--subset-tax INT0Only consider the subset of input genomes under this taxonomy node.
--concat-tax-genomenot usedConcatenate genomes sharing a taxID and discard the seqID information.
--ignore-uncategorized-genomeinclude allIgnore genomes whose seqID or taxID is missing or uncategorised.
--checkpointnot usedWrite checkpoint files ([output_prefix]_checkpoint.[123]) so an interrupted build can resume.

centrifuger#

Classifies reads against an index. Output is written to standard output. See classifying reads.

text
Usage: ./centrifuger [OPTIONS] > classification.tsv

Required#

OptionDescription
-x FILEIndex prefix.
-1 FILE -2 FILEPaired-end read files.
-u FILESingle-end read file.
-i FILEInterleaved paired-end read file.
--sample-sheet FILEList of sample files. Each row: read1 read2 barcode UMI output. Use a dot (.) where there is no such file.

-x is always required, together with exactly one of the read-input forms.

Optional#

OptionDefaultDescription
-t INT1Number of threads.
-k INT1Report up to this many distinct, primary assignments for each read pair.
--un STR—Write unclassified reads to files with this prefix, e.g. <str>_1/2.fq.gz.
--cl STR—Write classified reads to files with this prefix.
--barcode STR—Path to the barcode file.
--UMI STR—Path to the UMI file.
--read-format STR—Format for read, barcode and UMI files, e.g. r1:0:-1,r2:0:-1,bc:0:15,um:16:-1.
--barcode-whitelist STR—Path to the barcode whitelist file. Requires --barcode.
--barcode-translate STR—Path to the barcode translation file.
--min-hitlen INTautoMinimum length of partial hits.
--hitk-factor INT40Resolve at most INT × k entries for each hit. Use 0 for no restriction.
--consider-secondary INT,FLOAT2000,0.995Consider a secondary hit when its hit length ≥ INT and its score ≥ FLOAT × best_score.
--no-dustmaskDo not DUST-mask low-complexity regions of reads.
--merge-readpair—Merge overlapping paired-end reads and trim adapters.

The --read-format specification#

Each comma-separated field takes the form:

text
[r1|r2|bc|um]:start:end:strand

start and end are 0-based and inclusive; -1 means the end of the read. strand is + or -, may be omitted when +, and is ignored for r1 and r2. Repeating a field concatenates non-consecutive segments, e.g. bc:0:15,bc:32:-1.

To read a barcode or UMI out of the FASTQ header comment instead of the sequence:

text
[bc|um]:hd:field:start:end:strand

hd is a keyword selecting the header comment. field is either a 0-based field index within the comment (the read ID excluded) or a string prefix to search for. Full explanation and examples in single-cell and barcoded data.

centrifuger-quant#

Aggregates a classification file into a taxonomic profile. See abundance quantification.

text
Usage: ./centrifuger-quant [OPTIONS] > report.tsv

Required#

OptionDescription
-x FILEIndex prefix.
-c FILEClassification file.

When -x is not given, the taxonomy must be supplied directly:

OptionDescription
--taxonomy-tree FILETaxonomy tree, i.e. the nodes.dmp file.
--name-table FILEName table, i.e. the names.dmp file.
--size-table FILEOptional table of contig or genome sizes.

Optional#

OptionDescription
--min-score INTOnly consider reads with a score of at least this value.
--min-length INTOnly consider reads with a classified length of at least this value.
--output-format INTOutput format: 0 Centrifuge (default), 1 MetaPhlAn, 2 CAMI, 3 Kraken report.

centrifuger-download#

Downloads reference sequences and taxonomy from NCBI, and fetches published indexes. It follows the conventions of centrifuge-download, so Centrifuge's documentation applies with the program renamed.

bash
# fetch a pre-built index by title
centrifuger-download cfr_hpv+gbsarscov2

# NCBI taxonomy into taxonomy/
centrifuger-download -o taxonomy taxonomy

# RefSeq archaea, bacteria and viruses into library/, capturing the seqID→taxID map
centrifuger-download -o library -d "archaea,bacteria,viral" refseq > seqid2taxid.map

The options used across this documentation:

OptionDescription
-o DIROutput directory.
-d STRComma-separated list of NCBI domains, e.g. archaea,bacteria,viral, vertebrate_mammalian.
-t INTRestrict to this taxonomy ID, e.g. 9606 for human, 10090 for mouse.
-a STRRestrict to this assembly level, e.g. Chromosome.
-c STRRestrict to this RefSeq category, e.g. reference genome.

Exit status and streams#

  • Classification and quantification results go to standard output; progress and diagnostics go to standard error. Redirecting stdout to a file therefore keeps the messages visible.
  • A filename of - reads from standard input, which is how samtools output is piped into centrifuger.
  • Wildcards in -1, -2 and -u are expanded by Centrifuger, so the pattern must be quoted to keep the shell from expanding it first.
Edit this page on GitHub