Skip to content

[Bioc-devel] could bsseq::data.frame2GRanges be added to GenomicRanges

11 messages · Hector Corrada Bravo, Tim Triche, Jr., Michael Lawrence +3 more

#
+1

--t
#
For any tabular data structure with "chr[om]" and one or more of starts, ends, widths, and strands, there _is_ an obvious mapping, though!  And I personally always have an optional argument to keep the rest as mcols(). It just seems so straightforward. 

The generic granges() method also suggests that people often want a way for  something that is not itself a GRanges to at least emit one. 

granges(foo) is also a lot easier than 

with(foo, GRanges(fairly,
                               Involved(),
                               Constructor,
                               ...)

It would be nice if everything were a bed, wig, BAM or similar. Then rtracklayer would be all anyone needs. But, sometimes in the course of events, an unenlightened soul will have their library emit a table of coordinates bearing information that would be more useful as a GRanges. Given the frequency with which this occurs, it's nice to have that generic. 

Anyways, this is all your fault!  If you hadn't built such a marvelously useful data structure, people wouldn't want to use it in ways you never intended. :-)

No good deed goes unpunished,

--t
#
Hi,

+1 from me, too ... I've also had a similar conversion function
(data.[frame|table] <--> GRanges) in my toolbelt which I found quite
useful over the years.

-steve

On Sun, Oct 6, 2013 at 5:00 PM, Kasper Daniel Hansen
<kasperdanielhansen at gmail.com> wrote:

  
    
1 day later
#
Hi GRangers,

I'll add this to GenomicRanges. Hope you don't mind if I rename
it makeGRangesFromDataFrame(). This is more consistent
with the current naming scheme for "specialized constructors"
e.g.:

   makeTranscriptDbFrom*()
   makeGRangesListFromFeatureFragments()
   readGAlignment*FromBam()
   etc...

I'll add some flexibility to let the user choose the columns to
import (we sometimes see start/stop instead of start/end), but by
default it'll do what bsseq::data.frame2GRanges currently does.

'keepColumns' and 'ignoreStrand' will become 'keep.columns' and
'ignore.strand'.

H.
On 10/07/2013 11:01 AM, Tim Triche, Jr. wrote: