Skip to content
jtroehr edited this page Oct 22, 2019 · 19 revisions

Flexbar logo

Usage of Flexbar 3.5

flexbar -r reads [-b barcodes] [-a adapters] [options]

Options for information on the software:

-h, --help
      Display the help message.
-hh, --full-help
      Display the help message with advanced options.
     --version-check STRING
      Update notifications. One of ON and OFF.
-hm, --man-help
      Print advanced options as man document.
-v, --versions
      Print Flexbar and SeqAn version numbers.
-c, --cite
      Show program references for citation.

Basic parameters

Input read files, output prefix name and multi-threading:

-n, --threads INTEGER
      Number of threads to employ. Default: 1.
-N, --bundle INTEGER
      Number of (paired) reads per thread. Default: 256.
-M, --bundles INTEGER
      Process only certain number of bundles for testing.
-t, --target OUTPUT_PREFIX
      Prefix for output file names or paths. Default: flexbarOut.
-r, --reads INPUT_FILE
      Fasta/q file or stdin (-) with reads that may contain barcodes.
-p, --reads2 INPUT_FILE
      Second input file of paired reads, gz and bz2 files supported.
-i, --interleaved
      Interleaved format for first input set with paired reads.
-I, --iupac
      Accept iupac symbols in reads and convert to N if not ATCG.

Barcode detection

Barcodes are detected, removed and guide the separation of reads:

-b, --barcodes INPUT_FILE
      Fasta file with barcodes for demultiplexing, may contain N.
-b2, --barcodes2 INPUT_FILE
      Additional barcodes file for second read set in paired mode.
-br, --barcode-reads INPUT_FILE
      Fasta/q file containing separate barcode reads for detection.
-bo, --barcode-min-overlap INTEGER
      Minimum overlap of barcode and read. Default: barcode length.
-be, --barcode-error-rate DOUBLE
      Error rate threshold for mismatches and gaps. Default: 0.0.
-bt, --barcode-trim-end STRING
      Type of detection, see section trim-end modes. Default: LTAIL.
-bn, --barcode-tail-length INTEGER
      Region size in tail trim-end modes. Default: barcode length.
-bk, --barcode-keep
      Keep barcodes within reads instead of removal.
-bu, --barcode-unassigned
      Include unassigned reads in output generation.
-bm, --barcode-match INTEGER
      Alignment match score. Default: 1.
-bi, --barcode-mismatch INTEGER
      Alignment mismatch score. Default: -1.
-bg, --barcode-gap INTEGER
      Alignment gap score. Default: -9.

Adapter removal

Adapter sequences are detected and removed if criteria are met:

-a, --adapters INPUT_FILE
      Fasta file with adapters for removal that may contain N.
-a2, --adapters2 INPUT_FILE
      File with extra adapters for second read set in paired mode.
-as, --adapter-seq STRING
      Single adapter sequence as alternative to adapters option.
-aa, --adapter-preset STRING
      One of TruSeq, SmallRNA, Methyl, Ribo, Nextera, and NexteraMP.
-ao, --adapter-min-overlap INTEGER
      Minimum overlap for removal without pair overlap. Default: 3.
-ae, --adapter-error-rate DOUBLE
      Error rate threshold for mismatches and gaps. Default: 0.1.
-at, --adapter-trim-end STRING
      Type of removal, see section trim-end modes. Default: RIGHT.
-an, --adapter-tail-length INTEGER
      Region size for tail trim-end modes. Default: adapter length.
-ax, --adapter-relaxed
      Skip restriction to pass read ends in right and left modes.
-ap, --adapter-pair-overlap STRING
      Overlap detection of paired reads. One of ON, SHORT, and ONLY.
-av, --adapter-min-poverlap INTEGER
      Minimum overlap of paired reads for detection. Default: 40.
-ac, --adapter-revcomp STRING
      Include reverse complements of adapters. One of ON and ONLY.
-ad, --adapter-revcomp-end STRING
      Use different trim-end for reverse complements of adapters.
-ab, --adapter-add-barcode
      Add reverse complement of detected barcode to adapters.
