Skip to content

Commit e7b0393

Browse files
committed
fix: ensure that track/features are vectors
1 parent ab2090a commit e7b0393

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

R/as_tibble.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ as_tibble.AggregatedCoverage <- function(x, ...) {
3333
dplyr::bind_cols() |>
3434
dplyr::mutate(
3535
coord = seq(-w/2, w/2-1, by = bin),
36-
track = t, features = f
36+
track = factor(t, levels = tracks),
37+
features = factor(f, levels = features)
3738
) |>
3839
dplyr::relocate(coord) |>
3940
dplyr::relocate(features) |>

R/expand.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ expand.CoverageExperiment <- function(data, ..., .name_repair = NULL) {
3838
m <- assay(data, "coverage")[f, t][[1]] |>
3939
as.data.frame() |>
4040
dplyr::mutate(
41-
track = t, features = f,
41+
track = factor(t, levels = tracks),
42+
features = factor(f, levels = features),
4243
chr = as.vector(seqnames(rr)),
4344
ranges = as.character(rr),
4445
strand = as.vector(strand(rr))

0 commit comments

Comments
 (0)