def interpret_main_experiment(results_dict,named_fs=None):
    if named_fs is None:
        named_fs = [(fitness,"fitness"),(lambda org:motif_ic(extract_sites(org)),"Motif IC"),
                    (lambda org:total_motif_mi(extract_sites(org)),"Motif MI")]
    rec_muts,site_muts = map(lambda x:sorted(set(x)),transpose(results_dict.keys()))
    fs,names = transpose(named_fs)
    subplot_dimension = ceil(sqrt(len(fs)))
    for idx,f in enumerate(fs):
        mat = np.zeros((len(rec_muts),len(site_muts)))
        for i,rec_mut in enumerate(sorted(rec_muts)):
            for j,site_mut in enumerate(sorted(site_muts)):
                pop,hist = results_dict[(rec_mut,site_mut)]
                mat[i,j] = mean([f(x) for x,fit in pop])
                print i,j,mat[i,j]
        plt.subplot(subplot_dimension,subplot_dimension,idx)
        plt.imshow(mat,interpolation='none')
        plt.xticks(range(len(site_muts)),map(str,site_muts))
        plt.yticks(range(len(rec_muts)),map(str,rec_muts))
        #plt.yticks(rec_muts)
        plt.xlabel("site mutation rate")
        plt.ylabel("rec mutation rate")
        plt.colorbar()
        title = names[idx]
        plt.title(title)
    plt.show()
Ejemplo n.º 2
0
def make_thin(im):
    loaded = utils.load_image(im)
    utils.apply_to_each_pixel(loaded, lambda x: 0.0 if x > 10 else 1.0)
    print "loading phase done"

    t1 = [[1, 1, 1], [0, 1, 0], [0.1, 0.1, 0.1]]
    t2 = utils.transpose(t1)
    t3 = reverse(t1)
    t4 = utils.transpose(t3)
    t5 = [[0, 1, 0], [0.1, 1, 1], [0.1, 0.1, 0]]
    t7 = utils.transpose(t5)
    t6 = reverse(t7)
    t8 = reverse(t5)

    thinners = [t1, t2, t3, t4, t5, t6, t7]

    usage = True
    while(usage):
        usage = apply_all_structures(loaded, thinners)
        print "single thining phase done"

    print "thining done"

    utils.apply_to_each_pixel(loaded, lambda x: 255.0 * (1 - x))
    utils.load_pixels(im, loaded)
    im.show()
Ejemplo n.º 3
0
def explore_coupling_const(iterations=1000000):
    """Given 3 state system, explore spin probabilities as function of coupling strength"""
    N = 10
    x0 = [0] * N
    hs = [log(1000000)] * N

    def hamil(xs, J):
        return dot(xs, hs) + J * (xs[0] + sum([xi * xj for (xi, xj) in pairs(xs)]))

    Js = interpolate(-16, -8 + 1, 20)

    def proposal(xs):
        return [int(random.random() < 0.5) for i in range(N)]

    results = []
    for J in Js:
        chain = mh(f=lambda xs: -hamil(xs, J), proposal=proposal, x0=x0, use_log=True, iterations=iterations)
        ps = map(mean, transpose(chain))
        results.append((J, ps))
    Js, pss = transpose(results)
    pss = transpose(pss)
    colors = "bgrcmyk"
    for i, ps in enumerate(pss):
        color = colors[i % len(colors)]
        plt.plot(Js, ps, marker="o", linestyle="", color=color)
        errs = [p + 1.96 * sqrt(p * (1 - p) / iterations) ** (i + 1) + p ** (i + 1) for p in pss[0]]
        print i, errs
        plt.plot(Js, [p ** (i + 1) for p in pss[0]])
        # plt.errorbar(Js,[p**(i+1) for p in pss[0]],yerr=errs,
        #              marker='',linestyle='--',color=color)
    plt.plot(Js, [1.0 / iterations for J in Js])
    # plt.semilogy()
    return results
def plot_grad_descent(n):
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    xs,ys,zs = transpose([[1,0,0],[0,1,0],[0,0,1],[1,0,0]])
    ax.plot(xs,ys,zs)
    for i in tqdm(range(n)):
        ps = grad_descent(3,iterations=1000,eta=0.01)
        ax.plot(*transpose(ps))
