2
$\begingroup$

This is a continuation of the following question -

Fisher's exact test for COG categories in pan, core genome analysis

Also, the dataset -

COG categories dataset

How do I perform a Fisher's exact test on this data to show that a COG category is significantly more or less in the pan/core/accessory/species specific genomes?

$\endgroup$
2
  • 1
    $\begingroup$ I'll post a response late Monday, sorry really busy. Basically you can do spot checks via Fishers Exact test or go the whole hog and do a Chi2 test. The matrix you have is pan/core vs cogs. $\endgroup$
    – M__
    Commented Mar 1 at 14:11
  • $\begingroup$ Hi @M__, good to know. Thanks a lot! $\endgroup$
    – K_081
    Commented Mar 1 at 14:29

1 Answer 1

1
$\begingroup$

What I would personally do is run a Χ2

from scipy.stats import chisquare
import numpy as np

pan = [11, 39, 4 ....]
core = [29, 50, 7 ... ]
f_exp = np.array(pan)
f_obs = np. array(core)
print (chisquare(f_obs=f_obs, f_exp=f_exp))

This will output the total statistic and whether its above or below the critical probability.

Fisher's Exact test is essentially Χ2 for a small number of observations, which is not the case with your data.

Looking at your data Χ2 is not likely to be "significant" (which is the result you are looking for), i.e. the pan genome is the core genome across all COGs.

$\endgroup$
1
  • 1
    $\begingroup$ Thank you very much for all your efforts @M__ ! Hopefully, this works. $\endgroup$
    – K_081
    Commented Mar 5 at 5:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.