Closed romunov closed 3 years ago
I found the reason, because some gene expression levels are 0 in all samples. you can add these code to check the data: exp_mean <- apply(exp,1,mean) filter_gene <- rownames(subset(exp_mean ,exp_mean ==0)) exp_mean2 <-exp_mean [-which(rownames(exp_mean ) %in% filter_gene),] you should remove these genes.
Hello, I am also getting the same error. I've filtered for all genes with 0 gene expression, and the min mean expression in my matrix is 0.013:
sva_out <- sva(
- monocytes_mat,
- mod = biovar,
- mod0 = adjvar) Number of significant surrogate variables is: 6 Iteration (out of 5 ):Error in density.default(x, adjust = adj) : 'x' contains missing values In addition: Warning message: In pf(fstats, df1 = (df1 - df0), df2 = (n - df1)) : NaNs produced min(rowMeans(monocytes_mat)) [1] 0.01336896
Got the above error when I tried to use the null model as model of interest (assuming I don't have any other variable available).
Using a variables in the model solved the problem