Skip to content

Commit

Permalink
fix subset_ccs
Browse files Browse the repository at this point in the history
  • Loading branch information
maddyduran committed Jan 5, 2024
1 parent 0f1b96f commit 4c358b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/methods-cell_count_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,17 @@ subset_ccs = function(ccs, ...) {
group_ids = filtered_cds_coldata %>% pull(group_id)

cell_group_assignments = ccs@metadata$cell_group_assignments[ccs@metadata$cell_group_assignments$group_id %in% group_ids,]
samples = cell_group_assignments$sample %>% unique()
cell_groups = cell_group_assignments$cell_group %>% unique()
samples = intersect( colnames(ccs), unique(cell_group_assignments$sample))
cell_groups = intersect(rownames(ccs), unique(cell_group_assignments$cell_group))
sub_ccs = ccs[cell_groups, samples]
sub_ccs@metadata$cell_group_assignments = cell_group_assignments

return(sub_ccs)

}



#' #' subset ccs by cell groups
#' #' @param ccs
#' #' @param cell_groups
Expand Down

0 comments on commit 4c358b8

Please sign in to comment.