def plot_flattened_transport(n):
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    xs,ys,zs = transpose([[1,0,0],[0,1,0],[0,0,1],[1,0,0]])
    ax.plot(xs,ys,zs)
    q = project_to_simplex(np.array([1.0,1.0,1.0]))
    for i in range(n):
        p = simplex_sample(3)
        traj = map(project_to_simplex,circular_transport(p,q))
        ax.plot(*transpose(traj))
def analyze_column_frequencies():
    """Do columnwise frequencies reveal stable patterns that could be
explained by amino acid preferences?"""
    def dna_freqs(xs):
        return [xs.count(b)/float(len(xs)) for b in "ACGT"]
    all_freqs = concat([map(dna_freqs,transpose(getattr(tfdf_obj,tf)))
                         for tf in tfdf_obj.tfs])
    for k,(i,j) in enumerate(choose2(range(4))):
        plt.subplot(4,4,k)
        cols = transpose(all_freqs)
        plt.scatter(cols[i],cols[j])
def interpret_main_experiment(results_dict,f=None):
    site_muts,rec_muts = map(lambda x:sorted(set(x)),transpose(results_dict.keys()))
    for idx in range(1,7+1):
        if idx == 6:
            f = recognizer_non_linearity
        elif idx == 7:
            f = motif_non_linearity
        mat = np.zeros((len(site_muts),len(rec_muts)))
        for i,site_mut in enumerate(sorted(site_muts)):
            for j,rec_mut in enumerate(sorted(rec_muts)):
                pop,hist = results_dict[(site_mut,rec_mut)]
                if f is None:
                    last = hist[-1]
                    mat[i,j] = last[idx]
                    print i,j,site_mut,rec_mut,mat[i,j]
                else:
                    mat[i,j] = mean([f(x) for x,fit in pop])
                    print i,j,mat[i,j]
        plt.subplot(3,3,idx)
        plt.imshow(mat,interpolation='none')
        plt.xticks(range(len(rec_muts)),map(str,rec_muts))
        plt.yticks(range(len(site_muts)),map(str,site_muts))
        #plt.yticks(rec_muts)
        plt.xlabel("rec mutation rate")
        plt.ylabel("site mutation rate")
        plt.colorbar()
        title = "turn f mean_fits mean_dna_ic mean_rec mean_recced rec_nonlinearity motif_nonlinearity".split()[idx]
        plt.title(title)
    plt.show()
def plot_main_experiment_trajectories(results):
    for k,(pop,hist) in results.items():
        print k
        traj = transpose(hist)[1]
        ou_param_recovery(traj)
        plt.plot(traj)
    plt.show()
def test_estimate_stationary_statistic_ref_framework():
    matrix = make_pssm(Escherichia_coli.LexA)
    n = len(Escherichia_coli.LexA)
    Nes = np.linspace(1,5,10)
    pred,obs = transpose([test_estimate_stationary_statistic_ref(matrix,n,Ne,T=motif_ic) for Ne in Nes])
    plt.plot(Nes,pred)
    plt.plot(Nes,obs)
    return pred,obs
Ejemplo n.º 10
0
def test_plot():
    import matplotlib.pyplot as plt
    from mpl_toolkits.mplot3d import Axes3D
    xs,ys,zs = map(concat,transpose(main_example()))
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    ax.plot(xs,ys,zs)
    plt.show()
def weighted_regress_dep(xs,ys, sample_points=100):
    regress_points = []
    avg_yval = mean(map(abs,ys))
    ws = [exp(-abs(y)/avg_yval) for y in ys]
    for i in xrange(sample_points):
        rx,ry = inverse_cdf_sample(zip(xs,ys),ws,normalized=False)
        regress_points.append((rx,ry))
    rxs,rys = transpose(regress_points)
    return (polyfit(rxs,rys,1))
Ejemplo n.º 12
0
def toTableaux(oneUtilities, twoUtilities):

    assert len(oneUtilities) == len(twoUtilities), 'The tables must be of same shape'
    assert len(oneUtilities[0]) == len(twoUtilities[0]), 'The tables must be of same shape'
    
    X = [utils.scalarProd(p, -1.0) + [0.0] * len(twoUtilities[0]) for p in utils.transpose(twoUtilities)]
    Y = [[0.0] * len(oneUtilities) + utils.scalarProd(p, -1.0) for p in oneUtilities]

    return X, Y
