wasabi icon indicating copy to clipboard operation
wasabi copied to clipboard

Error in if (sum(valid) == 0) { : missing value where TRUE/FALSE needed

Open antonkulaga opened this issue 6 years ago • 3 comments

After seeing hdf5 issue fixed I have another problem, when I run

so <- sleuth_fit(so, ~condition, 'full')

I get the following error:

fitting measurement error models
shrinkage estimation
Error in if (sum(valid) == 0) { : missing value where TRUE/FALSE needed

The files are the same: http://agingkills.westeurope.cloudapp.azure.com/pipelines/samples/GSE36041/ The code I use is:

install.packages('tidyverse', dependencies=TRUE, type="source")
library("sleuth")
require(tidyverse)
require(purrr)
require(stringr)
devtools::install_github("COMBINE-lab/wasabi") #with fixed rhdf5
library(wasabi)

base <- file.path("/home", "rstudio", "samples")
#GSM1696274,GSM1696275,GSM1696276	
#GSM1696271,GSM1696272,GSM1696273


samples <- c("GSM1696274", "GSM1696271")
quant <- "transcripts_quant"
pathes <- map_chr(samples, function(s) str_c(base, "/", s, "/", quant))
prepare_fish_for_sleuth(pathes)

conditions <- c("one", "two")

s2c = data.frame(
sample = samples,
condition = conditions,
path = pathes,
stringsAsFactors=FALSE
)
so <- sleuth_prep(s2c, extra_bootstrap_summary = TRUE)
so <- sleuth_fit(so, ~condition, 'full') #it breaks here!

antonkulaga avatar Sep 02 '18 11:09 antonkulaga

It's hard to say exactly what the problem is from this error alone. Can you try a traceback()1st to see which function is giving that error or error(recover=TRUE)1st to dive into the function right before the error? This will help narrow down where things could be going wrong.

rob-p avatar Sep 02 '18 20:09 rob-p

Sorry for the slow reply. So, for traceback() I get:

6: get_quantile(., y_col, lwr, upr, ignore_zeroes)
5: overscope_eval_next(overscope, args[[j]])
4: do.grouped_df(data, get_quantile(., y_col, lwr, upr, ignore_zeroes))
3: do(data, get_quantile(., y_col, lwr, upr, ignore_zeroes))
2: sliding_window_grouping(mes_df, "mean_obs", "sigma_sq_pmax", 
       n_bins = n_bins, lwr = lwr, upr = upr, ignore_zeroes = TRUE)
1: sleuth_fit(so, ~condition, "full")

When I do recover I see: "Error during wrapup: missing value where TRUE/FALSE needed"

antonkulaga avatar Sep 17 '18 16:09 antonkulaga

same error. Have you found a solution?

yanwengong avatar Dec 09 '21 01:12 yanwengong