RGLab / openCyto

A package that provides data analysis pipeline for flow cytometry.
GNU Affero General Public License v3.0
75 stars 29 forks source link

tailgate function not found #249

Closed may-sath closed 6 months ago

may-sath commented 1 year ago

I have a old R script I where I used openCyto tailgate/gate_tail function in R.4.0.3 Now I have updated the R (4.3.1) and had installed the latest openCyto (2.13) version And gate_tail function seems not to be available in the package But in R man pages function is still mentioned. https://rdrr.io/bioc/openCyto/man/gate_tail.html How can I call gate_tail function in latest openCyto?

> library(openCyto)
> sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.4.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] C/UTF-8/C/C/C/C

time zone: Asia/Tokyo
tzcode source: internal

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

other attached packages:
[1] openCyto_2.13.0

loaded via a namespace (and not attached):
 [1] dplyr_1.1.2          compiler_4.3.1       tidyselect_1.2.0    
 [4] Rcpp_1.0.11          Biobase_2.61.0       flowWorkspace_4.13.2
 [7] cytolib_2.13.1       parallel_4.3.1       Rgraphviz_2.45.0    
[10] scales_1.2.1         R6_2.5.1             RProtoBufLib_2.13.1 
[13] generics_0.1.3       RBGL_1.77.1          BiocGenerics_0.47.0 
[16] graph_1.79.0         XML_3.99-0.14        tibble_3.2.1        
[19] flowClust_3.39.0     munsell_0.5.0        pillar_1.9.0        
[22] RColorBrewer_1.1-3   ncdfFlow_2.47.0      rlang_1.1.1         
[25] utf8_1.2.3           flowCore_2.13.1      cli_3.6.1           
[28] magrittr_2.0.3       zlibbioc_1.47.0      grid_4.3.1          
[31] lifecycle_1.0.3      S4Vectors_0.39.1     vctrs_0.6.3         
[34] glue_1.6.2           data.table_1.14.8    stats4_4.3.1        
[37] fansi_1.0.4          colorspace_2.1-0     matrixStats_1.0.0   
[40] pkgconfig_2.0.3     
> gt_list_methods()
Gating Functions:
===  quantileGate 
===  gate_quantile 
===  rangeGate 
===  flowClust.2d 
===  gate_flowclust_2d 
===  mindensity 
===  gate_mindensity 
===  mindensity2 
===  gate_mindensity2 
===  cytokine 
===  flowClust.1d 
===  gate_flowclust_1d 
===  boundary 
===  singletGate 
===  quadGate.tmix 
===  gate_quad_tmix 
===  quadGate.seq 
===  gate_quad_sequential 
Preprocessing Functions:
===  prior_flowClust 
===  prior_flowClust 
===  warpSet 
===  standardize_flowset 
MSHelm commented 10 months ago

Hey openCyto team, I have the same question. Was using openCyto for a while but only now updated. Looking at the commit history, it seems that tailgate was deprecated 2 years ago (so I am probably late to the party XD), and moved to {flowStats} first, but also there it is now removed. If you dont plan to reintroduce it, I would be curious why you deprecated it. It was actually my favority gating algorithm in the openCyto toolbox. Thanks a lot!

mikejiang commented 9 months ago

tail gate was removed due to its incompatible license requirement: GPL2 vs openCyto AGPL-3.0-only, I just re-stored it in cytoUtils package for you to continue to use it in your script, all you need to do is to register it into openCyto explicitly, for example,

library(flowWorkspace)
library(ggcyto)
library(cytoUtils)
openCyto:::register_plugins(fun=cytoUtils:::.gate_tail,methodName="gate_tail")
# Right tail
gs <- load_gs(system.file("extdata", "gs_manual", package = "flowWorkspaceData"))
openCyto::gs_add_gating_method(gs, alias = "CCR7_right_tail_pos", pop = "+", parent = "CD4",
                               dims = "<G560-A>", gating_method = "gate_tail", 
                               gating_args = "side='right'")
autoplot(gs,"CCR7_right_tail_pos")

image