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).
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