trimAdapter {girafe} | R Documentation |
Function to remove 3' adapter contamination from reads
trimAdapter(fq, adapter, match.score = 1, mismatch.score = -1, score.threshold = 2)
fq |
Object of class |
adapter |
object of class |
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. |
Performs an overlap alignment between the ends of the reads and the start of the adapter sequence.
An object of class ShortReadQ
containing the reads without the
3' adapter contamination.
The function trimLRPatterns
from package ShortRead
may
be a faster alternative to this function.
J. Toedling
pairwiseAlignment
,
narrow
,
readFastq
,
writeFastq
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))