예제 #1
0
def hill_coefficient_exp(tf_name,approx=False):
    """What is the effective hill coefficient of a binding site?"""
    motif = getattr(Escherichia_coli,tf_name)
    pssm = PSSM(motif)
    real_copies = copy_dict[tf_name][0]
    approx_copies = copy_dict[tf_name][1]
    copies = real_copies if not approx else approx_copies
    ns = []
    x_ks = []
    for site in motif:
        site_energy = pssm.trap(site)
        xs = copies
        ys = map(lambda mu:fermi_dirac(site_energy,mu),mus)
        plt.plot(xs,ys)
        x_k,n = fit_hill_function(xs,ys)
        print site,site.operon,n,x_k
        x_ks.append(x_k)
        ns.append(n)
    #plt.semilogx()
    #plt.show()
    return ns,x_ks