Skip to content

Commit

Permalink
updated the code to allow for non-chromsomal treatment.
Browse files Browse the repository at this point in the history
  • Loading branch information
negar7918 committed Sep 28, 2022
1 parent cda9b13 commit 3814f0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CopyMix_Gaussian/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ def vi(locs, prior, init, y, max_iter=15, tol=.000000001):

for k in range(K):
# handle chromosomal loci
p_prev.weight_vertex[k] = correct_for_chrom(p_prev.weight_vertex[k], locs)
if locs is not None:
p_prev.weight_vertex[k] = correct_for_chrom(p_prev.weight_vertex[k], locs)
graph = C(M, p_prev.weight_initial[k], p_prev.weight_edge[k], p_prev.weight_vertex[k])
# Update 3
clusters.insert(k, graph)
Expand Down
4 changes: 2 additions & 2 deletions CopyMix_Gaussian/initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def generate_initializations(id, data, num_of_states, total_num_of_clusters):
inits[index].add_init(delta, theta, tau, alpha_gam, beta_gam, lam, pi,
weight_initial, weight_edge, weight_vertex)
new_delta, new_theta, new_tau, new_alpha_gam, new_beta_gam, new_lam, new_pi, weight_initial, new_weight_edge, \
new_weight_vertex, trans = vi(prior, init, data)
new_weight_vertex, trans = vi(None, prior, init, data)
inits[index].add_new(trans, new_delta, new_theta, new_tau, new_alpha_gam, new_beta_gam, new_lam, new_pi, weight_initial, new_weight_edge, \
new_weight_vertex, vi.likelihood, "random_random"+str(i), k)

Expand All @@ -203,7 +203,7 @@ def generate_initializations(id, data, num_of_states, total_num_of_clusters):
inits[index].add_init(delta, theta, tau, alpha_gam, beta_gam, lam, pi,
weight_initial, weight_edge, weight_vertex)
new_delta, new_theta, new_tau, new_alpha_gam, new_beta_gam, new_lam, new_pi, weight_initial, new_weight_edge, \
new_weight_vertex, trans = vi(prior, init, data)
new_weight_vertex, trans = vi(None, prior, init, data)
inits[index].add_new(trans, new_delta, new_theta, new_tau, new_alpha_gam, new_beta_gam, new_lam, new_pi,
weight_initial, new_weight_edge, new_weight_vertex, vi.likelihood, "random" + str(i), k)

Expand Down

0 comments on commit 3814f0d

Please sign in to comment.