[Bioc-devel] Question about BiocGeneric::order

Hervé Pagès hpages at fredhutch.org
Fri May 12 03:47:53 CEST 2017


On 05/11/2017 06:44 PM, Hervé Pagès wrote:
> Hi Michael,
>
> On 05/11/2017 03:27 PM, Michael Lawrence wrote:
>> There is a bug in S4Vectors, but thanks to an R 3.4 bug in the methods
>> package (recently fixed in devel), the bug is masked. So, we should
>> fix S4Vectors. The problem is that order,Rle has a default for the
>> 'method' argument that differs from that of the generic. Since R 3.3,
>> base::order() is smart enough to basically do the same thing as
>> order,Rle(). I'll go ahead and remove the method.
>
> Note that base::order() is much slower than the method for Rle objects:

Forgot to copy/paste this:

   library(S4Vectors)
   x <- Rle(sample(25L, 500000L, replace=TRUE) - 8L,
            sample(13L, 500000L, replace=TRUE))

>
>> system.time(oo1 <- order(x))
>    user  system elapsed
>   0.018   0.000   0.018
>
>> system.time(oo2 <- base::order(x))
>    user  system elapsed
>   1.089   0.000   1.103
>
>> identical(oo1, oo2)
> [1] TRUE
>
> Looks like by default, base::order() does not pick up the fastest
> method (radix):
>
>> system.time(oo2 <- base::order(x, method="radix"))
>    user  system elapsed
>   0.020   0.000   0.019

and to provide my sessionInfo():

 > sessionInfo()
R version 3.4.0 Patched (2017-04-26 r72630)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

Matrix products: default
BLAS: /home/hpages/R/R-3.4.r72630/lib/libRblas.so
LAPACK: /home/hpages/R/R-3.4.r72630/lib/libRlapack.so

locale:
  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets
[8] methods   base

other attached packages:
[1] S4Vectors_0.15.2    BiocGenerics_0.23.0

loaded via a namespace (and not attached):
[1] compiler_3.4.0 tools_3.4.0

H.

>
> H.
>
>>
>> Michael
>>
>> On Thu, May 11, 2017 at 1:29 PM, Ou, Jianhong
>> <Jianhong.Ou at umassmed.edu> wrote:
>>> Thank you Hervé,
>>>
>>> I got that. Good to know that BioC 3.6 require R 3.4.0.
>>>
>>> Yours Sincerely,
>>>
>>> Jianhong Ou
>>>
>>> TEL: 508-856-5379
>>> LRB 608
>>> Bioinformatician of Bioinformatics core at
>>> Department of Molecular, Cell and Cancer Biology
>>> UMASS Medical School
>>> 364 Plantation Street Worcester,
>>> MA 01605
>>>
>>> Confidentiality Notice:
>>> This e-mail message, including any attachments, is for the sole use
>>> of the intended recipient(s) and may contain confidential,
>>> proprietary and privileged information. Any unauthorized review, use,
>>> disclosure or distribution is prohibited. If you are not the intended
>>> recipient, please contact the sender immediately and destroy or
>>> permanently delete all copies of the original message.
>>>
>>>
>>>
>>>
>>>
>>> On 5/11/17, 4:25 PM, "Hervé Pagès" <hpages at fredhutch.org> wrote:
>>>
>>>     Hi Jianhong,
>>>
>>>     I can't reproduce this but I'm using R 3.4.0.
>>>     You seem to be using Bioc devel (aka BioC 3.6) with R devel.
>>>     This is not supported. Both, BioC 3.5 (current release) and
>>>     BioC 3.6 require R 3.4.0.
>>>
>>>     Cheers,
>>>     H.
>>>
>>>
>>>     On 05/11/2017 01:11 PM, Ou, Jianhong wrote:
>>>     > I got error when I try order for Rle object by following codes:
>>>     >
>>>     > library("BiocGenerics")
>>>     > library(XVector)
>>>     > order(Rle(1))
>>>     > ## Error in match.arg(method) : 'arg' must be of length 1
>>>     >
>>>     >> sessionInfo()
>>>     > R Under development (unstable) (2017-05-10 r72667)
>>>     > Platform: x86_64-apple-darwin16.5.0 (64-bit)
>>>     > Running under: macOS Sierra 10.12.4
>>>     >
>>>     > Matrix products: default
>>>     > BLAS:
>>> /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.dylib
>>>
>>>     > LAPACK:
>>> /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
>>>
>>>     >
>>>     > locale:
>>>     > [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>>>     >
>>>     > attached base packages:
>>>     > [1] stats4    parallel  stats     graphics  grDevices utils
>>> datasets
>>>     > [8] methods   base
>>>     >
>>>     > other attached packages:
>>>     > [1] XVector_0.17.0      IRanges_2.11.2      S4Vectors_0.15.1
>>>     > [4] BiocGenerics_0.23.0
>>>     >
>>>     > loaded via a namespace (and not attached):
>>>     > [1] zlibbioc_1.23.0 compiler_3.5.0
>>>     >
>>>     > Is this a bug? Or I should always add method argument?
>>>     >
>>>     > Yours Sincerely,
>>>     >
>>>     > Jianhong Ou
>>>     >
>>>     > TEL: 508-856-5379
>>>     > LRB 608
>>>     > Bioinformatician of Bioinformatics core at
>>>     > Department of Molecular, Cell and Cancer Biology
>>>     > UMASS Medical School
>>>     > 364 Plantation Street Worcester,
>>>     > MA 01605
>>>     >
>>>     > Confidentiality Notice:
>>>     > This e-mail message, including any attachments, is for the sole
>>> use of the intended recipient(s) and may contain confidential,
>>> proprietary and privileged information. Any unauthorized review, use,
>>> disclosure or distribution is prohibited. If you are not the intended
>>> recipient, please contact the sender immediately and destroy or
>>> permanently delete all copies of the original message.
>>>     >
>>>     >
>>>     >
>>>     >   [[alternative HTML version deleted]]
>>>     >
>>>     > _______________________________________________
>>>     > Bioc-devel at r-project.org mailing list
>>>     >
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_bioc-2Ddevel&d=DwICAg&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=FhYaKPjNM3nCK5wrqNrek8IgmU7YlJH8B77AMM77j7U&s=N1wtJXFb6nsvQncKFe8tgzi_q8NunVLhu-gJoQA_Co8&e=
>>>
>>>     >
>>>
>>>     --
>>>     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 fredhutch.org
>>>     Phone:  (206) 667-5791
>>>     Fax:    (206) 667-1319
>>>
>>>
>>> _______________________________________________
>>> Bioc-devel at r-project.org mailing list
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_bioc-2Ddevel&d=DwIFaQ&c=eRAMFD45gAfqt84VtBcfhQ&r=BK7q3XeAvimeWdGbWY_wJYbW0WYiZvSXAJJKaaPhzWA&m=SfDjGrm-go9CSXhsmi7cU43TGLLM-77DG5Lpdg0dD8U&s=SAYmrM-Cxa3tQ7XDNei_qKHzwjdLRoa-aQCt9W03Fs8&e=
>>>
>

-- 
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 fredhutch.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the Bioc-devel mailing list