trimSeqs: Trim sequences from a specific side.

Description Usage Arguments Value Note See Also Examples

View source: R/hiReadsProcessor.R

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

1
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.

Note

If side is left, then any sequence following end of coords+offBy is returned. If side is right, then sequence preceding start of coords-offBy is returned. If side is middle, then sequence contained in coords is returned where offBy is added to start and subtracted from end in coords.

See Also

extractSeqs, primerIDAlignSeqs

Examples

1
2
3
4
5
6
7
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")

hiReadsProcessor documentation built on Nov. 8, 2020, 5:43 p.m.