The pairwiseAlignment() function have a problematic way of handling empty sequences illustrated by this toy example:
library(Biostrings)
seq1 <- DNAString('ATCG')
seq2 <- DNAString('')
tmp <- pairwiseAlignment(seq1, seq2)
class(tmp)
[1] "PairwiseAlignmentsSingleSubject"
attr(,"package")
[1] "Biostrings"
tmp
Global PairwiseAlignmentsSingleSubject (1 of 1)
Error in rep(" ", patternSpaces) : invalid 'times' argument
In addition: Warning message:
In function (object) : NaNs produced
My inituition would be that pairwiseAlignment it simply repported no overlap and a score of NA.
Btw this error crashes RStudio-
Hi Kristoffer,
This error crashes my R session (and I'm not using RStudio, just R at the Unix command line in a terminal). Will investigate. Thanks for the report.
H.