BBMap Legacy README

Note: This readme for BBMap has not been maintained and is superceded by the information in the shellscript, bbmap.sh.

Basic Syntax

Using Shellscript (Unix)

Autodetects RAM to set -Xmx parameter. You can also include a flag like -Xmx31g in the shellscript arguments to set RAM usage.

To index:

bbmap.sh ref=<reference.fa>

To map:

bbmap.sh in=<reads.fq> out=<mapped.sam>

Without Shellscript

To index:

java -ea -Xmx31g -cp <PATH> align2.BBMap ref=<reference.fa>

To map:

java -ea -Xmx31g -cp <PATH> align2.BBMap in=<reads.fq> out=<mapped.sam>

...where <PATH> should indicate the path to the directory containing all the source code directories; e.g. "/usr/bin/bbmap/current"

Please note: The reference is only needed for building the index the first time; subsequently, just specify the build number which corresponds to that reference.

So for example the first time you map to e.coli you might specify ref=ecoli_reference.fa build=3; after that, just specify build=3.

The index files would then be stored in ./ref/genome/3/ and ./ref/index/3/

Also, the -Xmx parameter should specify approximately 85% of the physical memory of the target machine; so, 21G for a 24GB node. The process needs approximately 8 bytes per reference base (plus a several hundred MB overhead).

Advanced Syntax

Indexing Parameters

Required when building the index

Input Parameters

Sampling Parameters

Mapping Parameters

Post-Filtering Parameters

Output Parameters

SAM Settings and Flags

Statistics and Histogram Parameters

Coverage Output Parameters

These may reduce speed and use more RAM

Trimming Parameters

Java Parameters

Splitting Parameters

The splitter is invoked by calling bbsplit.sh (or align2.BBSplitter) instead of bbmap.sh, for the indexing phase. It allows combining multiple references and outputting reads to different files depending on which one they mapped to best. The order in which references are specified is important in cases of ambiguous mappings; when a read has 2 identically-scoring mapping locations from different references, it will be mapped to the first reference.

All parameters are the same as BBMap with the exception of the ones listed below. You can still use "outu=" to capture unmapped reads.

Formats and Extensions

Different Versions

Notes

File types are autodetected by parsing the filename. So you can name files, say, out.fq.gz or out.fastq.gz or reads1.fasta.bz2 or data.sam and it will work as long as the extensions are correct.