Ejemplo n.º 13
0
 def __init__(self, reactions, init_state, species_names):
     self.stoich_vectors, self.propensities = transpose(reactions)
     self.state = init_state
     self.time = 0
     self.history = [(self.time, self.state)]
     self.verbose = False
     self.species_names = species_names
     self.reactions_performed = 0
     self.finished_run = False
def analyze_prodoric_collection_for_mi():
    for tf in Escherichia_coli.tfs:
        motif = getattr(Escherichia_coli,tf)
        cols = transpose(motif)
        n,L = motif_dimensions(motif)
        corrs = motif_corr(motif)
        if corrs:
            print tf,n,L,[((i,j),p,mi(cols[i],cols[j])) for (i,j),p in corrs]
        else:
            print tf,n,L
Ejemplo n.º 15
0
def make_pssm(binding_sites):
    """
    Return the PSSM as a list of dictionaries of the form:
    [{A:a_val,...,T:t_val}]
    """
    cols = transpose(binding_sites)
    n = float(len(binding_sites))
    return [{b:log2(((col.count(b)+1)/(n+4))/0.25)
             for b in "ACGT"}
            for col in cols]
def motif_corr(motif,n=1000):
    """find correlated columns in motif, correcting for multiple hypothesis testing"""
    ps = [mi_permute(col1,col2,p_value=True,n=n,mi_method=lambda xs,ys:mi(xs,ys,correct=False))
          for (col1,col2) in (choose2(transpose(motif)))]
    q = fdr(ps)
    if q is None:
        return None
    else:
        L = len(motif[0])
        return [((i,j),p) for (i,j),p in zip(choose2(range(L)),ps) if p <= q]
Ejemplo n.º 17
0
def viz_sample(sample,filename=None):
    """Visualize a sample trajectory"""
    plt.subplot(211)
    plt.imshow(transpose(sample),interpolation='nearest',aspect='auto')
    plt.ylabel("Position")
    plt.subplot(212)
    energies = map(hamiltonian,sample)
    plt.plot(energies)
    plt.ylabel("Energy")
    plt.xlabel("Iteration")
    maybesave(filename)
Ejemplo n.º 18
0
def multiple_ising(hs, J, iterations=50000, replicas=3, method=ising, burn_in=0):
    occ_list = []
    for i in range(replicas):
        print "replica ", i
        occ_list.append(method(hs, J, iterations)[burn_in:])
    # occ_list = [ising(hs,J,iterations) for i in range(replicas)]
    cols = [[(s + 1) / 2 for s in col] for col in transpose(occ_list)]
    means = map(mean, cols)
    sds = map(sd, cols)
    cis = [1.96 * s for s in sds]
    plt.errorbar(range(len(cols)), means, yerr=cis)
Ejemplo n.º 19
0
def make_plot(mus_ks,
              control_mus_ks,
              approximate_mus_ks,
              control_approximate_mus_ks,
              copy_number,
              outfile):
    plt.plot(*transpose([(k,mu) for (mu,k) in mus_ks]),label=r"$\mu$")
    plt.plot(*transpose([(k,mu) for (mu,k) in control_mus_ks]),label=r"Control $\mu$")
    plt.plot(*transpose([(k,mu) for (mu,k) in approximate_mus_ks]),label=r"$\hat\mu$")
    plt.plot(*transpose([(k,mu) for (mu,k) in control_approximate_mus_ks]),
              label=r"Control $\hat\mu$")
    if copy_number:
        plt.plot([copy_number,copy_number],[0,50],label="Copy number",linestyle="--")
    plt.xlabel("Copy number")
    plt.ylabel("Chemical potential + Const. (kBT)")
    plt.semilogx()
    plt.xlim(1,10**6)
    plt.title("Copy number vs. Chemical Potential")
    plt.legend(loc='upper left')
    plt.savefig(outfile,dpi=400)
    plt.close()
Ejemplo n.º 20
0
	def get_payoffs(self):
		"""
		Return payoff received for both players
		"""

		player1, player2 = self.players     # unpack the two players

		# generate a payoff pair for each game iteration in history
		payoffs = (self.payoffmat[m1][m2] for (m1,m2) in self.history)
		pay1, pay2 = transpose(payoffs)     # transpose to get a payoff sequence for each player

		return { player1:mean(pay1), player2:mean(pay2) }       # return a mapping of each player to its mean payoff
