Fisher's exact test for comparing TCR clonotype counts
0
0
Entering edit mode
3.5 years ago
pm2012 ▴ 140

I am trying to apply Fisher's exact test in R for a matrix which contains count data for a TCR-seq dataset. Each row in the matrix is a different tcr clonotype and each column represents different conditions. The cells have normalized counts (to account for sequencing depth differences) for each tcr for each condition. I want to apply fisher's exact test to test each tcr against rest of the tcr to test null hypothesis that they are not different between conditions.

I am looking for a solution similar to the following line of code that iterates over the full matrix and provides me with a p-value.

apply(tab, 1, function(x) fisher.test(matrix(x,nrow=2,ncol=2))$p.value)

How do I set this up in R?Any suggestions are welcome.

This approach was applied in the following paper. However, since I am not a statistician, I couldn't apply the notations to my script very well.

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4442358/

This is similar to the question that has been asked below (but in the context of gene expression).

https://stats.stackexchange.com/questions/201586/fishers-exact-test-in-rna-seq?newreg=6c8ab398c53c425ebc2f7e380a3cb15c

Thanks.

R TCR-seq • 812 views
ADD COMMENT

Login before adding your answer.

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