Search
Question: sequenceLayer memory/C code problem?
1
gravatar for Johannes Rainer
2.0 years ago by
Johannes Rainer1.0k
Italy
Johannes Rainer1.0k wrote:

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      

 

 

ADD COMMENTlink modified 24 months ago by Hervé Pagès ♦♦ 13k • written 2.0 years ago by Johannes Rainer1.0k
1

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.

ADD REPLYlink written 24 months ago by Hervé Pagès ♦♦ 13k
3
gravatar for Hervé Pagès
24 months ago by
Hervé Pagès ♦♦ 13k
United States
Hervé Pagès ♦♦ 13k wrote:

The problem was actually in Biostrings::replaceAt(). Fixed in Biostring 2.38.2 (release) and 2.39.2 (devel).

Cheers,

H.

ADD COMMENTlink written 24 months ago by Hervé Pagès ♦♦ 13k

Great! Thanks!

ADD REPLYlink written 24 months ago by Johannes Rainer1.0k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 157 users visited in the last hour