[Bioc-devel] coverage,GenomicRanges interpretation of 'weight'
Cook, Malcolm
MEC at stowers.org
Thu Feb 23 20:13:54 CET 2012
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.
My workaround is to convert to RangedData for the computation. Definitely not urgent.
Malcolm Cook
More information about the Bioc-devel
mailing list