0
$\begingroup$

I'm trying to analyze dicodon usage in species: human, yeast, mouse, rat, and e coli. I have the frequencies and relative frequencies that each codon and dicodon appear in the respective genomes. I want to test to see if the dicodon frequency is random or not random based on the frequency of the codon. The basic logic is a dicodon (i.e. AAA-AAA) is made up of two codons (i.e. AAA and AAA). If the relative frequency of (AAA) is 0.05, then the expected relative frequency of (AAA-AAA) would be 0.05*0.05 = 0.025. The goal is to determine whether or not the differences between the expected relative dicodon frequencies can be explained by randomness. In regards to sample size, there are 64 codon frequencies and 4096 dicodon frequencies (64x64 codons).

$\endgroup$
0
$\begingroup$

This looks like a vanilla chi-square test of independence, see here: https://en.wikipedia.org/wiki/Pearson%27s_chi-squared_test#Test_of_independence

$\endgroup$
  • 1
    $\begingroup$ One issue is that some of the frequencies are zero for yeast, mouse, and e coli. I think that possesses an issue for the chi-squared test $\endgroup$ – rvwsc38 Oct 3 '16 at 21:42
  • $\begingroup$ I'm not sure that's the case. Let's say you expect some nonzero frequency of observations of one particular dicodon AAA-AAA, e.g. 2.5% of the time. But you don't observe it in 100 observations. Then your contribution to that sum of squares is (0-2.5)^2/2.5. It sounds like you're concerned about dividing by zero, but you should never have an expected number of occurences of 0 that yields a nonzero number of actual occurrences (this would be analogous to finding a new 65th codon in your data, which hints at a bigger problem). Shouldn't every entry in your expected 64x64 be nonzero? $\endgroup$ – Ray Oct 3 '16 at 21:46
  • $\begingroup$ Oh I misread the assumptions of the chi-square test. I thought there couldn't be any zero frequencies, but it's only for the expected frequencies. I originally had looked into the chi-square test, but ruled it out because I thought I couldn't have any observed frequencies of zero. Thanks for clearing up my misconception. How would you handle the degrees of freedom? Because essentially I'll have 4095 degrees of freedom, and I haven't found any tables for critical values with that many degrees of freedom $\endgroup$ – rvwsc38 Oct 3 '16 at 21:54
  • $\begingroup$ In general, as you get lots of degrees of freedom, you'll have something relating to a normal (e.g. t-distribution with a lot of degrees of freedom becomes almost indistinguishable from a normal). In this case, chi-square is actually a square of a normal, so we have a slightly different result: en.wikipedia.org/wiki/…. So if you add up that sum of squares, you get X. Your degrees of freedom is actually k= 63x63, and you want (X-k)/sqrt(2k) as your statistic, which you compare to a z-table $\endgroup$ – Ray Oct 3 '16 at 22:00
  • $\begingroup$ The sum of my Chi Square is 1.78*10^6, and also when I plug in for X and k i get a value of 19921.95. I assumed X in that formula was the sum of the chi square values for the sample. $\endgroup$ – rvwsc38 Oct 3 '16 at 23:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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