Question: Fisher test in Rna seq
0
gravatar for g.k
8 months ago by
g.k0
g.k0 wrote:

Hello,

I would like to do rna seq data for several genes, tested in control and treatment.


To do fisher.test I need a contingency table for each gene, is there a way to do this in R instead of computing a contingency table for each gene?
I am new to this so any advice can be helpful.

I have the count data and the sample Info data,

                    control1 treated1 control2 treat2 control3 treat3
    ENSG00000000003        723        486        904        445       1170       1097 
    ENSG00000000005          0          0          0          0          0          0
    ENSG00000000419        467        523        616        371        582        781

Where ENSG are the genes

Thank you

rnaseq R rna-seq • 324 views
ADD COMMENTlink modified 4 weeks ago by Gordon Smyth38k • written 8 months ago by g.k0
2

Hello, it's not clear from your question what it is you are testing with your fisher.test. Are you trying to test enrichment of the transcript in one condition versus another? If so it might be better to use a dedicated package for rna seq such as DESeq2 rather than fisher.test.

I have used fisher.test to test enrichment of candidate gene sets compared to the reference for things such as GO terms or similar classification terms. If you want some advice on setting that up let me know.

ADD REPLYlink written 8 months ago by anna_stavrinides20
2

I'll echo what Anna said, but with more conviction: you absolutely should not use a fisher.test for this. Use edgeR, limma/voom, or DESeq2.

ADD REPLYlink written 8 months ago by Steve Lianoglou12k
Answer: Fisher test in Rna seq
0
gravatar for Gordon Smyth
4 weeks ago by
Gordon Smyth38k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth38k wrote:

The function nbinomTest in the edgeR package does the Fisher test you suggest. If counts is your matrix, then

Control<- rowSums( counts[,c(1,3,5)] )
Treated <- rowSums( counts[,c(2,4,6)] )
out <- nbinomTest(Control, Treated)

does all the Fisher tests. However, as Steve and Anna have commented, we strongly advise against this because it ignores biological variation and will drastically over-estimate the significance of any differences found.

It would seem from a casual look at the data you give that you actually have paired data whereby each treated sample is paired with a control sample. You should use limma, edgeR or DESeq2 to undertake a paired analysis with proper estimation of replicate to replicate variability.

ADD COMMENTlink modified 25 days ago • written 4 weeks ago by Gordon Smyth38k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 151 users visited in the last hour