bbtrim: Trim primers using BBDuk

View source: R/bbmap_utilities.R

bbtrimR Documentation

Trim primers using BBDuk

Description

Trim primers using BBDuk

Usage

bbtrim(
  install = NULL,
  fwd,
  rev = NULL,
  primers,
  checkpairs = FALSE,
  restrictleft = NULL,
  out.dir = "bbduk",
  trim.end = "left",
  ordered = TRUE,
  kmer = NULL,
  mink = FALSE,
  tbo = TRUE,
  tpe = TRUE,
  hdist = 0,
  degenerate = TRUE,
  force = TRUE,
  quality = FALSE,
  maxlength = NULL,
  tmp = NULL,
  quiet = FALSE
)

Arguments

install

(Required) Install location for bbmap

fwd

(Required) Vector of locations of forward reads

rev

(Optional) Vector of locations of reverse reads

primers

(Required) Forward and reverse primers to trim

checkpairs

(Optional) Whether paired end checking should be conducted

restrictleft

(Optional) Defaults to the size of the largest primer. Restricts the kmer search for primer sequences to just the left side of the molecule.

out.dir

(Optional) Default "trimmed" The path to write the output reads.

trim.end

(Optional) Default is "left" End of the molecule to trim primers from. "left" will trim primers from the 3' end of both forward and reverse reads. Change to "right" only if the amplicon was too short and the sequencer has read into the other end of the molecule.

ordered

(Optional) Default TRUE Set to TRUE to output reads in same order as input.

kmer

(Optional) default the size of the smallest primer will be used. The kmer size to use for primer searching.

mink

(optional) Default FALSE Look for shorter kmers at read tips down to this length

tpe

(Otional) Default TRUE Trim pairs evenly. When kmer right-trimming, trim both reads to the minimum length of either.

hdist

(Optional) Default 0. The hamming distance (number of substitution errors) allowed for mismatch to the query primer.

degenerate

(Optional) Default TRUE. Option to search for all possible primer combinations for degenerate primers

force

(Optional) Default TRUE Option to overwrite existing output files.

quality

(Optional) Default FALSE Output quality statistics from trimming including: Base composition histogram by position, Quality histogram by position, Count of bases with each quality value, Histogram of average read quality, Read length histogram and Read GC content histogram.

maxlength

(Optional) Default FALSE Remove all reads above a maximum length. Useful for removing reads where no primers were found.

Examples

## Not run: 
path <- "run_test/"

fastqFs <- sort(list.files(path, pattern="R1_001.*", full.names = TRUE))
fastqRs <- sort(list.files(path, pattern="R2_001.*", full.names = TRUE))

bbtrim(install="bin/bbmap", fwd=fastqFs, rev=fastqRs,
primers=c("GGDACWGGWTGAACWGTWTAYCCHCC","GTRATWGCHCCDGCTARWACWGG"),
 degenerate=TRUE, out.dir="trimmed", ktrim="left", ordered=TRUE,
  mink=FALSE, hdist=2, maxlength=140, force=TRUE)

## End(Not run)

alexpiper/seqateurs documentation built on July 9, 2023, 7:21 a.m.