Description Usage Arguments Value Note See Also Examples
View source: R/hiReadsProcessor.R
Align a fixed length short pattern sequence (i.e. primers or adaptors) to subject sequences using pairwiseAlignment
. This function uses default of type="overlap", gapOpening=-1, and gapExtension=-1 to align the patternSeq against subjectSeqs. One can adjust these parameters if prefered, but not recommended. This function is meant for aligning a short pattern onto large collection of subjects. If you are looking to align a vector sequence to subjects, then please use BLAT or see one of following blatSeqs
, findAndRemoveVector
1 2 3 4 5 6 7 8 9 10 11 12 13 |
subjectSeqs |
DNAStringSet object containing sequences to be searched for the pattern. This is generally bigger than patternSeq, and cases where subjectSeqs is smaller than patternSeq will be ignored in the alignment. |
patternSeq |
DNAString object or a sequence containing the query sequence to search. This is generally smaller than subjectSeqs. |
side |
which side of the sequence to perform the search: left, right or middle. Default is 'left'. |
qualityThreshold |
percent of patternSeq to match. Default is 1, full match. |
showStats |
toggle output of search statistics. Default is FALSE. |
bufferBases |
use x number of bases in addition to patternSeq length to perform the search. Beneficial in cases where the pattern has homopolymers or indels compared to the subject. Default is 5. Doesn't apply when side='middle'. |
doRC |
perform reverse complement search of the defined pattern. Default is TRUE. |
returnUnmatched |
return sequences which had no or less than 5% match to the patternSeq. Default is FALSE. |
returnLowScored |
return sequences which had quality score less than the defined qualityThreshold. Default is FALSE. |
parallel |
use parallel backend to perform calculation with
|
... |
extra parameters for |
IRanges object with starts, stops, and names of the aligned sequences.
If returnLowScored or returnUnmatched = T, then a CompressedIRangesList where x[["hits"]] has the good scoring hits, x[["Rejected"]] has the failed to match qualityThreshold hits, and x[["Absent"]] has the hits where the aligned bit is <=10% match to the patternSeq.
For qualityThreshold, the alignment score is calculated by (matches*2)-(mismatches+gaps) which programatically translates to round(nchar(patternSeq)*qualityThreshold)*2.
Gaps and mismatches are weighed equally with value of -1 which can be overriden by defining extra parameters 'gapOpening' & 'gapExtension'.
If qualityThreshold is 1, then it is a full match, if 0, then any match is accepted which is useful in searching linker sequences at 3' end. Beware, this function only searches for the pattern sequence in one orientation. If you are expecting to find the pattern in both orientation, you might be better off using BLAST/BLAT!
If parallel=TRUE, then be sure to have a parallel backend registered
before running the function. One can use any of the following
MulticoreParam
SnowParam
primerIDAlignSeqs
, vpairwiseAlignSeqs
,
doRCtest
, findAndTrimSeq
, blatSeqs
,
findAndRemoveVector
1 2 3 4 5 6 7 | subjectSeqs <- c("CCTGAATCCTGGCAATGTCATCATC", "ATCCTGGCAATGTCATCATCAATGG",
"ATCAGTTGTCAACGGCTAATACGCG", "ATCAATGGCGATTGCCGCGTCTGCA",
"CCGCGTCTGCAATGTGAGGGCCTAA", "GAAGGATGCCAGTTGAAGTTCACAC")
subjectSeqs <- DNAStringSet(xscat("AAAAAAAAAA", subjectSeqs))
pairwiseAlignSeqs(subjectSeqs, "AAAAAAAAAA", showStats=TRUE)
pairwiseAlignSeqs(subjectSeqs, "AAATAATAAA", showStats=TRUE,
qualityThreshold=0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.