Fisher's exact test for comparing TCR clonotype counts
Entering edit mode
8 months ago
pm2012 ▴ 110

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.

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


R TCR-seq • 223 views

Login before adding your answer.

Traffic: 1961 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6