Entering edit mode
Hi,
I am a newbie to flow cytometry and R and trying to get MFI stats from my data. I tried following this wiki: wiki. I also looked at this resource: pdf. When I run the gs_pop_get_stats()
it gives me an empty/Null data.table. When I tried doing it manually in FlowJo, I am able to get MFI and rSD. I would like both using R, is this possible? I'm probably not understanding a basic principle, would anyone be kind enough to educate me? Thanks.
one of the FCS files:
My attempt:
library(flowCore)
parentpath <- "parent/path"
subfolder <- "subfolder_name"
fcs_files <- list.files(paste0(parentpath, subfolder), pattern = ".fcs")
fs <- read.flowSet(fcs_files)
gs <- GatingSet(fs[7])
rect.g <- rectangleGate(filterId = "main", list("FSC-A" = c(100000, 170000), "SSC-A" = c(30000,62000)))
rect.g2 <- rectangleGate(filterId = "sec", "V-450-A"=c(1.5e4, 4.8e4))
gs_pop_add(gs, rect.g)
gs_pop_add(gs, rect.g2)
recompute(gs)
autoplot(gs, "main")
gs_pop_get_stats(gs, "sec", type = pop.MFI)
>>Null data.table (0 rows and 0 cols)
sessionInfo( )
R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rvg_0.2.5 officer_0.3.18 magrittr_2.0.1 ggcyto_1.14.1 flowWorkspace_3.34.1 ncdfFlow_2.32.0 BH_1.75.0-0
[8] RcppArmadillo_0.10.4.0.0 ggplot2_3.3.3 gridExtra_2.3 flowCore_1.52.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 lattice_0.20-44 png_0.1-7 assertthat_0.2.1 digest_0.6.27 utf8_1.2.1 R6_2.5.0 plyr_1.8.6 stats4_3.6.0
[10] evaluate_0.14 pillar_1.6.0 zlibbioc_1.32.0 gdtools_0.2.3 rlang_0.4.10 uuid_0.1-4 rstudioapi_0.13 data.table_1.14.0 Rgraphviz_2.30.0
[19] hexbin_1.28.2 flextable_0.6.5 rmarkdown_2.7 labeling_0.4.2 stringr_1.4.0 munsell_0.5.0 compiler_3.6.0 xfun_0.22 pkgconfig_2.0.3
[28] systemfonts_1.0.1 BiocGenerics_0.32.0 base64enc_0.1-3 IDPmisc_1.1.20 htmltools_0.5.1.1 tidyselect_1.1.1 tibble_3.1.1 matrixStats_0.58.0 fansi_0.4.2
[37] flowViz_1.50.0 crayon_1.4.1 dplyr_1.0.5 withr_2.4.2 MASS_7.3-54 grid_3.6.0 gtable_0.3.0 lifecycle_1.0.0 DBI_1.1.1
[46] scales_1.1.1 RcppParallel_5.1.3 graph_1.64.0 KernSmooth_2.23-20 zip_2.1.1 stringi_1.5.3 renv_0.13.2 farver_2.1.0 latticeExtra_0.6-29
[55] xml2_1.3.2 ellipsis_0.3.2 generics_0.1.0 vctrs_0.3.8 RColorBrewer_1.1-2 tools_3.6.0 Biobase_2.46.0 glue_1.4.2 purrr_0.3.4
[64] jpeg_0.1-8.1 parallel_3.6.0 colorspace_2.0-0 knitr_1.33
>
Can you grant the public caccess to you fcs to reproduce your issue?