Rbowtie: Interface to bowtie2

Description Usage Arguments Details Value Author(s) References Examples

Description

The following functions can be used to call the bowtie2 and bowtie2-build binaries.

Usage

1
2
3
4
5
6
7
8
9
bowtie2_build(references, outdir, ..., prefix = "index", force = FALSE,
strict = TRUE)

bowtie2(sequences, index, ..., type = c("single", "paired", "crossbow"),
outfile, force = FALSE, strict = TRUE)

bowtie2_build_usage()

bowtie2_usage()

Arguments

references

Character vector. The path to the files containing the references for which to build a bowtie2 index.

outdir

Character scalar. The path to the output directory in which to store the bowtie2 index. If the directory already exists, the function function will cast an error, unless force==TRUE.

prefix

Character scalar. The prefix to use for the bowtie2 index files.

sequences

If type is either single or crossbow, a character vector of filenames if additional argument c==FALSE, otherwise a vector of read sequences. If type is paired, a list of filnames ore sequences of length 2, where the first list item corresponds to the fist mate pair sequences, and the second list item to the second mate pair sequences.

index

Character scalar. The path to the bowtie2 index and prefix to align against, in the form </path/to/index>/<prefix>.

type

Character scalar, one in c("single", "paired", "crossbow"). If single, the input sequences are interpreted as single reads. If paired, they are supposed to be mate pair reads and if crossbow, they are considered to be Crossbow-style reads.

outfile

Character scalar. A path to a files used for the alignment output. If missing, the alignments will be returned as a regular R character vector.

force

Logical. Force overwriting of outdir or outfile.

strict

Logical. Turn off strict checking of input arguments.

...

Additional arguments to be passed on to the binaries. See below for details.

Details

All additional arguments in ... are interpreted as additional parameters to be passed on to the binaries. For flags, those are supposed to be logicals (e.g., quiet=TRUE will be translated into --q, q=TRUE in -q, and so on). Parameters with additional input are supposed to be character or numeric vectors, where the individual vector elements are collapsed into a single comma-separated string (e.g., k=2 is translated into k 2, bmax=100 into --bmax 100, 3=letters[1:3] into -3 a,b,c, and so on). Note that some arguments to the bowtie2 binary will be ignored if they are already handled as explicit function arguments. See the output of bowtie2_usage() and bowtie2_build_usage() for details about available parameters.

Value

The output generated by calling the binaries. For bowtie2_build this is typically a report of the index generation, for bowtie2 this can be a vector of aligments (if outfile is missing), otherwise an empty character scalar.

bowtie2_usage() and bowtie2_build_usage() return the usage information for the respective binaries.

Author(s)

Anita Lerch

References

Langmead B, Trapnell C, Pop M, Salzberg SL. Ultrafast and memory-efficient alignment of short DNA sequences to the human genome. Genome Biology 10:R25.

Langmead B, Schatz M, Lin J, Pop M, Salzberg SL. Searching for SNPs with cloud computing. Genome Biology 10:R134.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
td <- tempdir()

## Building a bowtie2 index
refs <- dir(system.file(package="Rbowtie2", "samples", "refs"),
full=TRUE)
tmp <- bowtie2_build(references=refs, outdir=file.path(td, "index"),
force=TRUE)
head(tmp)
dir(file.path(td, "index"))
tmp2 <- bowtie2_build(references=refs, outdir=file.path(td,"indexColor"),
force=TRUE, C=TRUE)
dir(file.path(td, "indexColor"))
head(tmp2)


## Alignments
reads <- system.file(package="Rbowtie2", "samples", "reads",
"reads.fastq")
tmp <- bowtie2(sequences=reads, index=file.path(td, "index", "index"))
tmp
bowtie2(sequences=reads, index=file.path(td, "index", "index"),
outfile=file.path(td, "alignments.txt"), best=TRUE, force=TRUE)
readLines(file.path(td, "alignments.txt"))

bowtie2(sequences=list("TGGGTGGGGTATTCTAGAAATTTCTATTAATCCT",
                      "TCTGTTCAAGTCAGATGGTCACCAATCTGAAGAC"),
index=file.path(td, "index", "index"), type="paired", c=TRUE)

lerch-a/Rbowtie2 documentation built on May 21, 2019, 5:11 a.m.