Biostrings icon indicating copy to clipboard operation
Biostrings copied to clipboard

[Bug] Overflow causes weird error message in `xscat`

Open ahl27 opened this issue 9 months ago • 0 comments

XString_xscat seems to rely on int types. Passing in a value larger than the maximum size of an unsigned int will cause a confusing error message about negative-length vectors. Function should probably check for overflow and report a better error message.

library(Biostrings)
x <- paste(sample(DNA_BASES, 2^30, replace=TRUE), collapse="") # works with 2^30 - 1
x <- DNAString(x)
x <- xscat(x, x)
## Error in .Call2("XString_xscat", args, PACKAGE = "Biostrings") : 
##  negative length vectors are not allowed

ahl27 avatar Apr 10 '25 20:04 ahl27