RGLab / flowWorkspace

flowWorkspace
GNU Affero General Public License v3.0
45 stars 21 forks source link

load_cytoframe_from_fcs alter.names doesn't #376

Closed malcook closed 2 years ago

malcook commented 2 years ago

I find that alter.names is not respected in load_cytoframe_from_fcs where it is in read.FCS, as the following should demonstrate:

> colnames(read.FCS(f, alter.names = FALSE))
 [1] "T0"     "T1"     "INFO"   "FS00-H" "FS00-A" "FS00-W" "FS01-H" "FS01-A"
 [9] "FS01-W" "SS02-H" "SS02-A" "SS02-W" "FL03-H" "FL03-A" "FL03-W" "FL04-H"
[17] "FL04-A" "FL04-W" "FL10-H" "FL10-A" "FL10-W" "FL13-H" "FL13-A" "FL13-W"
[25] "FL17-H" "FL17-A" "FL17-W" "TIME"  
> colnames(read.FCS(f, alter.names = TRUE))
 [1] "T0"     "T1"     "INFO"   "FS00.H" "FS00.A" "FS00.W" "FS01.H" "FS01.A"
 [9] "FS01.W" "SS02.H" "SS02.A" "SS02.W" "FL03.H" "FL03.A" "FL03.W" "FL04.H"
[17] "FL04.A" "FL04.W" "FL10.H" "FL10.A" "FL10.W" "FL13.H" "FL13.A" "FL13.W"
[25] "FL17.H" "FL17.A" "FL17.W" "TIME"  
> colnames(load_cytoframe_from_fcs(f, alter.names = FALSE))
 [1] "T0"     "T1"     "INFO"   "FS00-H" "FS00-A" "FS00-W" "FS01-H" "FS01-A"
 [9] "FS01-W" "SS02-H" "SS02-A" "SS02-W" "FL03-H" "FL03-A" "FL03-W" "FL04-H"
[17] "FL04-A" "FL04-W" "FL10-H" "FL10-A" "FL10-W" "FL13-H" "FL13-A" "FL13-W"
[25] "FL17-H" "FL17-A" "FL17-W" "TIME"  
> colnames(load_cytoframe_from_fcs(f, alter.names = TRUE))
 [1] "T0"     "T1"     "INFO"   "FS00-H" "FS00-A" "FS00-W" "FS01-H" "FS01-A"
 [9] "FS01-W" "SS02-H" "SS02-A" "SS02-W" "FL03-H" "FL03-A" "FL03-W" "FL04-H"
[17] "FL04-A" "FL04-W" "FL10-H" "FL10-A" "FL10-W" "FL13-H" "FL13-A" "FL13-W"
[25] "FL17-H" "FL17-A" "FL17-W" "TIME"  

> > sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS:   /n/apps/CentOS7/install/r-4.1.0/lib64/R/lib/libRblas.so
LAPACK: /n/apps/CentOS7/install/r-4.1.0/lib64/R/lib/libRlapack.so

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

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

other attached packages:
 [1] cytoinstaller_0.1.0      CytoML_2.4.0             Rgraphviz_2.36.0        
 [4] graph_1.70.0             BiocGenerics_0.38.0      openCyto_2.3.0          
 [7] functional_0.6           data.table_1.14.2        ggcyto_1.20.0           
[10] flowWorkspace_4.4.0      ncdfFlow_2.38.0          BH_1.75.0-0             
[13] RcppArmadillo_0.10.7.5.0 flowCore_2.4.0           ggplot2_3.3.5           
[16] ash_1.0-15               gtools_3.9.2             assertive_0.3-6         
[19] docopt_0.7.1            