-ar, --adapter-read-set STRING
      Consider only single read set for adapters. One of 1 and 2.
-ak, --adapter-trimmed-out STRING
      Modify that trimmed reads are kept. One of OFF and ONLY.
-ay, --adapter-cycles INTEGER
      Number of adapter removal cycles. Default: 1.
-am, --adapter-match INTEGER
      Alignment match score. Default: 1.
-ai, --adapter-mismatch INTEGER
      Alignment mismatch score. Default: -1.
-ag, --adapter-gap INTEGER
      Alignment gap score. Default: -6.

Filtering and trimming

Filter and trim reads before and after processing barcodes and adapters:

-u, --max-uncalled INTEGER
      Allowed uncalled bases N for each read. Default: 0.
-x, --pre-trim-left INTEGER
      Trim given number of bases on 5' read end before detection.
-y, --pre-trim-right INTEGER
      Trim specified number of bases on 3' end prior to detection.
-k, --post-trim-length INTEGER
      Trim to specified read length from 3' end after removal.
-m, --min-read-length INTEGER
      Minimum read length to remain after removal. Default: 18.

Quality-based trimming

Trim reads based on sequence quality scores:

-q, --qtrim STRING
      Quality-based trimming mode. One of TAIL, WIN, and BWA.
-qf, --qtrim-format STRING
      Quality format. One of sanger, solexa, i1.3, i1.5, and i1.8.
-qt, --qtrim-threshold INTEGER
      Minimum quality as threshold for trimming. Default: 20.
-qw, --qtrim-win-size INTEGER
      Region size for sliding window approach. Default: 5.
-qa, --qtrim-post-removal
      Perform quality-based trimming after removal steps.

Trimming of homopolymers

Trim specific homopolymers at read ends:

-hl, --htrim-left STRING
      Trim specific homopolymers on left read end after removal.
-hr, --htrim-right STRING
      Trim certain homopolymers on right read end after removal.
-hi, --htrim-min-length INTEGER
      Minimum length of homopolymers at read ends. Default: 3.
-h2, --htrim-min-length2 INTEGER
      Minimum length for homopolymers specified after first one.
-hx, --htrim-max-length INTEGER
      Maximum length of homopolymers on left and right read end.
-hf, --htrim-max-first
      Apply maximum length of homopolymers only for first one.
-he, --htrim-error-rate DOUBLE
      Error rate threshold for mismatches. Default: 0.1.
-ha, --htrim-adapter
      Trim only in case of adapter removal on same side.

Output selection

Select options for output file generation:

-f, --fasta-output
      Prefer non-quality format fasta for output.
-z, --zip-output STRING
      Direct compression of output files. One of GZ and BZ2.
-1, --stdout-reads
      Write reads to stdout, tagged and interleaved if needed.
-R, --output-reads OUTPUT_FILE
      Output file for reads instead of target prefix usage.
-P, --output-reads2 OUTPUT_FILE
      Output file for reads2 instead of target prefix usage.
-j, --length-dist
      Generate length distribution for read output files.
-s, --single-reads
      Write single reads for too short counterparts in pairs.
-S, --single-reads-paired
      Write paired single reads with N for short counterparts.

Logging and tagging

Write alignments to log file or choose read tagging options:

-l, --align-log STRING
      Print chosen read alignments. One of ALL, MOD, and TAB.
-o, --stdout-log
      Write statistics to stdout instead of target log file.
-O, --output-log OUTPUT_FILE
      Output file for logging instead of target prefix usage.
-g, --removal-tags
      Tag reads that are subject to adapter or barcode removal.
-e, --number-tags
      Replace read tags by ascending number to save space.
-d, --umi-tags
      Capture UMIs in reads at barcode or adapter N positions.

Trim-end modes

Available trim-end modes for barcodes and adapters:

  • ANY: longer side of read remains after removal of overlap
  • LEFT: right side remains after removal, align <= read end
  • RIGHT: left part remains after removal, align >= read start
  • LTAIL: consider first n bases of reads in alignment
  • RTAIL: use only last n bases, see tail-length options