paiva-s-lab / FlowCT

FlowCT: A semi-automated workflow for deconvolution of immunophenotypic data and objective reporting on large datasets
4 stars 4 forks source link

Batch.Removal - Error in `assays<-`(`*tmp*`, withDimnames = withDimnames, ..., value = `*vtmp*`) #13

Closed margarida-ppedro closed 5 months ago

margarida-ppedro commented 8 months ago

Hello!

I have been following the FlowCT tutorial because I am trying to merge several FCS files into a single SCE.

I trying to use the batch.removal() using the harmony method. It appears that the batch removal itself worked but that there is a problem when creating the new assay. Before I used marker.normalization() using the warp method and there was no errors.

This is the script: fcs <- batch.removal(fcs, assay.i = "raw", method = "harmony", batch = "condition", new.matrix.name = "harmony")

This is the output:

Warning: HarmonyMatrix is deprecated and will be removed in the future from the API in the futureInitializing state using k-means centroids initialization
Warning: Quick-TRANSfer stage steps exceeded maximum (= 15697800)Warning: Quick-TRANSfer stage steps exceeded maximum (= 15697800)Warning: Quick-TRANSfer stage steps exceeded maximum (= 15697800)Warning: Quick-TRANSfer stage steps exceeded maximum (= 15697800)Warning: Quick-TRANSfer stage steps exceeded maximum (= 15697800)Warning: Quick-TRANSfer stage steps exceeded maximum (= 15697800)Warning: Quick-TRANSfer stage steps exceeded maximum (= 15697800)Warning: Quick-TRANSfer stage steps exceeded maximum (= 15697800)Warning: did not converge in 25 iterationsHarmony 1/10
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Harmony 2/10
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Harmony converged after 2 iterations
Error in `assays<-`(`*tmp*`, withDimnames = withDimnames, ..., value = `*vtmp*`) : 
  please use 'assay(x, withDimnames=FALSE)) <- value' or 'assays(x, withDimnames=FALSE)) <- value' when the rownames or colnames of the
  supplied assay(s) are not identical to those of the receiving SingleCellExperiment object 'x'

I tried to do some troubleshouting but didn't got far... I checked dimnames(fcs) and dimnames(assay(fcs)) and they are the same.

I also tried using the Seuratmethod and it gave the same error. Is there a way to solve this problem?

Thank you so much in advance! Best, Margarida

R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=Portuguese_Portugal.utf8  LC_CTYPE=Portuguese_Portugal.utf8    LC_MONETARY=Portuguese_Portugal.utf8
[4] LC_NUMERIC=C                         LC_TIME=Portuguese_Portugal.utf8    

time zone: Europe/Lisbon
tzcode source: internal

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

other attached packages:
 [1] RColorBrewer_1.1-3          parallelsugar_0.0.0.2       FlowCT_1.0.0                scDataviz_1.12.0            cowplot_1.1.2              
 [6] limma_3.58.1                lubridate_1.9.3             forcats_1.0.0               stringr_1.5.1               dplyr_1.1.4                
[11] purrr_1.0.2                 readr_2.1.4                 tibble_3.2.1                tidyverse_2.0.0             diffcyt_1.22.0             
[16] clustree_0.5.1              ggraph_2.1.0                ggplot2_3.4.4               doParallel_1.0.17           iterators_1.0.14           
[21] foreach_1.5.2               tidyr_1.3.0                 glue_1.6.2                  fda_6.1.4                   deSolve_1.40               
[26] fds_1.8                     RCurl_1.98-1.13             rainbow_3.7                 pcaPP_2.0-4                 MASS_7.3-60                
[31] knitr_1.45                  uwot_0.1.16                 Matrix_1.6-4                CATALYST_1.26.0             SingleCellExperiment_1.24.0
[36] SummarizedExperiment_1.32.0 Biobase_2.62.0              GenomicRanges_1.54.1        GenomeInfoDb_1.38.2         IRanges_2.36.0             
[41] S4Vectors_0.40.2            BiocGenerics_0.48.1         MatrixGenerics_1.14.0       matrixStats_1.2.0           PeacoQC_1.12.0             
[46] flowAI_1.32.0               flowVS_1.34.0               flowStats_4.14.0            flowViz_1.66.0              lattice_0.22-5             
[51] flowCore_2.14.0            