loaded via a namespace (and not attached):
  [1] systemfonts_1.0.2          plyr_1.8.6                
  [3] assertive.files_0.0-2      splines_4.1.0             
  [5] fda_5.1.9                  digest_0.6.29             
  [7] fansi_0.5.0                magrittr_2.0.2            
  [9] assertive.datetimes_0.0-3  assertive.numbers_0.0-2   
 [11] cluster_2.1.2              ks_1.13.1                 
 [13] remotes_2.4.0              hdrcde_3.4                
 [15] aws.signature_0.6.0        RcppParallel_5.1.4        
 [17] matrixStats_0.59.0         R.utils_2.10.1            
 [19] fds_1.8                    cytolib_2.4.0             
 [21] prettyunits_1.1.1          jpeg_0.1-8.1              
 [23] colorspace_2.0-2           rrcov_1.5-5               
 [25] gitcreds_0.1.1             assertive.strings_0.0-3   
 [27] xfun_0.23                  dplyr_1.0.7               
 [29] callr_3.7.0                jsonlite_1.8.0            
 [31] RCurl_1.98-1.3             crayon_1.4.2              
 [33] hexbin_1.28.2              glue_1.6.2                
 [35] flowClust_3.29.0           gtable_0.3.0              
 [37] zlibbioc_1.38.0            DelayedArray_0.18.0       
 [39] pkgbuild_1.2.0             IDPmisc_1.1.20            
 [41] DEoptimR_1.0-9             scales_1.1.1              
 [43] mvtnorm_1.1-2              DBI_1.1.2                 
 [45] assertive.data.uk_0.0-2    assertive.models_0.0-2    
 [47] Rcpp_1.0.8                 assertive.code_0.0-3      
 [49] tmvnsim_1.0-2              clue_0.3-59               
 [51] mclust_5.4.7               assertive.data.us_0.0-2   
 [53] stats4_4.1.0               httr_1.4.2                
 [55] RColorBrewer_1.1-2         ellipsis_0.3.2            
 [57] rainbow_3.6                pkgconfig_2.0.3           
 [59] XML_3.99-0.6               R.methodsS3_1.8.1         
 [61] farver_2.1.0               flowViz_1.56.0            
 [63] utf8_1.2.2                 flowStats_4.3.0           
 [65] tidyselect_1.1.1           labeling_0.4.2            
 [67] rlang_1.0.1                munsell_0.5.0             
 [69] tools_4.1.0                cli_3.1.0                 
 [71] generics_0.1.1             assertive.reflection_0.0-5
 [73] aws.s3_0.3.21              yaml_2.3.5                
 [75] processx_3.5.2             knitr_1.33                
 [77] assertive.matrices_0.0-2   robustbase_0.93-8         
 [79] purrr_0.3.4                gh_1.3.0                  
 [81] assertive.sets_0.0-3       RBGL_1.68.0               
 [83] R.oo_1.24.0                pracma_2.3.3              
 [85] xml2_1.3.2                 compiler_4.1.0            
 [87] curl_4.3.1                 png_0.1-7                 
 [89] tibble_3.1.6               pcaPP_1.9-74              
 [91] stringi_1.6.2              ps_1.6.0                  
 [93] lattice_0.20-44            assertive.base_0.0-9      
 [95] Matrix_1.3-4               assertive.data_0.0-3      
 [97] vctrs_0.3.8                pillar_1.6.4              
 [99] lifecycle_1.0.1            bitops_1.0-7              
[101] corpcor_1.6.9              assertive.types_0.0-3     
[103] R6_2.5.1                   latticeExtra_0.6-29       
[105] assertive.properties_0.0-4 KernSmooth_2.23-20        
[107] gridExtra_2.3              RProtoBufLib_2.4.0        
[109] IRanges_2.26.0             codetools_0.2-18          
[111] MASS_7.3-54                assertthat_0.2.1          
[113] rprojroot_2.0.2            withr_2.4.3               
[115] mnormt_2.0.2               S4Vectors_0.30.0          
[117] MatrixGenerics_1.4.0       Biobase_2.52.0            
[119] base64enc_0.1-3            ellipse_0.4.2             
mikejiang commented 2 years ago

This is one of the arguments that did not get ported from read.FCS, because fcs parser logic is already complex enough, we do not want to introduce more unnecessary feature to the core functionality of parsing FCS.

Name changes can be easily achieved by some post-processing script through colnames<- method.

But thank you for reporting this issue, I have removed these unused arguments from API and updated the docs.

malcook commented 2 years ago

Understood, - thanks for the explanation.