This is a test version of Biostars. For the public version, visit https://www.biostars.org.
sva batch correction error

Hi everyone, I state that II'm new with this kind of analysis. I created a normalized count matrix of RNA-seq data using the upper quartile method. Well, what interests me is to remove the batch effects observed with the PCA. I want to use sva tool, and after reading the tutoriial vignette, I created my data, but when i apply sva(), i am sent back the following error:

svobj = svaseq(edata,mod,mod0,n.sv=n.sv)

Number of significant surrogate variables is:  6 
Iteration (out of 5 ):Error in density.default(x, adjust = adj) : 'x' contains missing values

I don't understand well what could be my error, because I followed some posts about this but I didn't find a good resolution. Here I post my data:

head(assayData)

                          t1          t2          t3          t4            D_1          D_2          D_3          D_4
Xkr4           1.364613e+00 0.000000e+00 0.000000e+00 0.000000e+00 8.763967e-01 2.963667e-01 1.448452e+00 0.000000e+00
Gm37363        5.817520e-01 3.732263e-01 4.301386e-01 0.000000e+00 0.000000e+00 1.181264e+00 0.000000e+00 2.675606e+00
Gm38148        0.000000e+00 0.000000e+00 8.572272e-01 0.000000e+00 0.000000e+00 2.350076e-01 1.122903e+00 0.000000e+00
Gm19938        4.379318e+00 1.362470e+00 0.000000e+00 0.000000e+00 9.080535e-01 2.656521e+00 2.350880e+00 5.885607e-01
Rp1            0.000000e+00 7.250770e-01 0.000000e+00 1.028768e+00 0.000000e+00 2.527275e-01 1.951990e-01 0.000000e+00
Sox17          3.902733e+01 3.198295e+01 2.494253e+01 1.855771e+01 4.680339e+01 2.997644e+01 3.296480e+01 3.805357e+01


phenoData <- data.frame(row.names = c("t1", "t2", "t3", "t4", "4D_1", "4D_2", "4D_3", "4D_4"), 

                       condition = c("control","control","control","control", "case","case","case","case"))

metadata <- data.frame(labelDescription = "condition", 
                       row.names = "condition" ) 
pData <- AnnotatedDataFrame(data=phenoData, varMetadata = metadata)
ExpressionSet <-  ExpressionSet(assayData, phenoData=pData)

pheno = pData(ExpressionSet)
edata = exprs(ExpressionSet)
mod = model.matrix(~as.factor(condition), data=pheno)
mod0 = model.matrix(~1, data=pheno)

n.sv = num.sv(edata,mod,method="leek")
svobj = sva(edata,mod,mod0,n.sv=n.sv)

I converted my variable as factor and i don't need any covariiates. I also tried with svaseq but the error message is the same. I will appreciate your help. thank you

sva r rna-seq

0 answers

No answers yet.

Log in to answer this question.