def analyze_all_pvals_at_once(org_obj=Escherichia_coli):
    """conclusion: fdr-adjusted p-values identify 25 significantly
    correlated column-pairs in 3753 pairwise tests (0.5%).  
    """
    ps = [mi_permute(col1,col2,p_value=True,n=1000,mi_method=lambda xs,ys:mi(xs,ys,correct=False))
          for tf in tqdm(org_obj.tfs)
          for (col1,col2) in (choose2(transpose(getattr(org_obj,tf))))]
    q_bh = fdr(ps)
    q_bhy = bhy(ps)
    print "bh procedure: %s/%s" % (len(filter(lambda p:p <= q_bh,ps)),len(ps))
    print "bhy procedure: %s/%s" % (len(filter(lambda p:p <= q_bhy,ps)),len(ps))
    return ps
def get_pairwise_freqs(motif, pc=1/16.0):
    cols = transpose(motif)
    L = len(cols)
    N = len(motif)
    fs = [{(b1, b2):0 for (b1,b2) in dinucs} for _ in range(int(choose(L,2)))]
    for f, (col1, col2) in zip(fs, choose2(cols)):
        for b1, b2 in zip(col1, col2):
            f[b1, b2] += 1
        for b1, b2 in dinucs:
            f[b1, b2] += pc
            f[b1, b2] /= float(N + 16*pc)
    return fs
def plot_hist(hist,show=True,labels=True):
    transposed_hist = transpose(hist)
        #hist.append((turn,f,mean_fits,mean_dna_ic,mean_rec,mean_recced))
    plt.plot(transposed_hist[0],transposed_hist[1],label="sampled fitness"*labels,color='b')
    plt.plot(transposed_hist[0],transposed_hist[2],label="mean fitness"*labels,color='g')
    plt.plot(transposed_hist[0],transposed_hist[3],label="mean motif ic"*labels,color='r')
    plt.plot(transposed_hist[0],transposed_hist[4],label="rec prom"*labels,color='y')
    plt.plot(transposed_hist[0],transposed_hist[5],label="sites recced"*labels,color='m')
    #plt.semilogy()
    if labels:
        plt.legend()
    if show:
        plt.show()
Ejemplo n.º 24
0
def benchmark_cat():
    """Compute correlation with expression for the CDC method of Zhang
    BMC Bioinformatics 2012"""
    for org in validation_orgs:
        print org
        try:
            gbk_filename = get_genome_filename(org,'gbk')
            genome = get_genome(org)
            cdss = get_cdss(genome)
            ncid = org2nc_id(org)
            cat_filename = os.path.join("index_results",ncid+"_CAT",ncid+".cat")
            with open(cat_filename) as f:
                lines = [line.split("\t") for line in f.readlines()[1:]]
            labels,cdcs = transpose([(fields[0],fields[10]) for fields in lines])
            matches = [re.search(r":(c?)(\d+)-(\d+)",label).groups() for label in labels]
            locations = [((int(start),int(stop))
                          if c == ''
                          else (int(stop) - 1,int(start)))
                         for (c,start,stop) in matches]
            cat_dict = {location:float(cdc) for location,cdc in zip(locations,cdcs)}
            org_exp_dict = master_exp_dict[org]
        # a dictionary of form {(start,stop):[locus tags]}
            location2lt = {(feature.location.start+1,feature.location.end):
                               feature.qualifiers['locus_tag'][0]
                           for feature in genome.features
                           if ('locus_tag' in feature.qualifiers)}
            correlates = [(cdc,org_exp_dict[location2lt[location]])
                          for location,cdc in cat_dict.items()
                          if location in location2lt
                          and location2lt[location] in org_exp_dict]
            cdcs,exps = transpose(correlates)
            
            rhos = [spearmanr(cdcs,map(lambda xs:xs[i],exps))[0]
                    for i in range(len(exps[0]))]
            print "num correlates:",len(correlates)
            print "Correlation:",org,mean(rhos),se(rhos)
        except:
            print "Failed on:",org
