[BioC] table for GenomicRanges

Hervé Pagès hpages at fhcrc.org
Thu Dec 6 01:31:54 CET 2012


So with tally, what would be the name of the metadata col? Would "tally"
be OK?

It's kind of neat to use the same name for the metadata col as for the
function itself. That makes the code more readable:

   mcols(count(gr))$count

Thanks for the feedback,
H.


On 12/05/2012 03:05 PM, Tim Triche, Jr. wrote:
> that goes along nicely with BamTally in gmapR, which is a damn useful
> function IMHO... actually I think I wrote a tally() function or
> something like it for Rsubread, can't remember whether I sent it in with
> the patch though.  Anyways, a running tally is a good mental image for
> this functionality
>
>
>
>
> On Wed, Dec 5, 2012 at 2:59 PM, Steve Lianoglou
> <mailinglist.honeypot at gmail.com <mailto:mailinglist.honeypot at gmail.com>>
> wrote:
>
>     Hi,
>
>     On Wed, Dec 5, 2012 at 5:50 PM, Michael Lawrence
>     <lawrence.michael at gene.com <mailto:lawrence.michael at gene.com>> wrote:
>      > The question is whether there is ever a use case to have a simple
>     table.
>      > This is analogous to base R's table and data.frame. For example,
>     if you
>      > call xtabs(), you get a table, then you have to call
>     as.data.frame to get
>      > back into the data.frame context. This is sort of clean, and we could
>      > create an extension of table that for efficiency stores the
>     associated
>      > GRanges along with the counts in the .Data slot. Then as(x,
>     "GRanges") on
>      > that would generate the GRanges with the count column. That would be
>      > complicated though.
>      >
>      > Another issue is that table() cannot be used in the general way,
>     due to
>      > restrictions on dispatch with "...".
>      >
>      > So I think I'm in favor of a new "count" generic. That naming is
>     consistent
>      > with countOverlaps, countSubjects, countQueries, etc.
>
>     Or maybe `tally`? Somehow I have a mental association w/ that being
>     closer to `tabulate`, but I guess it's really not and maybe it's just
>     me that has a mind map that puts `tally` closer to `table` than
>     `count` is .
>
>     --
>     Steve Lianoglou
>     Graduate Student: Computational Systems Biology
>       | Memorial Sloan-Kettering Cancer Center
>       | Weill Medical College of Cornell University
>     Contact Info: http://cbio.mskcc.org/~lianos/contact
>
>
>
>
> --
> /A model is a lie that helps you see the truth./
> /
> /
> Howard Skipper
> <http://cancerres.aacrjournals.org/content/31/9/1173.full.pdf>
>

-- 
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 Bioconductor mailing list