# sequences for performing a relative rate test seq1='AACCAAACCATTCACCCAAACGAATTCTAGGCGATAGAAATTACAATCCG' seq2='AATCAAACCATTTACCCTAATAAAGTATAGGCGATAGAAATTGTAAATCG' seq3='ATTAAATCATTCTCAAATATTAAAGTATGGGTGATAGAAAGTGTACTCTG' # lookup table for chisquared results # find the largest index i for which the critical value is smaller than the # observed value. Then the pvalue at that same index i is the most significant # one you can claim. Note that chisq values may be less than 1.32, # meaning the p-value is above 0.25. Your code should work in this case. # chisq_critical_values = [1.32, 1.64, 2.07, 2.71, 3.84, 5.02, 5.41, 6.63, 7.88] chisq_assoc_pvalues=[0.25, 0.20, 0.15, 0.10, 0.05, 0.025, 0.020, 0.010, 0.005] # arguments are observed chisq value, and parallel lists of critical values # and p-value cutoffs. should return a string containing the highest # significance level identified, e.g. "p < .01" or "p > .25" # def find_signif(observed,critvals,pvals): # arguments are the count values of m1 and m2, # should return float chisquared value (difference, squared, divided by sum). # def chisqval(m1,m2): # To compute x2 value for tajima rel rate test given s1, s2 w/outgroup s3: # compute m1, counting if s1 == s3 != s2 # compute m2, counting if s2 == s3 != s1 # return the chi-squared value of m1 and m2. # def tajima(s1,s2,s3): print find_signif(tajima(seq1,seq2,seq3) , chisq_critical_values, chisq_assoc_pvalues)