run_bowtie2: Run the Bowtie2

Description Usage Arguments Value Examples

View source: R/run_bowtie2.R

Description

Runs the Bowtie2 tool

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
run_bowtie2(
  mate1 = mate1,
  mate2 = NULL,
  index = NULL,
  sample.name = NULL,
  out.dir = NULL,
  threads = 10,
  end2end = FALSE,
  sensitive = FALSE,
  parallel = FALSE,
  cores = 4,
  bowtie2 = NULL,
  version = FALSE
)

Arguments

mate1

List of the paths to files containing to the forward reads

mate2

List of the paths to files containing to the reverse reads

index

Path to the reference genome index

sample.name

List of the sample names

out.dir

Name of the directory from the Bowtie2 output

threads

Number of threads for stringtie to use, default set to 10

end2end

Select presets for end to end alignments

sensitive

Select the very sensitive preset

parallel

Run in parallel, default set to FALSE

cores

Number of cores/threads to use for parallel processing, default set to 4

bowtie2

Path to the Bowtie2 program

version

Returns the version number

Value

A list with the Bowtie2 commands

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
28
29
30
31
## Not run: 
path <- "/software/bowtie_v2-2.3.5.1/bowtie2"

bowtie2.version <- run_bowtie2(bowtie2 = path,
                               version = TRUE)
bowtie2.version[1]

out <- "bowtie2_alignments"
trimmed_reads_dir <- "trimmed_reads"

mate1 <- list.files(path = trimmed_reads_dir,
                    pattern = "*_R1_001.fastq$",
                    full.names = TRUE)
mate2 <- list.files(path = trimmed_reads_dir,
                   pattern = "*_R2_001.fastq$",
                   full.names = TRUE)
sample.names <- unlist(lapply(strsplit(list.files(path = trimmed_reads_dir,
                                                  pattern = "*_R1_001.fastq$",
                                                  full.names = FALSE),"_"), `[[`, 1))
index <- "/export/jessie3/gmh5n/BactoCap/JoHalliday/Project1543/MLSTReference/MLST"

bowtie2.cmds <- run_bowtie2(mate1 = mate1,
                            mate2 = mate2,
                            index = index,
                            out.dir = out,
                            sample.name = sample.names,
                            bowtie2 = path,
                            version = FALSE)
bowtie2.cmds

## End(Not run)

GrahamHamilton/pipelineTools documentation built on June 19, 2021, 1:08 p.m.