-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update GIN #87
base: main
Are you sure you want to change the base?
Update GIN #87
Changes from all commits
a282d62
89b80f1
fcbafd3
200d833
0db446d
9ad04fa
1b2d4c7
5229b06
ebb808b
9299ea2
36d5d4b
c92cb8f
4f168e8
e307426
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,21 @@ | ||||||||||||||
import math | ||||||||||||||
from scipy.stats import chi2 | ||||||||||||||
|
||||||||||||||
def FisherTest(pvals, alpha = 0.01): | ||||||||||||||
Fisher_Stat = 0 | ||||||||||||||
L = len(pvals) | ||||||||||||||
for i in range(0,L): | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. address this? |
||||||||||||||
if pvals[i] == 0: | ||||||||||||||
TP = 1e-05 | ||||||||||||||
else: | ||||||||||||||
TP = pvals[i] | ||||||||||||||
|
||||||||||||||
Fisher_Stat = Fisher_Stat - 2*math.log(TP) | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
||||||||||||||
Fisher_pval = 1 - chi2.cdf(Fisher_Stat, 2*L) | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
||||||||||||||
if Fisher_pval >alpha: | ||||||||||||||
return True, Fisher_pval | ||||||||||||||
else: | ||||||||||||||
return False, Fisher_pval | ||||||||||||||
Comment on lines
+17
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.