fisher test on row
1
0
Entering edit mode
9.7 years ago
yasjas ▴ 70
                     tissu1       tissu 2              total in genome
(A)n                 92           89                   13606
(AAATG)n             0            1                    372
(AACTG)n             0            0                    11
(AAGTG)n             0            0                    21
(AATAG)n             1            1                    159
(AATTG)n             1            0                    96

I have a question on how to make a fisher test to see if some the elements are more present in tissu 1 than 2 I couldn't manage to do it for each row.any help please?

R • 3.3k views
ADD COMMENT
1
Entering edit mode
9.7 years ago

For a Fisher's exact test you have to create a contingency table with two rows and two columns.

Column names: Proteins existing in tissue 1, Proteins not existing in tissue 1

Row names: Proteins existing in tissue 2, Proteins not existing in tissue 2

If this table means that there is no shared protein between tissue 1 and tissue 2, then in R you can do:

mat$Fisher.Pvalue = apply(mat,1,function(x){return(fisher.test(matrix(c(0,x[2],x[1],x[3]-x[2]-x[1]),nrow=2))[[1]])})
ADD COMMENT
0
Entering edit mode

I assume you mean:

apply(mat, 1, function(x) fisher.test(rbind(x[1:2],x[3]-x[1:2]))$p.value)
ADD REPLY

Login before adding your answer.

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