Question: Future plans for the new GPos class
gravatar for maltethodberg
10 months ago by
maltethodberg100 wrote:

In continuation of my previous question (, I was wondering about the the plans for the new GPos class. I can see it has already been added to vignette, but also that it is currently being actively worked on (along with the underlying IPos object), with one of the updates breaking using the coverage-function on GPos objects.

Both in relation to daily use and package development, would you suggest jumping on board and using the new GPos class right away, or wait a bit until functions are more stable? Is the long term plan still to have GPos extend the GenomicRanges class, keeping all existing functions compatible?

ADD COMMENTlink modified 10 months ago by Hervé Pagès ♦♦ 13k • written 10 months ago by maltethodberg100
gravatar for Hervé Pagès
10 months ago by
Hervé Pagès ♦♦ 13k
United States
Hervé Pagès ♦♦ 13k wrote:


Thanks for letting us know about coverage() being broken on GPos objects. Will fix this. No particular plans for these objects except that at some point we're planning to support long GPos objects (i.e. objects that contain more than 2^31-1 positions). GPos is not being actively worked on anymore. Should be ready to use. Please let us know if you run into other issues with GPos objects. Thanks!


PS: The link to your previous question is invalid.

ADD COMMENTlink modified 10 months ago • written 10 months ago by Hervé Pagès ♦♦ 13k

This is fixed in GenomicRanges 1.31.12 (BioC devel only):

Should become available to BioC devel users via biocLite() in about 24 hours.



ADD REPLYlink modified 9 months ago • written 9 months ago by Hervé Pagès ♦♦ 13k

Just had look at this again: `coverage` now works on GPos-objects, but the "weight" argument behaves differently. It fails when trying to use a column as weights:

pos_runs <- GRanges(c("chr1", "chr1", "chr2"),
                                        IRanges(c(1, 5, 9), c(10, 8, 15)))
score(pos_runs) <- 1:length(pos_runs)
gpos <- GPos(pos_runs)
coverage(gpos) # Works
coverage(gpos, weight="score") # Fails

Is there any plan of changing this to more closely match the behaviour on GRanges?

ADD REPLYlink modified 7 months ago • written 7 months ago by maltethodberg100

No plans to support this in the immediate future. I'm putting this on the TODO list and will get to it after the BioC 3.7 release (scheduled for May 1st). In the mean time, you can work around this by coercing to GRanges first. I recognize that this defeats the purpose of using a GPos object in the first place but note that supporting an arbitrary weight vector when calling coverage() on a GPos object will blow memory footprint in general (in the worst case scenario the returned object will contain 1 double + 1 integer per position in the GPos object so will be even bigger in memory than the GRanges object obtained by the coercion).


ADD REPLYlink modified 7 months ago • written 7 months ago by Hervé Pagès ♦♦ 13k
Please log in to add an answer.


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