Hi,
I'm trying to use the spillover function from the flowCore package.
I'm not sure what's wrong but any set of compensation samples (i.e. unstained and single stained) I use it on, I always get the same error:
Error in dimnames(x) <- dn :
length of 'dimnames' [1] not equal to array extent.
For example:
library(ggcyto) # Also attaches ggplot2, flowCore, ncdfFlow, RcppArmadillo, BH and flowWorkspace.
frames <- lapply(dir(system.file("extdata", "compdata", "data", package="flowCore"), full.names=TRUE),
read.FCS) # This is the example set from the package.
names(frames) <- sapply(frames, keyword, "SAMPLE ID")
fs <- as(frames, "flowSet")
spillover(fs, unstained = "NA", fsc = "FSC-Height", ssc = "SSC-Height", stain_match = "ordered")
> Error in dimnames(x) <- dn :
length of 'dimnames' [1] not equal to array extent
Thanks.
---------------
sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggcyto_1.4.1 flowWorkspace_3.24.4
[3] ncdfFlow_2.22.2 BH_1.65.0-1
[5] RcppArmadillo_0.8.300.1.0 ggplot2_2.2.1
[7] BiocInstaller_1.26.1 flowCore_1.42.3
loaded via a namespace (and not attached):
[1] pcaPP_1.9-72 Rcpp_0.12.14 bindr_0.1
[4] DEoptimR_1.0-8 compiler_3.4.2 RColorBrewer_1.1-2
[7] plyr_1.8.4 tools_3.4.2 zlibbioc_1.22.0
[10] tibble_1.3.4 gtable_0.2.0 lattice_0.20-35
[13] pkgconfig_2.0.1 rlang_0.1.4 graph_1.54.0
[16] Rgraphviz_2.20.0 yaml_2.1.16 parallel_3.4.2
[19] mvtnorm_1.0-6 hexbin_1.27.1 bindrcpp_0.2
[22] gridExtra_2.3 stringr_1.2.0 dplyr_0.7.4
[25] cluster_2.0.6 IDPmisc_1.1.17 stats4_3.4.2
[28] grid_3.4.2 glue_1.2.0 data.table_1.10.4-3
[31] robustbase_0.92-8 Biobase_2.36.2 R6_2.2.2
[34] rrcov_1.4-3 XML_3.98-1.9 latticeExtra_0.6-28
[37] magrittr_1.5 corpcor_1.6.9 scales_0.5.0
[40] matrixStats_0.52.2 BiocGenerics_0.22.1 MASS_7.3-47
[43] assertthat_0.2.0 colorspace_1.3-2 KernSmooth_2.23-15
[46] stringi_1.1.6 flowViz_1.40.0 lazyeval_0.2.1
[49] munsell_0.4.3
Thanks Mike. That works now. Apologies.
M
Many thanks Mike!
It could be helpful if you put this working example in the doc.
Just a small remark. Although this example only illustrates the usage, the diagonal is not equal to 1. From what I understand, the current code divides the matrix values by the maximum of the rows, but not the values on the diagonal. I think this makes a difference, but I may be wrong.
Best.