[Bioc-devel] coverage,GenomicRanges interpretation of 'weight'

Hervé Pagès hpages at fhcrc.org
Thu Feb 23 22:41:11 CET 2012

Hi Malcolm,

On 02/23/2012 11:13 AM, Cook, Malcolm wrote:
> It would be great I think if coverage,GenomicRanges  interpetation of 'weight' would be similar to that for RangedData
> 	For 'RangedData' objects, this can also be a single string naming a column to be used as the weights.
> In the case for coverage,GenomicRanges  we would want to weigh by any attribute (i.e. score) in the values DataTable.
> is this reasonable?
> I like being able to refer symbolically as provided by RangedData.  It allows me to write, for instance, this utility function:
> coverageByStrand<-function(x,...){
>    ## PURPOSE: compute the coverage of x, split by 'strand'.
>    ## RETURNS: a list of SimpleRLEList (by chromosome)
>    res<-lapply(split(x,strand(x)),coverage,...)
> }
> which I can then use as
> someStrandedCoverage<-coverageByStrand(someStrandedFeaturesAsGenomicRanges,weight='theDataTableAttributeHoldingSomeWeightFactor')
> Otherwise I would have to test for the presence of a weight attribute and split it by strand, and use mapply instead, etc....
> Regardless of the merits, having the interface to coverage be similar between RangedData and GenomicRanges is arguably desirable.

Sounds good to me. Done in GenomicRanges 1.7.27.


> My workaround is to convert to RangedData for the computation.  Definitely not urgent.
> Malcolm Cook
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel

Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319

More information about the Bioc-devel mailing list