Why mafdr works only for one threshold?
Show older comments
hi! i have an array of p-values and i put him in mafdr() and it works fine. when i try to threshold this array of p-values and put the new array(array with values less than a threshold) in mafdr i get this error
??? Error using ==> mtimes Inner matrix dimensions must agree.
Error in ==> mafdr>storeyFDR at 239 fdr = pi0 * v./r;
Error in ==> mafdr at 190 [fdr, q, pi0_all, pi0, cs, rs] = storeyFDR(p, lambda, bootflag);
the only threshold that works for me is 0.05!!! i use matlab 2010a...whats wrong...?
Answers (2)
Enrico Glerean
on 13 Jan 2016
2 votes
The error means that it fails to estimate the a-priori probability with the default value of Lambda [0.01:0.01:0.95].
You should specify a wider range of Lambda to run the command successfully. For example:
mafdr(p,'LAMBDA',[0.0001:0.01:0.95])
Please also note that you should not use fdr on thresholded p-values. By considering only the p values under 0.05 you are not controlling for multiple comparisons anymore and you are biasing your results (in neuroscience they often call this "double-dipping").
Sean de Wolski
on 9 Sep 2014
My guess is you've accidentally shadowed one of the earlier functions used by mafdr's storeyFDR so that it's calling your function instead of MATLAB's. This is a very common thing and is usually the cause of this type of error. Here are a few candidates, you can run which -all to tell you which one is being called and where the offending file is:
which -all sort
which -all min
which -all size
6 Comments
hmmaros
on 9 Sep 2014
Sean de Wolski
on 9 Sep 2014
I would stop in debug mode and then look at the previous lines:
dbstop if error
This will stop at the offending line. Look at functions a few lines up and which -all them to see which one is being called. If it's not MATLAB's version of the function, that is probably what is throwing the error.
hmmaros
on 9 Sep 2014
Sean de Wolski
on 10 Sep 2014
which -all functionname
If the path starts with the output from
matlabroot
Then it's part of MATLAB, otherwise it's yours.
hmmaros
on 15 Sep 2014
Sean de Wolski
on 15 Sep 2014
Contact tech support, they can walk you through it.
Categories
Find more on Genomics and Next Generation Sequencing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!