Export a BigWig with rtracklayer
1
0
Entering edit mode
Dario Strbenac ★ 1.5k
@dario-strbenac-5916
Last seen 5 hours ago
Australia
Hello, I'm having trouble exporting a real-sized BigWig file. It is of hg18 with a score every 20 bases on the 25 real chromosomes. It was created from reading in two different BigWig files, then subtracting their scores : score(bws[[1]]) <- score(bws[[2]]) - score(bws[[1]]) then export.bw(bws[[1]], filename, "bedGraph", seqlengths(Hsapiens)[1:25]) After some minutes, I get the error message Error: serialization is too large to store in a raw vector I also tried "auto" for dataFormat. If importing then exporting a single BigWig without any modifications to its data, the code works. What is a better technique ? -------------------------------------- Dario Strbenac Research Assistant Cancer Epigenetics Garvan Institute of Medical Research Darlinghurst NSW 2010 Australia
• 3.3k views
ADD COMMENT
0
Entering edit mode
@michael-lawrence-3846
Last seen 3.0 years ago
United States
On Mon, Apr 9, 2012 at 10:00 PM, Dario Strbenac <d.strbenac@garvan.org.au>wrote: > Hello, > > I'm having trouble exporting a real-sized BigWig file. It is of hg18 with > a score every 20 bases on the 25 real chromosomes. It was created from > reading in two different BigWig files, then subtracting their scores : > > score(bws[[1]]) <- score(bws[[2]]) - score(bws[[1]]) > > then > > export.bw(bws[[1]], filename, "bedGraph", seqlengths(Hsapiens)[1:25]) > > After some minutes, I get the error message > Error: serialization is too large to store in a raw vector > > I also tried "auto" for dataFormat. If importing then exporting a single > BigWig without any modifications to its data, the code works. > > What is a better technique ? > > Could you please paste the output of sessionInfo()? It looks like you're using an older version of rtracklayer, which is very likely broken somehow. Thanks, Michael -------------------------------------- > Dario Strbenac > Research Assistant > Cancer Epigenetics > Garvan Institute of Medical Research > Darlinghurst NSW 2010 > Australia > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
I have the latest versions now, but I get a new error message. > summary(bws[[1]]) Length Class Mode 25 RangedData S4 > bws[[1]] RangedData with 154014720 rows and 1 value column across 25 spaces space ranges | score <factor> <iranges> | <numeric> 1 chr1 [ 1, 20] | 0.04206303 2 chr1 [ 21, 40] | 0.04206303 ... ... ... ... ... > export.bw(bws[[1]], filename) Error in export(rd, con, "BigWig", ...) : error in evaluating the argument 'object' in selecting a method for function 'export': Error: object 'rd' not found > sessionInfo() R version 2.15.0 (2012-03-30) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_AU.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_AU.UTF-8 LC_COLLATE=en_AU.UTF-8 [5] LC_MONETARY=en_AU.UTF-8 LC_MESSAGES=en_AU.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] parallel stats graphics grDevices utils datasets methods [8] base other attached packages: [1] BSgenome.Hsapiens.UCSC.hg18_1.3.17 BSgenome_1.24.0 [3] Biostrings_2.24.1 rtracklayer_1.16.0 [5] GenomicRanges_1.8.3 IRanges_1.14.2 [7] BiocGenerics_0.2.0 loaded via a namespace (and not attached): [1] bitops_1.0-4.1 RCurl_1.91-1 Rsamtools_1.8.0 stats4_2.15.0 [5] tools_2.15.0 XML_3.9-4 zlibbioc_1.2.0 ---- Original message ---- >Date: Tue, 10 Apr 2012 07:07:20 -0700 >From: Michael Lawrence <lawrence.michael at="" gene.com=""> >Subject: Re: [BioC] Export a BigWig with rtracklayer >To: D.Strbenac at garvan.org.au >Cc: bioconductor at r-project.org > > On Mon, Apr 9, 2012 at 10:00 PM, Dario Strbenac > <d.strbenac at="" garvan.org.au=""> wrote: > > Hello, > > I'm having trouble exporting a real-sized BigWig > file. It is of hg18 with a score every 20 bases on > the 25 real chromosomes. It was created from > reading in two different BigWig files, then > subtracting their scores : > > score(bws[[1]]) <- score(bws[[2]]) - > score(bws[[1]]) > > then > > export.bw(bws[[1]], filename, "bedGraph", > seqlengths(Hsapiens)[1:25]) > > After some minutes, I get the error message > Error: serialization is too large to store in a > raw vector > > I also tried "auto" for dataFormat. If importing > then exporting a single BigWig without any > modifications to its data, the code works. > > What is a better technique ? > > Could you please paste the output of sessionInfo()? > It looks like you're using an older version of > rtracklayer, which is very likely broken somehow. > ? > Thanks, > Michael > > -------------------------------------- > Dario Strbenac > Research Assistant > Cancer Epigenetics > Garvan Institute of Medical Research > Darlinghurst NSW 2010 > Australia > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD REPLY
0
Entering edit mode
On Tue, Apr 10, 2012 at 7:00 PM, Dario Strbenac <d.strbenac@garvan.org.au>wrote: > I have the latest versions now, but I get a new error message. > > > summary(bws[[1]]) > Length Class Mode > 25 RangedData S4 > > bws[[1]] > RangedData with 154014720 rows and 1 value column across 25 spaces > space ranges | score > <factor> <iranges> | <numeric> > 1 chr1 [ 1, 20] | 0.04206303 > 2 chr1 [ 21, 40] | 0.04206303 > ... ... ... ... ... > > export.bw(bws[[1]], filename) > Error in export(rd, con, "BigWig", ...) : > error in evaluating the argument 'object' in selecting a method for > function 'export': Error: object 'rd' not found > Ouch, stupid typo, and somehow missed that unit test. Fixed in 1.16.1 (and devel). You can work around it by simply using export() instead of export.bw, as long as your file extension is "bw" or "bigWig" (case insensitive). Otherwise, pass format="bw" to export(). > > sessionInfo() > R version 2.15.0 (2012-03-30) > Platform: x86_64-unknown-linux-gnu (64-bit) > > locale: > [1] LC_CTYPE=en_AU.UTF-8 LC_NUMERIC=C > [3] LC_TIME=en_AU.UTF-8 LC_COLLATE=en_AU.UTF-8 > [5] LC_MONETARY=en_AU.UTF-8 LC_MESSAGES=en_AU.UTF-8 > [7] LC_PAPER=C LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] parallel stats graphics grDevices utils datasets methods > [8] base > > other attached packages: > [1] BSgenome.Hsapiens.UCSC.hg18_1.3.17 BSgenome_1.24.0 > [3] Biostrings_2.24.1 rtracklayer_1.16.0 > [5] GenomicRanges_1.8.3 IRanges_1.14.2 > [7] BiocGenerics_0.2.0 > > loaded via a namespace (and not attached): > [1] bitops_1.0-4.1 RCurl_1.91-1 Rsamtools_1.8.0 stats4_2.15.0 > [5] tools_2.15.0 XML_3.9-4 zlibbioc_1.2.0 > > ---- Original message ---- > >Date: Tue, 10 Apr 2012 07:07:20 -0700 > >From: Michael Lawrence <lawrence.michael@gene.com> > >Subject: Re: [BioC] Export a BigWig with rtracklayer > >To: D.Strbenac@garvan.org.au > >Cc: bioconductor@r-project.org > > > > On Mon, Apr 9, 2012 at 10:00 PM, Dario Strbenac > > <d.strbenac@garvan.org.au> wrote: > > > > Hello, > > > > I'm having trouble exporting a real-sized BigWig > > file. It is of hg18 with a score every 20 bases on > > the 25 real chromosomes. It was created from > > reading in two different BigWig files, then > > subtracting their scores : > > > > score(bws[[1]]) <- score(bws[[2]]) - > > score(bws[[1]]) > > > > then > > > > export.bw(bws[[1]], filename, "bedGraph", > > seqlengths(Hsapiens)[1:25]) > > > > After some minutes, I get the error message > > Error: serialization is too large to store in a > > raw vector > > > > I also tried "auto" for dataFormat. If importing > > then exporting a single BigWig without any > > modifications to its data, the code works. > > > > What is a better technique ? > > > > Could you please paste the output of sessionInfo()? > > It looks like you're using an older version of > > rtracklayer, which is very likely broken somehow. > > > > Thanks, > > Michael > > > > -------------------------------------- > > Dario Strbenac > > Research Assistant > > Cancer Epigenetics > > Garvan Institute of Medical Research > > Darlinghurst NSW 2010 > > Australia > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@r-project.org > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: > > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLY

Login before adding your answer.

Traffic: 567 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6