LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

nextclade

analyzes viral genome sequences, assigning clades, calling mutations

TLDR

Analyze sequences with a dataset downloaded on the fly, writing all outputs to a directory
$ nextclade run -d [nextstrain/sars-cov-2/wuhan-hu-1/orfs] -O [output/] [sequences.fasta]
copy
Write only a TSV of results
$ nextclade run -d [sars-cov-2] -t [results.tsv] [sequences.fasta]
copy
List available datasets
$ nextclade dataset list --only-names
copy
Search datasets
$ nextclade dataset list --search [flu]
copy
Download a dataset
$ nextclade dataset get -n [nextstrain/sars-cov-2/wuhan-hu-1/orfs] -o [dataset/]
copy
Run with a local dataset
$ nextclade run -D [dataset/] -O [output/] [sequences.fasta]
copy
Output the placement tree and aligned sequences
$ nextclade run -D [dataset/] -T [tree.json] -o [aligned.fasta] [sequences.fasta]
copy
Sort mixed sequences by detected pathogen
$ nextclade sort -O [sorted/] [sequences.fasta]
copy

SYNOPSIS

nextclade command [options]nextclade run [-d name | -D dataset] [output options] input.fasta...nextclade dataset {list | get} [options]

DESCRIPTION

nextclade analyzes viral genome sequences, assigning clades, calling mutations, and assessing sequence quality. It's widely used for SARS-CoV-2, influenza, mpox, RSV and other pathogen surveillance.The tool aligns sequences against a reference genome, identifies mutations (substitutions, insertions, deletions), translates genes, and places each sequence on a reference phylogenetic tree to assign its clade.Quality control metrics flag potential problems: missing data, mixed bases, frameshifts, stop codons, and private mutation clusters. These help identify sequencing errors or contamination.Datasets contain the reference sequence, genome annotation, reference tree and QC configuration. Official and community datasets are served from data.clades.nextstrain.org; custom datasets can be created.The same engine powers Nextclade Web, which runs entirely in the browser.

PARAMETERS

-d, --dataset-name NAME

Download and use this dataset (full name like nextstrain/sars-cov-2/wuhan-hu-1/orfs, or a shortcut like sars-cov-2).
-D, --input-dataset PATH
Use a local dataset directory or zip file.
-r, --input-ref FILE
Reference sequence FASTA (overrides the dataset).
-m, --input-annotation FILE
Genome annotation in GFF3 format.
-O, --output-all DIR
Write all output files into this directory.
-s, --output-selection LIST
Restrict --output-all to: all, fasta, json, ndjson, csv, tsv, tree, tree-nwk, translations, gff, tbl.
-n, --output-basename NAME
Base filename for output files.
-t, --output-tsv FILE
Results as TSV.
-c, --output-csv FILE
Results as CSV (semicolon-delimited).
-J, --output-json FILE
Results as JSON.
-N, --output-ndjson FILE
Results as newline-delimited JSON.
-o, --output-fasta FILE
Aligned nucleotide sequences.
-P, --output-translations TEMPLATE
Aligned peptides, one file per gene (template must contain {cds}).
-T, --output-tree FILE
Tree with placed sequences, Auspice JSON v2.
--output-tree-nwk FILE
Tree with placed sequences, Newick format.
--include-reference
Include the reference in output FASTA files.
--min-length N
Minimum sequence length to attempt alignment.
--alignment-preset PRESET
default, high-diversity or short-sequences.
-j, --jobs N
Number of processing jobs (default: all CPU threads).
--verbosity LEVEL
off, error, warn (default), info, debug, trace.

COMMANDS

run

Alignment, mutation calling, clade assignment, quality checks and phylogenetic placement.
dataset list
List available datasets (--search, --name, --tag, --json, --only-names).
dataset get
Download a dataset to a directory (-o) or zip file (-z).
sort
Detect which dataset each sequence belongs to and split the input accordingly.
completions shell
Generate shell completions.

CAVEATS

Results depend on dataset quality and version; pin a dataset tag (-t on dataset get) for reproducible results. Novel lineages may not be assigned correctly. In v3, input FASTA files are positional arguments; the v2 flag --input-fasta (-i) was removed and dataset names changed to paths like nextstrain/sars-cov-2/wuhan-hu-1/orfs, so older scripts need updating. Using -d re-downloads the dataset on every run.

HISTORY

Nextclade was developed by the Nextstrain team (Ivan Aksamentov, Richard Neher and others) starting in 2020 during the COVID-19 pandemic. Version 2 (2022) rewrote the CLI in Rust, and version 3 (2024) introduced a new dataset system and absorbed the standalone nextalign tool, which is no longer released separately.

SEE ALSO

nextalign(1), pangolin(1), mafft(1), minimap2(1)

RESOURCES

Copied to clipboard
Kai