Skip to content

Commit

Permalink
fix: finish updating params
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajic committed Oct 20, 2023
1 parent d2e027e commit 77e0ff4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions R/plot_sankey.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Check notice

Code scanning / lintr

Use <-, not =, for assignment. Note

Use <-, not =, for assignment.

# 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)))) {

Check warning

Code scanning / lintr

seq(nrow(...)) is likely to be wrong in the empty edge case. Use seq_len(nrow(...)) instead. Warning

seq(nrow(...)) is likely to be wrong in the empty edge case. Use seq_len(nrow(...)) instead.

rel_data = sankey_relation_pair(
g = gobject,
gsp = x,
g = x,
gsp = y,
rel_idx = rel_i,
node_idx_start = node_idx_start
)
Expand Down Expand Up @@ -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',
Expand All @@ -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]

Check notice

Code scanning / lintr

Use <-, not =, for assignment. Note

Use <-, not =, for assignment.

res = sankey_compare(data_dt = test_dt)
links_dt = res$links
Expand Down

0 comments on commit 77e0ff4

Please sign in to comment.