Skip to content

Commit

Permalink
fix: ensure that track/features are vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
js2264 committed Jul 12, 2024
1 parent ab2090a commit e7b0393
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion R/as_tibble.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ as_tibble.AggregatedCoverage <- function(x, ...) {
dplyr::bind_cols() |>
dplyr::mutate(
coord = seq(-w/2, w/2-1, by = bin),
track = t, features = f
track = factor(t, levels = tracks),
features = factor(f, levels = features)
) |>
dplyr::relocate(coord) |>
dplyr::relocate(features) |>
Expand Down
3 changes: 2 additions & 1 deletion R/expand.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ expand.CoverageExperiment <- function(data, ..., .name_repair = NULL) {
m <- assay(data, "coverage")[f, t][[1]] |>
as.data.frame() |>
dplyr::mutate(
track = t, features = f,
track = factor(t, levels = tracks),
features = factor(f, levels = features),
chr = as.vector(seqnames(rr)),
ranges = as.character(rr),
strand = as.vector(strand(rr))
Expand Down

0 comments on commit e7b0393

Please sign in to comment.