コード例 #1
0
def get_response_content(fs):
    # get the codon distribution
    codons = Codon.g_sorted_non_stop_codons
    distribution = SnippetUtil.get_distribution(fs.weights, 'codon', codons)
    # get the rate matrix defined by the weights and kappa and omega
    r = RateMatrix.get_gy94_rate_matrix(distribution, fs.kappa, fs.omega)
    # show the rate matrix in convenient text form
    out = StringIO()
    for ca in codons:
        print >> out, '\t'.join(str(r[(ca, cb)]) for cb in codons)
    return out.getvalue()