Main Content


Contain options to inspect Bowtie 2 index files


A Bowtie2InspectOptions object contains options to run the bowtie2inspect function that inspects Bowtie 2 index files.




inspectOptions = Bowtie2InspectOptions creates a Bowtie2InspectOptions object with default property values.

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


inspectOptions = Bowtie2InspectOptions(Name,Value) sets properties using one or more name-value pairs. Enclose each property name in quotes. For instance, inspectOptions = Bowtie2InspectOptions('Summary',true) specifies to return a summary of the index content instead of reference sequences.


inspectOptions = Bowtie2InspectOptions(S) specifies optional parameters in a character vector or string S.

Input Arguments

expand all

Parameters to inspect 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


expand all

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 print only the reference sequence names in the output file, specified as true or false.

Example: 'NamesOnly',true

Data Types: logical

Boolean indicator to print a summary information about reference sequence names and lengths instead of actual sequences in the output file, specified as true or false.

Example: 'Summary',true

Data Types: logical

Object Functions

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


collapse all

Get information about the reference sequence used to build the corresponding index files by using bowtie2inspect. An error message appears if you do not have the Bowtie 2 Support Package for Bioinformatics Toolbox installed when you run the function. Click the provided link to download the package from the Add-on menu.

bowtie2inspect('Dmel_chr4', 'Dmel_chr4_retrieved.fa');

By default, the output file Dmel_chr4_retrieved.fa contains the actual sequence of the reference used to build the index.

You can also get summary information about the reference name and lengths instead of the actual sequence.

Create an options object.

inspectOpt = Bowtie2InspectOptions;

Set the Summary property to true.

inspectOpt.Summary = true;

Run the function again using the specified option.

flag = bowtie2inspect('Dmel_chr4', 'Dmel_chr4_summary.fa',inspectOpt);

If the index inspection is successful, the function returns 0, and the output file now contains summary information of the reference sequence.

Alternatively, you can pass in a Bowtie 2 syntax string instead of using the option object.

flag = bowtie2inspect('Dmel_chr4', 'Dmel_chr4_summary2.fa','-s');


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

Version History

Introduced in R2018a