trimAdapter: Remove 3' adapter contamination

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/trimAdapter.R

Description

Function to remove 3' adapter contamination from reads

Usage

1
2
trimAdapter(fq, adapter, match.score = 1, mismatch.score = -1,
            score.threshold = 2)

Arguments

fq

Object of class ShortReadQ; the reads with possible adapter contamination.

adapter

object of class DNAString or class character; the sequence of the 3' adapter which could give rise to the 3' contamination. If of class character, it is converted to a DNAString inside the function.

match.score

numeric; alignment score for matching bases

mismatch.score

numeric; alignment score for mismatches

score.threshold

numeric; minimum total alignment score required for an overlap match between the 3' end of the read and the 5' end of the adapter sequence.

Details

Performs an overlap alignment between the ends of the reads and the start of the adapter sequence.

Value

An object of class ShortReadQ containing the reads without the 3' adapter contamination.

Note

The function trimLRPatterns from package ShortRead may be a faster alternative to this function.

Author(s)

J. Toedling

See Also

pairwiseAlignment, narrow, readFastq, writeFastq

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  exDir <- system.file("extdata", package="girafe")
  ## load reads containing adapter fragments at the end
  ra23.wa  <- readFastq(dirPath=exDir, pattern=
              "aravinSRNA_23_plus_adapter_excerpt.fastq")
  table(width(ra23.wa))
  # adapter sequence obtained from GEO page
  #  accession number: GSE10364
  #adapter <- DNAString("CTGTAGGCACCATCAAT")
  adapter <- "CTGTAGGCACCATCAAT"

  # trim adapter
  ra23.na  <- trimAdapter(ra23.wa, adapter)
  table(width(ra23.na))

girafe documentation built on Nov. 8, 2020, 4:56 p.m.