Bowtie2BuildOptions

Contain options to create Bowtie 2 index files from reference sequences

Description

A Bowtie2BuildOptions object contains options to run the bowtie2build function that builds Bowtie 2 index files from reference sequences.

Creation

Description

example

buildOptions = Bowtie2BuildOptions creates a Bowtie2BuildOptions object with default property values.

Bowtie2BuildOptions requires the Bioinformatics Toolbox™ Interface for Bowtie Aligner. If this support package is not installed, then the function provides a download link. For details, see Bioinformatics Toolbox Software Support Packages.

Note

Bowtie2BuildOptions is supported on Mac and UNIX® platforms only.

example

buildOptions = Bowtie2BuildOptions(Name,Value) sets properties using one or more name-value pairs. Enclose each property name in quotes. For example, buildOptions = Bowtie2BuildOptions('ForceLargeIndex',true) specifies to force the creation of a large index even if the reference is less than 4 billion nucleotides long.

example

buildOptions = Bowtie2BuildOptions(S) specifies optional parameters in a character vector or string S.

Input Arguments

expand all

Parameters to build the index files, specified as a character vector. S must be in the Bowtie 2 option syntax (prefixed by one or two dashes) [1].

Data Types: char | string

Properties

expand all

Boolean indicator to build only the 3.bt2 and 4.bt2 files that correspond to the bitpacked version of reference sequences, specified as true or false.

Example: 'BuildOnlyReference',true

Data Types: logical

Boolean indicator to omit building the 3.bt2 and 4.bt2 files that correspond to the bitpacked version of reference sequences, specified as true or false.

Example: 'BuildNoReference',true

Data Types: logical

Additional options not included in the object properties, specified as a character vector. The character vector must be in the Bowtie 2 option syntax (prefixed by one or two dashes). The default value is an empty character vector ''.

Example: 'ExtraBowtie2Command','--version'

Data Types: char | string

Boolean indicator to force building a large index even if the reference is less than four billion nucleotides long, specified as true or false.

Example: 'ForceLargeIndex',true

Data Types: logical

Number of parallel threads to build the index files, specified as a positive integer. Threads are run on separate processors or cores. Increasing the number of threads provides significant speed-up (close to linear) but also increases the memory footprint.

Example: 'NumThreads',4

Data Types: double

Number of Burrows-Wheeler rows to mark when building the index files, specified as a positive integer. To map the alignment back to positions on the reference sequences, the function uses this number to mark some of the rows in the Burrows-Wheeler algorithm with their corresponding location on the genome. The function marks every 2n, where n is the offrate.

Increasing the number of marked rows makes the reference position lookups faster, but requires more memory.

Example: 'Offrate',6

Data Types: double

Number to set the seed in the pseudo-random number generator, specified as a nonnegative integer.

Example: 'Seed',3

Data Types: double

Object Functions

getBowtie2CommandTranslate object properties to Bowtie 2 options
getBowtie2TableRetrieve table with object properties and equivalent Bowtie 2 options
runBuild Bowtie 2 index files

Examples

collapse all

Build a set of index files for the Drosophila genome. An error message appears if you do not have the Bioinformatics Toolbox Interface for Bowtie Aligner support package installed when you run the function. Click the provided link to download the package from the Add-on menu.

For this example, the reference sequence Dmel_chr4.fa is already provided with the toolbox.

status = bowtie2build('Dmel_chr4.fa', 'Dmel_chr4_index');

If the index build is successful, the function returns 0 and creates the index files (*.bt2) in the current folder. The files have the prefix 'Dmel_chr4_index'.

You can specify different options by using a Bowtie2BuildOptions object or by passing in a Bowtie 2 syntax string. For instance, you can specify whether to force the creation of a large index even if the reference is less than four billion nucleotides long as follows.

buildOpt = Bowtie2BuildOptions;

Set the ForceLargeIndex option to true.

buildOpt.ForceLargeIndex = true;

Build the index files using the specified option.

bowtie2build('Dmel_chr4.fa', 'Dmel_chr4_index_large',buildOpt);

Alternatively, you can pass in a Bowtie 2 syntax string.

flag = bowtie2build('Dmel_chr4.fa', 'Dmel_chr4_index_large2','--large-index');

References

[1] Langmead, B., and S. Salzberg. "Fast gapped-read alignment with Bowtie 2." Nature Methods. 9, 2012, 357–359.

Introduced in R2018a