Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_2d failed on Bioc devel but succeed locally #19

Open
mikejiang opened this issue Apr 11, 2019 · 2 comments
Open

test_2d failed on Bioc devel but succeed locally #19

mikejiang opened this issue Apr 11, 2019 · 2 comments

Comments

@mikejiang
Copy link
Member

mikejiang commented Apr 11, 2019

ERROR
Running the tests intests/testthat.Rfailed.
Last 13 lines of output:
  [4] 5.93e+08 - 6.26e+08 == -32890894
  
  ── 2. Failure: flowClust 2d: prior (@test_2d.R#28)  ────────────────────────────
  g@mean not equal to c(`FSC-A` = 87638.359375, `SSC-A` = 62425.46875).
  2/2 mismatches (average diff: 2613)
  [1] 90672 - 87638 ==  3033
  [2] 60234 - 62425 == -2192
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 52 SKIPPED: 1 FAILED: 2
  1. Failure: flowClust 2d: prior (@test_2d.R#23) 
  2. Failure: flowClust 2d: prior (@test_2d.R#28) 
  

I can't reproduce this error locally for this test since flowClust generates slightly different gate coordinates on bioc server.
image
The red gate is generated from the local run and black gate from the BioC (docker).
Both local and bioc environment has the same source code of flowClust and openCyto (as well as the same seed). It could be the discrepancy of certain external package or library. While I am trying to track it down. @gfinak, just want to let you be aware of this potential reproducibility issue of flowClust/openCyto

@mikejiang
Copy link
Member Author

Looks like the latest R-devel changes its random sampling behavior
Here is from my 5-month old R-devel

> set.seed(1)
> sample(1e4 ,2)
[1] 2656 3721
> base::version
...
status         Under development (unstable)                      
major          3                                                 
minor          6.0                                               
year           2018                                              
month          11                                                
day            16   

and here is from the latest R-devel (bioc docker)

> sample(1e4 ,2)
[1] 1017 8004
> base::version
...
major          3                                                 
minor          7.0                                               
year           2019                                              
month          04                                                
day            07                                                

This eventually causes the prior estimation from openCyto:::.prior_kmeans where original data is sub-sampled

@mikejiang
Copy link
Member Author

This is related R-devel issue https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17494
To retain the old behavior, simply set lower R version to RNGversion, i.e.

RNGversion("3.5")
Warning message:
In RNGkind("Mersenne-Twister", "Inversion", "Rounding") :
  non-uniform 'Rounding' sampler used
> set.seed(1)
> sample(1e4 ,2)
[1] 2656 3721

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant