Problem with n.sv in sva package
2
0
Entering edit mode
daih • 0
@daih-8580
Last seen 7.4 years ago
United States

I'm trying to repeat sva function using sva package following the vignettes (October 2014).

library(sva)
library(bladderbatch)
library(pamr)
library(limma)
data(bladderdata)
pheno = pData(bladderEset)
edata = exprs(bladderEset)
mod = model.matrix(~as.factor(cancer), data=pheno)
mod0 = model.matrix(~1,data=pheno)
n.sv = num.sv(edata,mod,method="leek")
n.sv
[1] 2

why i got 2 not 4?

Thanks

-Shirley

 

 

batch effect sva • 2.9k views
ADD COMMENT
1
Entering edit mode
Jeff Leek ▴ 650
@jeff-leek-5015
Last seen 3.2 years ago
United States

Hi Shirley,

I think you got it right. It is the same number as in the vignette here: 

http://www.bioconductor.org/packages/release/bioc/vignettes/sva/inst/doc/sva.pdf

Best, 


Jeff

ADD COMMENT
0
Entering edit mode
daih • 0
@daih-8580
Last seen 7.4 years ago
United States

OK. But I got another problem when applying to my own data.

> n.sv = num.sv(edata2,mod,method="leek")
> n.sv 
[1] 14 
> svobj = sva(edata2,mod,mod0,n.sv=n.sv) 
Number of significant surrogate variables is:  14 
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
Error during wrapup: cannot open the connection  

Any suggestions?

Can I skip this step and directly run step "7 Applying the ComBat function to adjust for known batches" with this error message?

Thanks!

ADD COMMENT

Login before adding your answer.

Traffic: 684 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6