Skip to content

Commit

Permalink
updated unification
Browse files Browse the repository at this point in the history
  • Loading branch information
shmohammadi86 committed Nov 11, 2020
1 parent 8964a73 commit 7f271cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions R/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ run.ACTIONet <- function(ace, k_max = 30, min.cells.per.arch = 2, min_specificit


# Identiy equivalent classes of archetypes and group them together
unification.out = unify_archetypes_with_ACTIONet(G = G, S_r = S_r, C_stacked = pruning.out$C_stacked, H_stacked = pruning.out$H_stacked, sensitivity = unification_sensitivity, alpha = unification_alpha, thread_no = thread_no)
unification.out = unify_archetypes(S_r = S_r, C_stacked = pruning.out$C_stacked, H_stacked = pruning.out$H_stacked, sensitivity = unification_sensitivity)


Ht_unified = as(Matrix::t(unification.out$H_unified), "sparseMatrix")
Expand Down Expand Up @@ -279,7 +279,7 @@ rerun.archetype.aggregation <- function(ace, data_slot = "logcounts",
H_stacked = Matrix::t(as.matrix(colMaps(ace)[["H_stacked"]]))
G = colNets(ace)[["ACTIONet"]]

unification.out = unify_archetypes_with_ACTIONet(G = G, S_r = S_r, C_stacked = C_stacked, H_stacked = H_stacked, sensitivity = unification_sensitivity, alpha = unification_alpha, thread_no = thread_no)
unification.out = unify_archetypes(S_r = S_r, C_stacked = C_stacked, H_stacked = H_stacked, sensitivity = unification_sensitivity)


R.utils::printf("%d states\n", length(unique(unification.out$assigned_archetype)))
Expand Down
4 changes: 2 additions & 2 deletions src/ACTIONet/archetype_unification/unification.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace ACTIONet {
mat Wg = cor(arch_S_r);
mat Hg = computeFullSim(arch_H_stacked, 1);

mat G0 = Wg % Hg;
mat G0 = arma::pow(Wg, 9); // % Hg;
sp_mat G = sp_mat(G0);

uvec initial_clusters_uvec(G.n_rows);
Expand All @@ -137,7 +137,7 @@ namespace ACTIONet {
v(idx) = ones(idx.n_elem);
C_arch.col(i) = v;
}
uvec selected_clusters = find(1 < sum(C_arch));
uvec selected_clusters = find(2 < sum(C_arch));
C_arch = C_arch.cols(selected_clusters);

mat C_unified = C_norm * C_arch;
Expand Down

0 comments on commit 7f271cb

Please sign in to comment.