bowtie2-build {Rbowtie2} | R Documentation

## Interface to bowtie2-build of bowtie2-2.2.3

### Description

This function can be use to call wrapped `bowtie2-build` binary

### Usage

    bowtie2_build(references, bt2Index, ..., overwrite = FALSE)

### Arguments

`references` | `Character` vector. The path to the files containing the references for which to build a bowtie index.
`bt2Index` | `Character` scalar. Write bowtie2 index data to files with this prefix: 'dir/basename'. If the files with path like 'dir/basename.*.bt2' already exists, the function function will cast an error, unless argument overwrite is `TRUE`.
`...` | Additional arguments to be passed on to the binaries. See below for details.
`overwrite` | `Logical`. Force overwriting of existing files if setting `TRUE`.

### Details

All additional arguments in ... are interpreted as additional parameters to be passed on to bowtie2_build. All of them should be `Character` or `Numeric` scalar. You can put all aditional arguments in one `Character`(e.g. "–threads 8 –quiet") with white space splited just like command line, or put them in different `Character`(e.g. "–threads","8","–quiet"). See the output of `bowtie2_build_usage()` for details about available parameters.

### Value

An invisible `Integer` of call status. The value is 0 when there is not any mistakes Otherwise the value is non-zero.

### Author(s)

Zheng Wei

### References

Langmead, B., & Salzberg, S. L. (2012). Fast gapped-read alignment with Bowtie 2. Nature methods, 9(4), 357-359.

### Examples

    td <- tempdir()
    ## Building a bowtie2 index
    refs <- dir(system.file(package="Rbowtie2", "extdata", "bt2","refs"),
    full=TRUE)
    cmdout<-bowtie2_build(references=refs, bt2Index=file.path(td, "lambda_virus"),
    "--threads 4 --quiet",overwrite=TRUE);cmdout
    ## Use additional arguments in another way
    cmdout<-bowtie2_build(references=refs, bt2Index=file.path(td, "lambda_virus"),
    "--threads",4,"--quiet",overwrite=TRUE);cmdout
    ## The function will print the output
    ## during the process without "--quiet" argument.
    cmdout<-bowtie2_build(references=refs, bt2Index=file.path(td, "lambda_virus"),
    overwrite=TRUE);cmdout

[Package Rbowtie2 version 1.14.0 Index]