RGLab / MAST

Tools and methods for analysis of single cell assay data in R
224 stars 57 forks source link

Using model-based variance estimates instead of bootstraps #96

Closed dmoaks closed 6 years ago

dmoaks commented 6 years ago

Hello,

I am trying to save computational time and use "modelbased" as the "var_estimate" parameter of the gseaAfterBoot function. However, the function is not working because it seems to require the "boots" input even when it doesn't use it. Can you post example code of how to properly use the "modelbased" parameter?

amcdavid commented 6 years ago

At the moment, you need to pass in 2 bootstrap replicates. These are just used to get the dimensions of some arrays that hold the result. This is not intrinsically necessary, and can/should be fixed.

 data(vbetaFA)
 vb1 = subset(vbetaFA, ncells==1)
 vb1 = vb1[,freq(vb1)>.1][1:15,]
 zf = zlm(~Stim.Condition, vb1)
 boots = bootVcov1(zf, 2)
 sets=list(A=1:5, B=3:10, C=15, D=1:5)
 gsea=gseaAfterBoot(zf, boots, sets, CoefficientHypothesis('Stim.ConditionUnstim'), control = list(var_estimate = 'modelbased', n_randomize = Inf))
amcdavid commented 6 years ago

Closed in 04e17c31f0b28d1503d197b51846026e403835d2