Skip to content

Commit

Permalink
Use nodes_degree instead of edges_degree
Browse files Browse the repository at this point in the history
Signed-off-by: Liang Zhang <[email protected]>
  • Loading branch information
psychelzh committed Mar 11, 2024
1 parent bb8d356 commit b78b761
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion R/cpm.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ binarize_edges <- function(result, level = 0.5) {
result$edges > level * length(unique(result$folds))
}

calc_edges_degree <- function(edges) {
calc_nodes_degree <- function(edges) {
apply(
edges, 2,
\(x) colSums(Rfast::squareform(x)),
Expand Down
10 changes: 5 additions & 5 deletions _scripts/predict_phenotypes.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ cpm_branches <- tarchetypes::tar_map(
),
tar_target(edges, lapply(cpm_result, binarize_edges)),
tar_target(
edges_degree,
lapply(edges, calc_edges_degree) |>
nodes_degree,
lapply(edges, calc_nodes_degree) |>
list_rbind(names_to = "latent"),
),
tar_target(
Expand Down Expand Up @@ -121,12 +121,12 @@ list(
deployment = "main"
),
tarchetypes::tar_combine(
edges_degree,
cpm_branches$edges_degree,
nodes_degree,
cpm_branches$nodes_degree,
command = bind_rows_meta(
!!!.x,
.names = c(names(config_fc), names(hypers_cpm)),
.prefix = "edges_degree"
.prefix = "nodes_degree"
),
deployment = "main"
),
Expand Down

0 comments on commit b78b761

Please sign in to comment.