Ejemplo n.º 25
0
def plot_mono_vs_di_likelihood(ll_dict = None):
    if ll_dict is None:
        ll_dict = likelihood_dict()
    normed_dict = {tf:tuple(map(lambda x:x/float(len(getattr(Escherichia_coli,tf))*len(getattr(Escherichia_coli,tf)[0])),(mono,di))) for (tf,(mono,di)) in ll_dict.items()}
    plt.scatter(*transpose(ll_dict.values()))
    for (tf,(mono,di)) in ll_dict.items():
        sites = getattr(Escherichia_coli,tf)
        text = "%s\n#:%s\nw:%s\nIC:%1.2f" % (tf,len(sites),len(sites[0]),motif_ic(sites))
        plt.annotate(text,(mono,di))
    min_val = min(concat(ll_dict.values()))
    max_val = max(concat(ll_dict.values()))
    plt.xlabel("Mono LL")
    plt.ylabel("Di LL")
    plt.plot([min_val,max_val],[min_val,max_val],linestyle="--")
def analyze_motif(motif, trials=1000):
    cols = transpose(motif)
    L = len(cols)
    ps = []
    for col1, col2 in (choose2(cols)):
        actual_mi = dna_mi(col1,col2)
        perm_mis = [dna_mi(col1,permute(col2)) for i in xrange(trials)]
        p = percentile(actual_mi, perm_mis)
        #print p
        ps.append(p)
    q = fdr(ps)
    correlated_pairs = [(i,j) for (i,j),p in zip(choose2(range(L)),ps) if p < q]
    num_correlated = len(correlated_pairs)
    print "correlated column pairs:", num_correlated, "%1.2f" % ((num_correlated)/choose(L,2))
    return correlated_pairs
Ejemplo n.º 27
0
def main_example():
    sequence="""CGAAAAAACGCGAAAAAACGCGAAAAAACGCGAAAAAACGCGAAAAAACGCG
AAAAAACGCGAAAAAACGCGAAAAAACGCGAAAAAACGCGAAAAAACGCGAAAAAACGCGAAAAAA
CGCGAAAAAACGCGAAAAAACG""".replace("\n","")
    lookup = functionify_model(aawedge)
    rise = 3.38 #Angstroms, from Gohlke
    b0 = transpose([[0,0,0]])
    v0 = transpose([[0,0,rise]])
    bs = [b0]
    vs = [v0]
    for pair in pairs(sequence):
        dinuc = "".join(pair)
        params = lookup(dinuc)
        ro, ti, tw = params["roll"],params["tilt"],params["twist"]
        last_b = bs[-1]
        last_v = vs[-1]
        new_v = reduce(matrix_mult,[roll_matrix(ro),
                                    tilt_matrix(ti),
                                    twist_matrix(tw),
                                    last_v])
        new_b = matrix_add(last_b,new_v)
        bs.append(new_b)
        vs.append(new_v)
    return bs
Ejemplo n.º 28
0
    def as_qcircuit(self, C=None, R=None):
        r"""
        Typesets this circuit using the `Qcircuit`_ package for
        :math:`\text{\LaTeX}`.
        
        :param float C: Width (in ems) of each column.
        :param float R: Height (in ems) of each column.
        :rtype: :obj:`str`
        :returns: A string containing :math:`\text{\LaTeX}` source code for use
            with `Qcircuit`_.
        
        .. _Qcircuit: http://www.cquic.org/Qcircuit/
        """
             
        trans_cells = []
        for timestep in self.group_by_time():
            col = [r'\qw'] * self.nq # If nothing else, place a \qw.
            hidden_qubits = set()
            
            for loc in timestep:
                if any(qubit in hidden_qubits for qubit in range(min(loc.qubits), max(loc.qubits)+1)):
                    # A qubit is hidden, so append and reset.
                    trans_cells.append(col)
                    col = [r'\qw'] * self.nq # If nothing else, place a \qw.
                    hidden_qubits = set()
                    
                if loc.wt == 1:
                    col[loc.qubits[0]] = r"\gate{{{0}}}".format(loc.kind if loc.kind != "I" else r"\id")
                elif loc.kind == 'CNOT':
                    col[loc.qubits[0]] = r'\ctrl{{{0}}}'.format(loc.qubits[1] - loc.qubits[0])
                    col[loc.qubits[1]] = r'\targ'
                else:
                    raise NotImplementedError("Location kind {0.kind} not supported by this method.".format(loc))

                hidden_qubits.update(range(min(loc.qubits), max(loc.qubits)+1))
                
            trans_cells.append(col)
            
        cells = u.transpose([[''] * self.nq] + trans_cells + [[r'\qw'] * self.nq])
        
        return r"""
        \Qcircuit {C} {R} {{
            {0}
        }}
        """.format(u.latex_array_contents(cells),
            C="@C{}em".format(C) if C is not None else "",
            R="@R{}em".format(R) if R is not None else ""
        )
