Closed peterch405 closed 8 years ago
Hi Peter,
The flowframes certainly do not need to have an equal number of events. I'm not sure where this error comes from, could you let me know what your data_names variable contains?
Here you have an example of how to use the function, I will add this example to the documentation of the package as this was apparently still missing. (I'm using the sample file added to the package, so the generation of new files to compare is a bit forced, but this helps in demonstrating files with a differing number of cells)
library(FlowSOM) set.seed(1)
fileName <- system.file("extdata","lymphocytes.fcs",package="FlowSOM") flowSOM.res <- FlowSOM(fileName, compensate=TRUE,transform=TRUE, scale=TRUE,colsToUse=c(9,12,14:18),nClus = 10)
PlotStars(flowSOM.res[[1]],backgroundValues = as.factor(flowSOM.res[[2]]))
ff <- flowCore::read.FCS(fileName) ff_tmp <- ff[flowSOM.res[[1]]$map$mapping[,1] %in% which(flowSOM.res[[2]] != 7),] flowCore::write.FCS(ff_tmp,file="ff_tmp.fcs")
ff_tmp <- ff[c(which(flowSOM.res[[1]]$map$mapping[,1] %in% which(flowSOM.res[[2]] != 7)), which(flowSOM.res[[1]]$map$mapping[,1] %in% which(flowSOM.res[[2]] == 5))),] flowCore::write.FCS(ff_tmp,file="ff_tmp2.fcs")
groupRes <- CountGroups(flowSOM.res[[1]], groups=list("AllCells"=c(fileName),"Without_ydTcells"=c("ff_tmp.fcs","ff_tmp2.fcs"))) PlotGroups(flowSOM.res[[1]], groupRes)
groupRes <- CountGroups(flowSOM.res[[1]], groups=list("AllCells"=c(fileName),"Without_ydTcells"=c("ff_tmp2.fcs"))) PlotGroups(flowSOM.res[[1]], groupRes)
Thank you for the example. My data_names
were wrong, which caused the error.
Tried running this:
groups <- CountGroups(fSOM_all, data_names, plot = TRUE, silent = FALSE)
and got this error:
The plots are produced but when trying to do:
PlotGroups(fSOM_all, groups, view = "MST")
I get:
Error in groups$means : object of type 'closure' is not subsettable
Does the error message imply that the flowframes supplied to
ReadInput
have to have equal number of events?