loaded via a namespace (and not attached):
  [1] strex_1.6.1                 progress_1.2.3              goftest_1.2-3               TH.data_1.1-2               vctrs_0.6.5                
  [6] spatstat.random_3.2-2       digest_0.6.33               png_0.1-8                   corpcor_1.6.10              shape_1.4.6                
 [11] ggrepel_0.9.4               corrplot_0.92               deldir_2.0-2                parallelly_1.36.0           hdrcde_3.4                 
 [16] reshape2_1.4.4              httpuv_1.6.13               withr_2.5.2                 xfun_0.41                   ggpubr_0.6.0               
 [21] ellipsis_0.3.2              survival_3.5-7              hexbin_1.28.3               ggbeeswarm_0.7.2            RProtoBufLib_2.14.0        
 [26] drc_3.0-1                   systemfonts_1.0.5           ragg_1.2.7                  zoo_1.8-12                  GlobalOptions_0.1.2        
 [31] gtools_3.9.5                pbapply_1.7-2               DEoptimR_1.1-3              prettyunits_1.2.0           promises_1.2.1             
 [36] httr_1.4.7                  rstatix_0.7.2               globals_0.16.2              fitdistrplus_1.1-11         rstudioapi_0.15.0          
 [41] miniUI_0.1.1.1              generics_0.1.3              zlibbioc_1.48.0             flowWorkspace_4.14.1        ScaledMatrix_1.10.0        
 [46] polyclip_1.10-6             GenomeInfoDbData_1.2.11     SparseArray_1.2.2           ncdfFlow_2.48.0             xtable_1.8-4               
 [51] pracma_2.4.4                evaluate_0.23               S4Arrays_1.2.0              hms_1.1.3                   irlba_2.3.5.1              
 [56] colorspace_2.1-0            harmony_1.2.0               ROCR_1.0-11                 reticulate_1.34.0           spatstat.data_3.0-3        
 [61] magrittr_2.0.3              lmtest_0.9-40               Rgraphviz_2.46.0            later_1.3.2                 viridis_0.6.4              
 [66] spatstat.geom_3.2-7         future.apply_1.11.0         robustbase_0.99-1           scattermore_1.2             XML_3.99-0.16              
 [71] scuttle_1.12.0              RcppAnnoy_0.0.21            pillar_1.9.0                nlme_3.1-164                compiler_4.3.2             
 [76] beachmat_2.18.0             RSpectra_0.16-1             stringi_1.8.3               tensor_1.5                  minqa_1.2.6                
 [81] plyr_1.8.9                  crayon_1.5.2                abind_1.4-5                 scater_1.30.1               locfit_1.5-9.8             
 [86] sp_2.1-2                    graphlayouts_1.0.2          sandwich_3.1-0              textshaping_0.3.7           codetools_0.2-19           
 [91] multcomp_1.4-25             BiocSingular_1.18.0         openssl_2.1.1               GetoptLong_1.0.5            plotly_4.10.3              
 [96] mime_0.12                   circlize_0.4.15             Rcpp_1.0.11                 fastDummies_1.7.3           sparseMatrixStats_1.14.0   
[101] interp_1.1-5                utf8_1.2.4                  clue_0.3-65                 lme4_1.1-35.1               listenv_0.9.0              
[106] nnls_1.5                    DelayedMatrixStats_1.24.0   ggsignif_0.6.4              statmod_1.5.0               tzdb_0.4.0                 
[111] pheatmap_1.0.12             tweenr_2.0.2                pkgconfig_2.0.3             tools_4.3.2                 RhpcBLASctl_0.23-42        
[116] viridisLite_0.4.2           fastmap_1.1.1               rmarkdown_2.25              scales_1.3.0                grid_4.3.2                 
[121] ica_1.0-3                   Seurat_5.0.1                broom_1.0.5                 patchwork_1.1.3             dotCall64_1.1-1            
[126] graph_1.80.0                carData_3.0-5               RANN_2.6.1                  farver_2.1.1                tidygraph_1.3.0            
[131] yaml_2.3.8                  latticeExtra_0.6-30         cli_3.6.2                   leiden_0.4.3.1              lifecycle_1.0.4            
[136] askpass_1.2.0               mvtnorm_1.2-4               backports_1.4.1             BiocParallel_1.36.0         changepoint_2.2.4          
[141] cytolib_2.14.0              timechange_0.2.0            gtable_0.3.4                rjson_0.2.21                umap_0.2.10.0              
[146] ggridges_0.5.5              progressr_0.14.0            jsonlite_1.8.8              edgeR_4.0.3                 RcppHNSW_0.5.0             
[151] bitops_1.0-7                Rtsne_0.17                  FlowSOM_2.10.0              spatstat.utils_3.0-4        BiocNeighbors_1.20.1       
[156] SeuratObject_5.0.1          rrcov_1.7-4                 lazyeval_0.2.2              shiny_1.8.0                 ConsensusClusterPlus_1.66.0
[161] htmltools_0.5.7             sctransform_0.4.1           spam_2.10-0                 XVector_0.42.0              mclust_6.0.1               
[166] ks_1.14.1                   mnormt_2.1.1                jpeg_0.1-10                 gridExtra_2.3               boot_1.3-28.1              
[171] igraph_1.6.0                R6_2.5.1                    labeling_0.4.3              cluster_2.1.6               IDPmisc_1.1.20             
[176] nloptr_2.0.3                DelayedArray_0.28.0         tidyselect_1.2.0            vipor_0.4.7                 plotrix_3.8-4              
[181] ggforce_0.4.1               car_3.1-2                   future_1.33.0               filesstrings_3.2.4          rsvd_1.0.5                 
[186] munsell_0.5.0               KernSmooth_2.23-22          data.table_1.14.10          htmlwidgets_1.6.4           ComplexHeatmap_2.18.0      
[191] rlang_1.1.2                 spatstat.sparse_3.0-3       spatstat.explore_3.2-5      colorRamps_2.3.1            ggnewscale_0.4.9           
[196] fansi_1.0.6                 beeswarm_0.4.0             
jgarces02 commented 8 months ago

Hi @margarida-ppedro, thanks for reaching out. Can you please run BiocManager::valid() and show me the output?

margarida-ppedro commented 8 months ago

Hi @jgarces02! Thank you for your quick reply!

This is the output:

BiocManager::valid()
'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
    CRAN: https://cran.rstudio.com/
[1] TRUE

Thanks.

margarida-ppedro commented 6 months ago

Hi @jgarces02, Do you have any update on this topic? Thank you so much for all the attention. Best, Margarida Pedro

jgarces02 commented 6 months ago

Hi @margarida-ppedro, could you please install the devel version and tell me if it works?

devtools::install_github("paiva-s-lab/FlowCT", ref = "devel", force = T)

jgarces02 commented 5 months ago

I'm closing this issue. Please, feel free to re-open it again if needed. Thanks.