def kmeans(xs,k=2):
    centroids = [simplex_sample(4) for i in range(k)]
    old_within_ss = 10**300
    while True:
        # assign to clusters
        clusters = [[] for i in range(k)]
        for x in xs:
            idx = argmin([l2(x,centroid) for centroid in centroids])
            clusters[idx].append(x)
        # recompute centroids
        centroids = [map(mean,transpose(cluster)) for cluster in clusters]
        cur_within_ss = sum([sum((l2(x,centroid)**2 for x in cluster)) for centroid,cluster in zip(centroids,clusters)])
        print cur_within_ss
        if cur_within_ss == old_within_ss:
            break
        else:
            old_within_ss = cur_within_ss
    return clusters,centroids,within_ss
def analyze_composition_of_correlated_columns(obj,ps):
    p_idx = 0
    cor_adj_counts = defaultdict(int)
    cor_nonadj_counts = defaultdict(int)
    uncor_counts = defaultdict(int)
    fdr_cutoff = 0
    for tf in obj.tfs:
        motif = getattr(obj,tf)
        cols = transpose(motif)
        for (i,col1),(j,col2) in choose2(list(enumerate(cols))):
            if ps[p_idx] <= 0:
                print tf,i,j
                for pair in zip(cols[i],cols[j]):
                    if i + 1 == j:
                        cor_adj_counts[pair] += 1
                    else:
                        cor_nonadj_counts[pair] += 1
                #print mi_table(col1,col2)
            else:
                for pair in zip(cols[i],cols[j]):
                    uncor_counts[pair] += 1
            p_idx += 1
    cor_adj_N = float(sum(cor_adj_counts.values()))
    cor_nonadj_N = float(sum(cor_nonadj_counts.values()))
    uncor_N = float(sum(uncor_counts.values()))
    # all_N = float(sum(all_counts.values()))
    # print "---"
    # for b1,b2 in sorted(counts.keys()):
    #     
    #     print b1,b2,"freq:",fmt(counts[(b1,b2)]/N),"background:",fmt(all_counts[(b1,b2)]/all_N),"OR:",fmt(counts[(b1,b2)]/N/(all_counts[(b1,b2)]/all_N)),p
    print "bases, adj, nonadj, noncor | adj freq, nonadj freq | noncor freq| adj OR, nonadj OR"
    # XXX split into adj_uncor, nonadj_uncor
    for b1,b2 in sorted(cor_adj_counts.keys()):
        cor_adj_freq = fmt(cor_adj_counts[(b1,b2)]/cor_adj_N)
        cor_nonadj_freq = fmt(cor_nonadj_counts[(b1,b2)]/cor_nonadj_N)
        uncor_freq = fmt(uncor_counts[(b1,b2)]/uncor_N)
        cor_adj_OR = fmt(cor_adj_freq/uncor_freq)
        cor_nonadj_OR = fmt(cor_nonadj_freq/uncor_freq)
        _,adj_p,_,_ = stats.chi2_contingency(np.array([[uncor_N,uncor_counts[(b1,b2)]],
                                                       [cor_adj_N,cor_adj_counts[(b1,b2)]]]))
        _,non_adj_p,_,_ = stats.chi2_contingency(np.array([[uncor_N,uncor_counts[(b1,b2)]],
                                                       [cor_nonadj_N,cor_nonadj_counts[(b1,b2)]]]))
        print b1,b2,cor_adj_counts[b1,b2],cor_nonadj_counts[b1,b2],uncor_counts[b1,b2],"|",cor_adj_freq,cor_nonadj_freq,"|",uncor_freq,"|",cor_adj_OR, significance(adj_p),cor_nonadj_OR,significance(non_adj_p)
    return cor_adj_counts, cor_nonadj_counts, uncor_counts