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 in if (spvaltext2 == 0) { : missing value where TRUE/FALSE needed #23

Open
LefterisZ opened this issue Oct 1, 2021 · 1 comment

Comments

@LefterisZ
Copy link

LefterisZ commented Oct 1, 2021

Hi,

I have been trying to make BatchQC work for the past two days to no avail. I keep getting the below error:

  Quitting from lines 256-274 (batchqc_report.Rmd) 
  Error in if (spvaltext2 == 0) { : missing value where TRUE/FALSE needed

Having a closer look the problem seemed to appear in lines 263-264:

pval <- batchQC_shapeVariation(lcounts_adj, batch, plot = TRUE, groupCol = 
     rainbow(nlevels(bf))[bf])

Inside the batchQC_shapeVariation function, I tried to narrow down the problem to see where it occurs. My findings were that in line 34 (batch_ps <- batchEffectPvalue(gnormdata, sortgroups, robust=robustGene)) the function batchEffectPvalue returns the below:

 batch_ps      Named num [1:4] 0 0 NaN NaN

These two NaNs are producing the problem since the NaN in the if (spvaltext2 == 0) { cannot give TRUE or FALSE.

Inside the function batchEffectPvalue everything seems to run smoothly until we reach the

  skewbatch <- unlist(lapply(1:length(batch2), function(x) apply(data[,batch2[[x]]], 1, skewness)))
  kurtbatch <- unlist(lapply(1:length(batch2), function(x) apply(data[,batch2[[x]]], 1, kurtosis)))

By having a look at the skewbatch and kurtbatch objects I saw that there are some NaNs present. I believe that this is causing the problem downstream.

Now, I don't know whether this is a problem of skewness and kurtosis functions or is a problem with my data. I tried both raw counts and quantile normalized read counts (as suggested by you). I also filtered the quantile normalized counts for low standard deviation and made sure that none of my batches contain genes with only zeroes (as suggested in your website). I don't know what else I can do. I even thought of adding a 0 in the report_option_binary option to skip the creation of this graph but I am not sure about that since I might be leaving out an important part of the batchQC analysis.

Can you please help me?

Best regards,
Lefteris

PhD candidate, Newcastle University, UK

@mani2012
Copy link
Owner

mani2012 commented Oct 1, 2021 via email

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

2 participants