HelenaLC / CATALYST

Cytometry dATa anALYsis Tools
66 stars 30 forks source link

panel[[panel_cols$channel]] %in% colnames(fs) are not all TRUE #395

Open Behind42 opened 1 month ago

Behind42 commented 1 month ago

Dear Helena,

It's been some time now that I am using your tool, and I already faced the famous issue "panel[[panel_cols$channel]] %in% colnames(fs) are not all TRUE".

But this time I really don't understand what is happening since I filtered my FCS files to keep only columns that I have in my panel excel file.

I verified that panel$fcs_colname contained all flowSet colnames with this code

panel1$fcs_colname[!panel1$fcs_colname %in% colnames(fs)] Giving me character(0) as expected....

> panel1$fcs_colname
 [1] "Y89Di"   "Cd106Di" "Cd111Di" "Cd113Di" "Cd116Di" "Pr141Di" "Ce142Di" "Nd143Di" "Nd144Di" "Nd145Di" "Nd146Di" "Sm147Di" "Nd148Di"
[14] "Sm149Di" "Nd150Di" "Eu151Di" "Sm152Di" "Eu153Di" "Sm154Di" "Gd155Di" "Gd156Di" "Gd158Di" "Tb159Di" "Gd160Di" "Dy161Di" "Dy162Di"
[27] "Dy163Di" "Dy164Di" "Ho165Di" "Er166Di" "Er167Di" "Er168Di" "Tm169Di" "Er170Di" "Yb171Di" "Yb172Di" "Yb173Di" "Yb174Di" "Lu175Di"
[40] "Yb176Di" "Bi209Di"
> colnames(fs)
 [1] "Y89Di"   "Cd106Di" "Cd111Di" "Cd113Di" "Cd116Di" "Pr141Di" "Ce142Di" "Nd143Di" "Nd144Di" "Nd145Di" "Nd146Di" "Sm147Di" "Nd148Di"
[14] "Sm149Di" "Nd150Di" "Eu151Di" "Sm152Di" "Eu153Di" "Sm154Di" "Gd155Di" "Gd156Di" "Gd158Di" "Tb159Di" "Gd160Di" "Dy161Di" "Dy162Di"
[27] "Dy163Di" "Dy164Di" "Ho165Di" "Er166Di" "Er167Di" "Er168Di" "Tm169Di" "Er170Di" "Yb171Di" "Yb172Di" "Yb173Di" "Yb174Di" "Lu175Di"
[40] "Yb176Di" "Bi209Di"

Do you know what could give this bug ?

Thank you very much,

Quentin R

