mengyin/vashr

Version issue with ashr_2.1-25

Opened this issue · 3 comments

Hi there,

There seems to be a versioning issue with ashr_2.1-25 for the function comppostprob. I was running the RNA-Seq part of your vignette and when I ran:

 fit.vash <- vash(sehat=sehat, df=fit$df.residual[1], 
             betahat=betahat, scale=fit$stdev.unscaled[,2])

I got the error:

 'comppostprob' could not be found.'

In the updated ashr I guess the function was renamed to comp_postprob, but it also takes in a different number of parameters such that when I tried the above after changing line 129 in vash.R with the updated function name and rebuilding I got the following error:

 Error in comp_postprob(mix.fit$g, rep(numeric(0), n), sehat[completeobs],  : 
   unused arguments (sehat[completeobs], df) 

Since comp_postprob takes in 2 variables, comp_postprob(m (mixture distriubtion with k components), data) I tried changing line 129 of vash.R to:
postpi.se[completeobs,] = t(comp_postprob(mix.fit$g, sehat[completeobs]))

and got the error

  Error in data$x : $ operator is invalid for atomic vectors .

Could you trouble-shoot this code for the updated ashr version?

oops! Thanks for catching this.

I think it should be:
postpi.se[completeobs,] = t(comp_postprob(mix.fit$g, data = list(s=sehat[completeobs],v=df)))

@mengyin can you fix this?

@eacton Thanks for reporting the issue! I just fixed it. Please let me know if it doesn't work.

@mengyin @stephens999 Great! Thanks. I'll check it out. I am trying to use the adaptive shinkage for RNA-Seq data without normalizing for library size since I am putting the data into a model that accounts for library size but not gene dispersion. Is there a function in the vashr or ashr package that allows me retrieve the adjusted count data?