Hi all!
I was puzzled by an error message I got in Gviz
adding an AlignmentsTrack
representing RNA-seq data:
Error in .Call(.NAME, ..., PACKAGE = PACKAGE) : negative length vectors are not allowed
After looking through some code and testing stuff I got to the root of the problem, the sequenceLayer
function in GenomicAlignments
. To me it looks like there is a pointer problem or something similar in the C-code of that function (an index exceeding the maximal representable number?). Now, my question is, whether this can be fixed in the C-code, or whether I have to find a workaround to identify such cases and eventually down-sample reads in such cases.
The error can be reproduced with the following code:
library(GenomicAlignments) Seq <- DNAStringSet("GGTTGACATATGGAGCATAGCCAATAAATCCTCCTGAATTCAGATAGCGTTTCCCAATGTGCACAACAGGATACTTGTCTGCTAGTCTTTTATCTGGCCA") Cig <- "30M3640N70M" ## That works tmp <- sequenceLayer(rep(Seq, 500000), rep(Cig, 500000)) ## Failure: tmp <- sequenceLayer(rep(Seq, 700000), rep(Cig, 700000)) Error in .Call(.NAME, ..., PACKAGE = PACKAGE) : negative length vectors are not allowed
Any help appreciated
cheers, jo
My R/session:
> sessionInfo() R version 3.2.2 (2015-08-14) Platform: x86_64-apple-darwin15.0.0/x86_64 (64-bit) Running under: OS X 10.11.2 (El Capitan) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats4 parallel stats graphics grDevices utils datasets [8] methods base other attached packages: [1] GenomicAlignments_1.6.1 Rsamtools_1.22.0 [3] Biostrings_2.38.0 XVector_0.10.0 [5] SummarizedExperiment_1.0.1 Biobase_2.30.0 [7] GenomicRanges_1.22.1 GenomeInfoDb_1.6.1 [9] IRanges_2.4.1 S4Vectors_0.8.2 [11] BiocGenerics_0.16.1 loaded via a namespace (and not attached): [1] bitops_1.0-6 futile.options_1.0.0 zlibbioc_1.16.0 [4] futile.logger_1.4.1 BiocParallel_1.4.0 lambda.r_1.1.7
Hi Jo,
Thanks for providing such a concise reproducible example. That helps a lot. Looks like an int overflow. I'm currently looking at this and will let you know once I have a fix.
H.