Assigns reads to samples using index reads.
One output file is created for each sample, i.e. for each barcode which appears in the reads. The name of the output files are sample names, given by the label on the barcode. A suffix such as .fa or .fq can be specified by -filename_suffix.
-index option: FASTA or FASTQ file with index reads. Sequence labels must match the input file and appear in the same order.
-barcodes: FASTA file containing barcode sequences which are matched to the index reads. The label of a barcode label is assumed to be the sample name.
-maxdiffs option: Maximum number of differences allowed between an index read and a barcode. Default 0.
-filename_suffix option: Suffix to append to the output files.
Paired reads are not supported. You can hack a solution for paired reads by demultiplexing the R1s, extracting the labels from the one sample file at a time and using fastx_getseqs to get the R2s.
Example
usearch -fastx_demux reads.fq -index index.fq -barcodes bar.fa
-filename_suffix .fq