[Bioc-devel] seq*apply deprecation

Hervé Pagès hpages at fhcrc.org
Thu Jan 23 00:48:02 CET 2014


On 01/22/2014 03:02 PM, Michael Lawrence wrote:
>
>
>
> On Wed, Jan 22, 2014 at 1:29 PM, Hervé Pagès <hpages at fhcrc.org
> <mailto:hpages at fhcrc.org>> wrote:
>
>     Hi Michael,
>
>
>     On 01/12/2014 05:16 AM, Michael Lawrence wrote:
>
>         Hi,
>
>
>         It may be time to deprecate the seq*apply family of functions,
>         including
>         seqapply, mseqapply, tseqapply, seqby and seqsplit. These are
>         ancient
>         functions named in referece to the "Sequence" class, now called
>         "Vector".
>         It would seem better for the user to write: asList(lapply(...))
>         instead of
>         coming up with an alias for that. For readability, we should
>         probably
>         export asList() as an alias for as(x, "List"), which I just
>         cleaned up.
>
>
>     Sounds good to me.
>
>
>
>         There is one caveat though: mseqapply has been particularly
>         useful, because
>         it delegates to mapply_List, which is smart enough to handle any
>         vector
>         argument in "...". The mapply,List method of course restricts
>         everything to
>         List. We should probably export mapply_List, probably with a
>         better name.
>         Suggestions?
>
>
>     Why do we need all this?
>
>
> Neat. Presumably due to this patch:
>
> commit 42139699d91a34c401eedd36db62716a607d0b06
> Author: maechler <maechler at 00db46b3-68df-0310-9c12-caf00c1e9a41>
> Date:   Wed Nov 28 10:31:42 2012 +0000
>
>      mapply(F, <S4>) now works thanks to a version of Herve's patch
>
> We should do away with mapply_List now that this is part of released R.

Furthermore, maybe she should also remove the mapply() S4 generic from
the BiocGenerics package. It's not needed anymore. base::mapply() should
work out-of-the-box on any object for which length() and [[ are
implemented.

H.

>
>
>        x <- RleList(11:14, 3:1)
>
>     Then:
>
>        > IRanges:::mapply_List(__function(a, b) {a+b}, x, 10)
>        [[1]]
>        numeric-Rle of length 4 with 4 runs
>          Lengths:  1  1  1  1
>          Values : 21 22 23 24
>
>        [[2]]
>        numeric-Rle of length 3 with 3 runs
>          Lengths:  1  1  1
>          Values : 13 12 11
>
>     But also:
>
>        > base::mapply(function(a, b) {a+b}, x, 10)
>        [[1]]
>        numeric-Rle of length 4 with 4 runs
>          Lengths:  1  1  1  1
>          Values : 21 22 23 24
>
>        [[2]]
>        numeric-Rle of length 3 with 3 runs
>          Lengths:  1  1  1
>          Values : 13 12 11
>
>     What am I missing?
>
>     Thanks,
>     H.
>
>
>         Michael
>
>                  [[alternative HTML version deleted]]
>
>         _________________________________________________
>         Bioc-devel at r-project.org <mailto:Bioc-devel at r-project.org>
>         mailing list
>         https://stat.ethz.ch/mailman/__listinfo/bioc-devel
>         <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 <mailto:hpages at fhcrc.org>
>     Phone: (206) 667-5791 <tel:%28206%29%20667-5791>
>     Fax: (206) 667-1319 <tel:%28206%29%20667-1319>
>
>

-- 
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