`R version 4.2.3 (2023-03-15) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 11.6.2

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.2/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 grid stats graphics grDevices utils datasets methods base

other attached packages: [1] xlsx_0.6.5 ComplexHeatmap_2.14.0 tidyr_1.3.1 broom_1.0.5
[5] coin_1.4-3 survival_3.6-4 rstatix_0.7.2 data.table_1.15.4
[9] stringr_1.5.1 shinydashboard_0.7.2 shinyjs_2.1.0 shiny_1.8.1.1
[13] PAC_1.1.4 forcats_1.0.0 RColorBrewer_1.1-3 mvtnorm_1.2-4
[17] CATALYST_1.23.5 SingleCellExperiment_1.20.1 SummarizedExperiment_1.28.0 Biobase_2.58.0
[21] GenomicRanges_1.50.2 GenomeInfoDb_1.34.9 IRanges_2.32.0 S4Vectors_0.36.2
[25] BiocGenerics_0.44.0 MatrixGenerics_1.10.0 matrixStats_1.1.0 flowWorkspace_4.10.1
[29] flowCore_2.10.0 openCyto_2.10.1 dplyr_1.1.4 patchwork_1.2.0
[33] sctransform_0.4.1 ggpubr_0.6.0 gridExtra_2.3 ggridges_0.5.6
[37] ggplot2_3.5.1 cowplot_1.1.3 Seurat_5.1.0 SeuratObject_5.0.2
[41] sp_2.1-4 devtools_2.4.5 usethis_2.2.3 readxl_1.4.3

loaded via a namespace (and not attached): [1] rsvd_1.0.5 mitml_0.4-5 ica_1.0-3 Rsamtools_2.14.0
[5] foreach_1.5.2 lmtest_0.9-40 glmnet_4.1-8 crayon_1.5.2
[9] MASS_7.3-60 nlme_3.1-164 backports_1.4.1 rlang_1.1.3
[13] XVector_0.38.0 ROCR_1.0-11 irlba_2.3.5.1 nloptr_2.0.3
[17] scater_1.26.1 filelock_1.0.3 BiocParallel_1.32.6 rjson_0.2.21
[21] cmprsk_2.2-11 bit64_4.0.5 glue_1.7.0 parallel_4.2.3
[25] vipor_0.4.7 spatstat.sparse_3.0-3 AnnotationDbi_1.60.2 dotCall64_1.1-1
[29] spatstat.geom_3.2-9 tidyselect_1.2.1 fitdistrplus_1.1-11 XML_3.99-0.16
[33] zoo_1.8-12 GenomicAlignments_1.34.1 nnls_1.5 xtable_1.8-4
[37] RcppHNSW_0.6.0 magrittr_2.0.3 scuttle_1.8.4 cli_3.6.2
[41] zlibbioc_1.44.0 rstudioapi_0.16.0 miniUI_0.1.1.1 rpart_4.1.23
[45] fastmatch_1.1-4 ensembldb_2.22.0 fastDummies_1.7.3 BiocSingular_1.14.0
[49] xfun_0.43 clue_0.3-65 pkgbuild_1.4.4 cluster_2.1.6
[53] FactoMineR_2.11 KEGGREST_1.38.0 tibble_3.2.1 ggrepel_0.9.5
[57] parmigene_1.1.0 listenv_0.9.1 xlsxjars_0.6.1 Biostrings_2.66.0
[61] png_0.1-8 future_1.33.2 withr_3.0.0 bitops_1.0-7
[65] ggforce_0.4.2 RBGL_1.74.0 plyr_1.8.9 cellranger_1.1.0
[69] ncdfFlow_2.44.0 AnnotationFilter_1.22.0 coda_0.19-4.1 pillar_1.9.0
[73] GenomicFeatures_1.50.4 GlobalOptions_0.1.2 cachem_1.0.8 multcomp_1.4-25
[77] broom.helpers_1.15.0 fs_1.6.4 scatterplot3d_0.3-44 GetoptLong_1.0.5
[81] DelayedMatrixStats_1.20.0 vctrs_0.6.5 ellipsis_0.3.2 generics_0.1.3
[85] tools_4.2.3 beeswarm_0.4.0 munsell_0.5.1 tweenr_2.0.3
[89] fgsea_1.24.0 emmeans_1.10.1 DelayedArray_0.24.0 rtracklayer_1.58.0
[93] fastmap_1.1.1 compiler_4.2.3 pkgload_1.3.4 abind_1.4-5
[97] httpuv_1.6.15 missMDA_1.19 sessioninfo_1.2.2 gt_0.10.1
[101] BBmisc_1.13 plotly_4.10.4 rJava_1.0-6 GenomeInfoDbData_1.2.9
[105] lattice_0.22-6 ggnewscale_0.4.10 deldir_1.0-9 utf8_1.2.4
[109] later_1.3.2 BiocFileCache_2.6.1 pan_1.9 jomo_2.7-6
[113] jsonlite_1.8.8 scales_1.3.0 graph_1.76.0 ScaledMatrix_1.6.0
[117] pbapply_1.7-2 carData_3.0-5 sparseMatrixStats_1.10.0 estimability_1.5.1
[121] lazyeval_0.2.2 promises_1.3.0 car_3.1-2 doParallel_1.0.17
[125] goftest_1.2-3 spatstat.utils_3.0-4 reticulate_1.36.1 checkmate_2.3.1
[129] openxlsx_4.2.5.2 sandwich_3.1-0 textshaping_0.3.7 Rtsne_0.17
[133] uwot_0.2.2 igraph_1.5.1 yaml_2.3.8 plotrix_3.8-4
[137] systemfonts_1.0.5 gtsummary_1.7.2 cytolib_2.10.1 htmltools_0.5.8.1
[141] memoise_2.0.1 modeltools_0.2-23 BiocIO_1.8.0 profvis_0.3.8
[145] locfit_1.5-9.9 viridisLite_0.4.2 digest_0.6.35 rappdirs_0.3.3
[149] mime_0.12 leaps_3.1 spam_2.10-0 RSQLite_2.3.6
[153] future.apply_1.11.2 remotes_2.5.0 urlchecker_1.0.1 blob_1.2.4
[157] ragg_1.2.6 drc_3.0-1 labeling_0.4.3 splines_4.2.3
[161] Cairo_1.6-2 ProtGenerics_1.30.0 RCurl_1.98-1.14 hms_1.1.3
[165] colorspace_2.1-0 ConsensusClusterPlus_1.62.0 BiocManager_1.30.23 ggbeeswarm_0.7.2
[169] shape_1.4.6.1 libcoin_1.0-10 nnet_7.3-19 Rcpp_1.0.12
[173] RANN_2.6.1 XLConnectJars_0.2-12 circlize_0.4.16 FlowSOM_2.6.0
[177] RProtoBufLib_2.10.0 multcompView_0.1-10 fansi_1.0.6 parallelly_1.37.1
[181] R6_2.5.1 lifecycle_1.0.4 zip_2.3.1 writexl_1.5.0
[185] curl_5.2.1 ggsignif_0.6.4 minqa_1.2.6 leiden_0.4.3.1
[189] Matrix_1.6-4 RcppAnnoy_0.0.22 TH.data_1.1-2 iterators_1.0.14
[193] spatstat.explore_3.2-7 htmlwidgets_1.6.4 biomaRt_2.54.1 beachmat_2.14.2
[197] polyclip_1.10-6 purrr_1.0.2 tidycmprsk_1.0.0 globals_0.16.3
[201] flashClust_1.01-2 spatstat.random_3.2-3 progressr_0.14.0 codetools_0.2-20
[205] prettyunits_1.2.0 gtools_3.9.5 dbplyr_2.5.0 RSpectra_0.16-1
[209] gtable_0.3.5 DBI_1.2.2 XLConnect_0.2-12 tensor_1.5
[213] httr_1.4.7 KernSmooth_2.23-22 progress_1.2.3 stringi_1.8.4
[217] reshape2_1.4.4 farver_2.1.2 annotate_1.76.0 viridis_0.6.5
[221] Rgraphviz_2.42.0 magick_2.8.0 mice_3.16.0 DT_0.33
[225] xml2_1.3.6 infotheo_1.2.0.1 colorRamps_2.3.4 boot_1.3-30
[229] BiocNeighbors_1.16.0 restfulr_0.0.15 lme4_1.1-35.3 geneplotter_1.76.0
[233] scattermore_1.2 DESeq2_1.38.3 bit_4.0.5 spatstat.data_3.0-4
[237] pkgconfig_2.0.3 flowClust_3.36.1 knitr_1.46 `

Behind42 commented 1 month ago

I also did a little loop to see for each fcs files giving me a list of differences between the panel and the fcs colnames. All character(0)...

for(i in levels(list_files)) { fcs <- flowCore::read.FCS(paste(path_fcs,as.character(i), sep="")) fcs_col <- colnames(fcs) panel <- read_xlsx(path_panel) fcs_pan <- panel$fcs_colname diff[[as.character(i)]] <- setdiff(fcs_col, fcs_pan) }

HelenaLC commented 1 month ago

Not sure what's going on - could you perhaps post the command you are running exactly, i.e., prepData(...) and also the output of print(panel1)?

HelenaLC commented 1 month ago

Any news? Else close the issue, please, if it has been resolved, or I will when there’s no more activity.