Browse code

sampNloc -> sample_names_from

mikejiang authored on 19/08/2022 17:36:32
Showing 2 changed files

... ...
@@ -7,6 +7,11 @@
7 7
 
8 8
 using namespace Rcpp;
9 9
 
10
+#ifdef RCPP_USE_GLOBAL_ROSTREAM
11
+Rcpp::Rostream<true>&  Rcpp::Rcout = Rcpp::Rcpp_cout_get();
12
+Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
13
+#endif
14
+
10 15
 // setLogLevel
11 16
 void setLogLevel(unsigned short loglevel);
12 17
 RcppExport SEXP _CytoML_setLogLevel(SEXP loglevelSEXP) {
... ...
@@ -42,7 +42,7 @@ test_that("no gate",{
42 42
   
43 43
   wsFile <- file.path(path, "no-gate.wsp")
44 44
   
45
-  ws <- open_flowjo_xml(wsFile, sampNloc = 'sampleNode')
45
+  ws <- open_flowjo_xml(wsFile, sample_names_from = 'sampleNode')
46 46
   expect_equal(nrow(fj_ws_get_samples(ws)), 1)
47 47
   gs <- flowjo_to_gatingset(ws, name = 1, path = file.path(path,"Cytotrol/NHLBI/Tcell/"), include_empty_tree = TRUE)
48 48
   expect_equal(range(gh_pop_get_data(gs[[1]]))[,5], c(50.70029, 256.91464), tol = 1e-6)
... ...
@@ -55,7 +55,7 @@ test_that("flog-- offset and decades that expose the previous logGml2-based flog
55 55
   
56 56
   wsFile <- file.path(path, "flog/log.wsp")
57 57
   
58
-  ws <- open_flowjo_xml(wsFile, sampNloc = 'sampleNode')
58
+  ws <- open_flowjo_xml(wsFile, sample_names_from = 'sampleNode')
59 59
   gs <- flowjo_to_gatingset(ws, name = 1, path = file.path(path,"Cytotrol/NHLBI/Tcell/"))
60 60
   res <- gh_pop_compare_stats(gs[[1]])
61 61
   expect_equal(res[, xml.freq], res[, openCyto.freq], tol = 0.01)
... ...
@@ -66,7 +66,7 @@ test_that("which.lines",{
66 66
   
67 67
   wsFile <- file.path(path, "flog_PnE/Liver.wsp")
68 68
   
69
-  ws <- open_flowjo_xml(wsFile, sampNloc = 'sampleNode')
69
+  ws <- open_flowjo_xml(wsFile, sample_names_from = 'sampleNode')
70 70
   set.seed(1)
71 71
   gs <- flowjo_to_gatingset(ws, name = 2, which.lines = 5e4)
72 72
   expect_equal(nrow(gh_pop_get_data(gs[[1]])), 5e4)
... ...
@@ -95,7 +95,7 @@ test_that("set T value properly through PnE instead of PnR for flog transform wh
95 95
   
96 96
   wsFile <- file.path(path, "flog_PnE/Liver.wsp")
97 97
   
98
-  ws <- open_flowjo_xml(wsFile, sampNloc = 'sampleNode')
98
+  ws <- open_flowjo_xml(wsFile, sample_names_from = 'sampleNode')
99 99
   gs <- flowjo_to_gatingset(ws, name = 2)
100 100
  
101 101
   res <- gh_pop_compare_stats(gs[[1]])
... ...
@@ -241,7 +241,7 @@ test_that("curlyQuad gate ",{
241 241
 test_that("EllipsoidGate defined on log-transformed channels ",{
242 242
       thisPath <- file.path(path, "ellipsoid_log")
243 243
       wsFile <- file.path(thisPath, "xml_spillover2.xml")
244
-      ws <- open_flowjo_xml(wsFile, sampNloc = "sampleNode")
244
+      ws <- open_flowjo_xml(wsFile, sample_names_from = "sampleNode")
245 245
       capture.output(gs <- flowjo_to_gatingset(ws, name=1, execute = T, subset = "spillover_B2.fcs"))
246 246
        
247 247
       res <- gh_pop_compare_stats(gs[[1]])
... ...
@@ -434,7 +434,7 @@ test_that("v 10.0.7 - vX 20.0 (PROVIDE/CyTOF) ellipseidGate (fasinh)",{
434 434
       thisPath <- file.path(path, "PROVIDE")
435 435
       wsFile <- file.path(thisPath, "batch1 local and week 53.wsp")
436 436
       
437
-      ws <- open_flowjo_xml(wsFile, sampNloc = "sampleNode")
437
+      ws <- open_flowjo_xml(wsFile, sample_names_from = "sampleNode")
438 438
       gs <- flowjo_to_gatingset(ws, name = 1, subset = 3, execute = FALSE)
439 439
       expect_is(gs, "GatingSet")
440 440
       
... ...
@@ -449,7 +449,7 @@ test_that("v 10.0.7 - vX 20.0 (PROVIDE/CyTOF) ellipseidGate (fasinh)",{
449 449
       #switch to the corrected wsp
450 450
       wsFile <- file.path(thisPath, "count_corrected.wsp")
451 451
       
452
-      ws <- open_flowjo_xml(wsFile, sampNloc = "sampleNode")
452
+      ws <- open_flowjo_xml(wsFile, sample_names_from = "sampleNode")
453 453
       capture.output(gs <- flowjo_to_gatingset(ws, name = 1, subset = 3))
454 454
       gh <- gs[[1]]
455 455
       thisCounts <- gh_pop_compare_stats(gh)[, list(xml.count,openCyto.count, node)]
... ...
@@ -587,9 +587,9 @@ test_that("v 7.6.5 - win 1.61 (PBMC)",{
587 587
       wsFile <- file.path(thisPath, "Exp2_Tcell.wsp")
588 588
 
589 589
       ws <- open_flowjo_xml(wsFile)
590
-      gs <- flowjo_to_gatingset(ws, name = 1, subset = 1, sampNloc = "sampleNode", execute = FALSE)
590
+      gs <- flowjo_to_gatingset(ws, name = 1, subset = 1, sample_names_from = "sampleNode", execute = FALSE)
591 591
       expect_is(gs, "GatingSet")
592
-      gs <- flowjo_to_gatingset(ws, name = 1, subset = 1, sampNloc = "sampleNode")
592
+      gs <- flowjo_to_gatingset(ws, name = 1, subset = 1, sample_names_from = "sampleNode")
593 593
       gh <- gs[[1]]
594 594
             
595 595
       thisCounts <- gh_pop_compare_stats(gh)
... ...
@@ -597,17 +597,17 @@ test_that("v 7.6.5 - win 1.61 (PBMC)",{
597 597
             
598 598
     })
599 599
 
600
-test_that("v 7.6.5 - win 1.61 (sampNloc = 'sampleNode')",{
600
+test_that("v 7.6.5 - win 1.61 (sample_names_from = 'sampleNode')",{
601 601
       
602 602
       thisPath <- file.path(path, "Cytotrol/Miami")
603 603
       wsFile <- file.path(thisPath, "flowJo/Cytotrol_061112_Tcell.wsp")
604 604
 
605 605
       ws <- open_flowjo_xml(wsFile)
606 606
       
607
-      gs <- flowjo_to_gatingset(ws, name = 1, subset = 1, path = file.path(thisPath,"Tcell"), sampNloc = "sampleNode", execute = FALSE)
607
+      gs <- flowjo_to_gatingset(ws, name = 1, subset = 1, path = file.path(thisPath,"Tcell"), sample_names_from = "sampleNode", execute = FALSE)
608 608
       expect_is(gs, "GatingSet")
609 609
       
610
-      gs <- flowjo_to_gatingset(ws, name = 1, subset = 1, path = file.path(thisPath,"Tcell"), sampNloc = "sampleNode")
610
+      gs <- flowjo_to_gatingset(ws, name = 1, subset = 1, path = file.path(thisPath,"Tcell"), sample_names_from = "sampleNode")
611 611
       gh <- gs[[1]]
612 612
       thisCounts <- gh_pop_compare_stats(gh)
613 613
       expect_equal(thisCounts[, xml.freq], thisCounts[, openCyto.freq], tol = 2e-4)