I assume you mean:
apply(mat, 1, function(x) fisher.test(rbind(x[1:2],x[3]-x[1:2]))$p.value)
• 1 views
•
link
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?
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]])})
I assume you mean:
apply(mat, 1, function(x) fisher.test(rbind(x[1:2],x[3]-x[1:2]))$p.value)
Log in to answer this question.