Skip to content

Commit 3e9089a

Browse files
Fix duplicate factor levels in prep_mod_heatmap()
Use summarize(.by = "sprinzl_label") with min(global_index) instead of distinct() to build label ordering, since a Sprinzl label can map to different global indices across tRNAs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0cf93d8 commit 3e9089a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

R/plots.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,13 @@ prep_mod_heatmap <- function(
164164
dplyr::mutate(has_mod = tidyr::replace_na(.data$has_mod, FALSE))
165165
}
166166

167-
# Order sprinzl_label by global_index
167+
# Order sprinzl_label by global_index. Use min to resolve ties when
168+
# a label maps to different global indices across tRNAs.
168169
label_order <- result |>
169-
dplyr::distinct(.data$sprinzl_label, .data$global_index) |>
170+
dplyr::summarize(
171+
global_index = min(.data$global_index),
172+
.by = "sprinzl_label"
173+
) |>
170174
dplyr::arrange(.data$global_index) |>
171175
dplyr::pull(.data$sprinzl_label)
172176

0 commit comments

Comments
 (0)