Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running BuildSOM on FlowCAP data #4

Open
jess310t opened this issue May 7, 2021 · 1 comment
Open

Error running BuildSOM on FlowCAP data #4

jess310t opened this issue May 7, 2021 · 1 comment

Comments

@jess310t
Copy link

jess310t commented May 7, 2021

Hi, Thanks for sharing the code first.
I was running into the same issue, with the flowCAP ND data -- I didn't try the other datasets.

I also looked into the vignette and tried to use their example code with the package included sample datasets.
Their sample code and sample datasets worked all just fine without error.

Here's the sample code I used:

fileName <- system.file("extdata", "68983.fcs", package="FlowSOM")
ff <- flowCore::read.FCS(fileName)
flowSOM.res <- FlowSOM::ReadInput(ff,scale=FALSE, transform=FALSE)
flowSOM.res <- FlowSOM::BuildSOM(flowSOM.res,colsToUse=c(9,12,14:18))

I compared the flowSOM object after ReadInput and there was no obvious difference between loading your datasets and the sample datasets. I wonder if you have any insights on what the problem may be?

The error that I received is:

Error in if (length(y) > 0 && mean(y) != 0) {: missing value where TRUE/FALSE needed
Traceback:

1. system.time({
 .     fSOM <- FlowSOM::ReadInput(data[[j]], transform = FALSE, 
 .         scale = FALSE)
 .     fSOM <- FlowSOM::BuildSOM(fSOM, colsToUse = c(3:12), xdim = grid_size, 
 .         ydim = grid_size)
 .     fSOM <- FlowSOM::BuildMST(fSOM)
 . })
2. FlowSOM::BuildSOM(fSOM, colsToUse = c(3:12), xdim = grid_size, 
 .     ydim = grid_size)
3. UpdateDerivedValues(fsom)
4. t(sapply(seq_len(fsom$map$nNodes), function(i) {
 .     apply(subset(fsom$data, fsom$map$mapping[, 1] == i), 2, function(y) {
 .         if (length(y) > 0 && mean(y) != 0) {
 .             stats::sd(y)/mean(y)
 .         }
 .         else {
 .             NA
 .         }
 .     })
 . }))
5. sapply(seq_len(fsom$map$nNodes), function(i) {
 .     apply(subset(fsom$data, fsom$map$mapping[, 1] == i), 2, function(y) {
 .         if (length(y) > 0 && mean(y) != 0) {
 .             stats::sd(y)/mean(y)
 .         }
 .         else {
 .             NA
 .         }
 .     })
 . })
6. lapply(X = X, FUN = FUN, ...)
7. FUN(X[[i]], ...)
8. apply(subset(fsom$data, fsom$map$mapping[, 1] == i), 2, function(y) {
 .     if (length(y) > 0 && mean(y) != 0) {
 .         stats::sd(y)/mean(y)
 .     }
 .     else {
 .         NA
 .     }
 . })
9. FUN(newX[, i], ...)

@jess310t
Copy link
Author

jess310t commented May 7, 2021

To be more exact I was using the dataset FlowCAP_ND.fcs from https://flowrepository.org/id/FR-FCM-ZZPH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant