Plotting kmeansFilter in xyplot - error
Opened this issue · 0 comments
wptmdoorn commented
Describe the bug
I am trying to apply a kmeansFilter
to a flowFrame
and then plot the different clusters using xyplot
. According to https://www.bioconductor.org/packages/devel/bioc/vignettes/flowViz/inst/doc/filters.html this should be possible.
Filtering works, but then the xyplot produces an issue, see below.
To Reproduce
See code below.
library(ggplot2)
library(flowCore)
library(flowViz)
#> Loading required package: lattice
data(GvHD)
data <- GvHD[[1]]
kf <- flowCore::kmeansFilter(
"SSC-H" = c("Pop1", "Pop2"),
filterId = "myKmFilter"
)
kf.results <- flowCore::filter(data, kf)
print(summary(kf.results))
#> Pop1: 3060 of 3420 events (89.47%)
#> Pop2: 360 of 3420 events (10.53%)
flowViz::xyplot(`SSC-H` ~ `FSC-H`, data = data, filter = kf.results)
Expected behavior
I would expect the xyplot to show the different clusters.
Screenshots
The error is in the plot below. I don't why it tells me I provided it frame V1 as I supply it with data = data
.
Thank you very much in advance.
sessionInfo():
> sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
Matrix products: default
locale:
[1] LC_COLLATE=Dutch_Netherlands.utf8 LC_CTYPE=Dutch_Netherlands.utf8
[3] LC_MONETARY=Dutch_Netherlands.utf8 LC_NUMERIC=C
[5] LC_TIME=Dutch_Netherlands.utf8
time zone: Europe/Paris
tzcode source: internal
attached base packages:
[1] stats graphics grDevices datasets utils methods base
other attached packages:
[1] reprex_2.0.2 flowPeaks_1.46.0 flowViz_1.64.0 lattice_0.21-8
[5] flowCore_2.12.0 scales_1.2.1 ggplot2_3.4.2
loaded via a namespace (and not attached):
[1] gtable_0.3.3 xfun_0.39 processx_3.8.1
[4] latticeExtra_0.6-30 Biobase_2.60.0 callr_3.7.3
[7] ps_1.7.5 vctrs_0.6.3 tools_4.3.1
[10] generics_0.1.3 stats4_4.3.1 tibble_3.2.1
[13] flowWorkspace_4.12.0 fansi_1.0.4 pkgconfig_2.0.3
[16] R.oo_1.25.0 KernSmooth_2.23-21 data.table_1.14.8
[19] RColorBrewer_1.1-3 S4Vectors_0.38.1 graph_1.78.0
[22] lifecycle_1.0.3 R.cache_0.16.0 compiler_4.3.1
[25] farver_2.1.1 deldir_1.0-9 munsell_0.5.0
[28] htmltools_0.5.5 yaml_2.3.7 hexbin_1.28.3
[31] pillar_1.9.0 MASS_7.3-60 R.utils_2.12.2
[34] RProtoBufLib_2.12.0 styler_1.10.1 tidyselect_1.2.0
[37] digest_0.6.31 dplyr_1.1.2 purrr_1.0.1
[40] labeling_0.4.2 fastmap_1.1.1 grid_4.3.1
[43] colorspace_2.1-0 cli_3.6.1 magrittr_2.0.3
[46] ncdfFlow_2.46.0 XML_3.99-0.14 utf8_1.2.3
[49] clipr_0.8.0 withr_2.5.0 rmarkdown_2.23
[52] matrixStats_1.0.0 jpeg_0.1-10 interp_1.1-4
[55] cytolib_2.12.0 png_0.1-8 R.methodsS3_1.8.2
[58] evaluate_0.21 knitr_1.43 rlang_1.1.1
[61] Rcpp_1.0.10 glue_1.6.2 Rgraphviz_2.44.0
[64] BiocManager_1.30.21 renv_0.17.3 BiocGenerics_0.46.0
[67] rstudioapi_0.15.0 jsonlite_1.8.5 R6_2.5.1
[70] IDPmisc_1.1.20 fs_1.6.2 zlibbioc_1.46.0