Learn R Programming

hiReadsProcessor (version 1.8.2)

trimSeqs: Trim sequences from a specific side.

Description

This function trims a DNAStringSet object using the ranges from left, right, or middle of the sequence. This is a helper function utilized in primerIDAlignSeqs and extractSeqs. If dnaSet and coords are not the same length, then they are required to have a names attribute to perform the matched trimming.

Usage

trimSeqs(dnaSet, coords, side = "middle", offBy = 0)

Arguments

dnaSet
DNAStringSet object containing sequences to be trimmed.
coords
IRanges object containing boundaries.
side
either 'left','right',or the Default 'middle'.
offBy
integer value dictating if the supplied coordinates should be offset by X number of bases. Default is 0.

Value

  • a DNAStringSet object with trimmed sequences.

See Also

extractSeqs, primerIDAlignSeqs

Examples

Run this code
dnaSet <- DNAStringSet(c("AAAAAAAAAACCTGAATCCTGGCAATGTCATCATC",
"AAAAAAAAAAATCCTGGCAATGTCATCATCAATGG", "AAAAAAAAAAATCAGTTGTCAACGGCTAATACGCG",
"AAAAAAAAAAATCAATGGCGATTGCCGCGTCTGCA", "AAAAAAAAAACCGCGTCTGCAATGTGAGGGCCTAA",
"AAAAAAAAAAGAAGGATGCCAGTTGAAGTTCACAC"))
coords <- IRanges(start=1, width=rep(10,6))
trimSeqs(dnaSet, coords, side="left", offBy=1)
trimSeqs(dnaSet, coords, side="middle")

Run the code above in your browser using DataLab