Skip to content
Prev 5680 / 21312 Next

[Bioc-devel] [BioC] granges() method for GenomicRanges objects akin to ranges()...

Hi Tim,

I was looking for a similar function a while ago, and created the 
'grangesPlain' function in 'SomaticSignatures':

grangesPlain <-
function (x)
{
     mcols(x) = NULL
     x = as(x, "GRanges")
     return(x)
}

It removes the metadata columns, as Michael described.  Further, it 
performs an explicit conversion to a 'GRanges' object - in case that 'x' 
has a derived class like a 'VRanges'.

The main motivation for an extra function is that you can use it inline, e.g

resize(sort(grangesPlain(x)), ...)

works.  It would be great to have such functionality as part of the bioc 
core.

Best wishes
Julian
On 05.05.2014 01:56, Michael Lawrence wrote: