From 77e0ff49603286bc8e967b233f8ab58de31d1481 Mon Sep 17 00:00:00 2001 From: jiajic <72078254+jiajic@users.noreply.github.com> Date: Fri, 20 Oct 2023 12:56:15 -0400 Subject: [PATCH] fix: finish updating params --- R/plot_sankey.R | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/R/plot_sankey.R b/R/plot_sankey.R index ffbc2cc..0792d55 100644 --- a/R/plot_sankey.R +++ b/R/plot_sankey.R @@ -437,6 +437,8 @@ sankey_relation_pair = function(g, gsp, rel_idx, node_idx_start = 0) { +# sankeyPlot methods #### + #' @title Create a sankey plot #' @name sankeyPlot @@ -495,18 +497,18 @@ setMethod( ...) { GiottoUtils::package_check("networkD3") meta_type = match.arg(meta_type, choices = c('cell', 'feat')) - x@data_type = meta_type + y@data_type = meta_type # iterate through sankey relations in the giottoSankeyPlan node_idx_start = 0 links_dt = data.table::data.table() nodes = c() - for (rel_i in seq(nrow(sankeyRelate(x)))) { + for (rel_i in seq(nrow(sankeyRelate(y)))) { rel_data = sankey_relation_pair( - g = gobject, - gsp = x, + g = x, + gsp = y, rel_idx = rel_i, node_idx_start = node_idx_start ) @@ -571,7 +573,7 @@ setMethod( # Defaults for spat_unit and feat_type are set inside of the getter if they # are provided as NULL meta_cm = meta_get_fun( - gobject = g, + gobject = x, spat_unit = spat_unit, feat_type = feat_type, output = 'cellMetaObj', @@ -585,7 +587,7 @@ setMethod( if (!is.null(idx)) { meta_cm = meta_cm[idx] } - test_dt = meta_cm[][, x, with = FALSE] + test_dt = meta_cm[][, y, with = FALSE] res = sankey_compare(data_dt = test_dt) links_dt = res$links