run_bowtie2: Run the Bowtie2

View source: R/run_bowtie2.R

run_bowtie2R Documentation

Run the Bowtie2

Description

Runs the Bowtie2 tool

Usage

run_bowtie2(
  input1 = NULL,
  input2 = NULL,
  index = NULL,
  sample.name = NULL,
  out.dir = NULL,
  threads = 10,
  end2end = FALSE,
  sensitive = FALSE,
  parallel = FALSE,
  cores = 4,
  execute = TRUE,
  bowtie2 = NULL,
  version = FALSE
)

Arguments

input1

List of the paths to files containing to the forward reads

input2

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 Bowtie2 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

execute

Whether to execute the commands or not, default set to TRUE

bowtie2

Path to the Bowtie2 program

version

Returns the version number

Value

A list with the Bowtie2 commands

Examples

## 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(input1 = mate1,
                            input2 = mate2,
                            index = index,
                            out.dir = out,
                            sample.name = sample.names,
                            bowtie2 = path,
                            version = FALSE)
bowtie2.cmds

## End(Not run)


GrahamHamilton/pipelineTools documentation built on Dec. 8, 2024, 3:53 p.m.