Sam In R, Value Out Of Range In 'Gammafn'
1
0
Entering edit mode
13.0 years ago
C Shao ▴ 140

Hi,

I am running sam in R (package: "samr"). The sample size is 270+. After permutation, there is warning message: "In factorial(length(y)) : value out of range in 'gammafn' "

Any ideas about this warning? or I have to switch to simple ttest?

Thanks in advance!

r microarray • 14k views
ADD COMMENT
0
Entering edit mode
13.0 years ago

Factorial uses the gamma function. I think factorial() breaks down after N gets sufficiently large because the results get astronomical; see discussion here. In particular, I'll quote:

The factorial of x, x! is given by the gamma function +1 ; gamma (x+1).

Therefore use ?gamma in r. factorial of 100; gamma(100+1)

170 is likely too large for the standard gamma function so use the log

gamma function (for example the factorial of 200): lgamma(200+1) is

863.232, so the factorial of 200 is e^863.232. Does this help?

I think the problem is occuring when SAM is attempting permutation analysis; you could try dropping the permutations (which would preserve the modification to the t-test that SAM uses to reduce the variance contribution of genes expressed at low levels at the expense of losing your multiple test correction by permutation, so you have to do it another way) or you could partition your dataset and operate on a subset of the data. Neither option is ideal.

ADD COMMENT
0
Entering edit mode

Thanks for the reply. Using a subset will reduce the power, and I think permutations is necessary to get a reliable results.

I switched to limma, which is good in my case.

ADD REPLY

Login before adding your answer.

Traffic: 1333 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