Skip to content

Commit 95dd3a1

Browse files
committed
If gene_name and gene_id are in rowData, add gene_search as defined in check_sce_layer
1 parent aff00db commit 95dd3a1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

R/registration_pseudobulk.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
#' sce$age <- ages[sce$sample_id]
5858
#'
5959
#' ## Add gene-level information
60-
#' rowData(sce)$ensembl <- paste0("ENSG", seq_len(nrow(sce)))
60+
#' rowData(sce)$gene_id <- paste0("ENSG", seq_len(nrow(sce)))
6161
#' rowData(sce)$gene_name <- paste0("gene", seq_len(nrow(sce)))
6262
#'
6363
#' ## Pseudo-bulk by Cell Cycle
@@ -69,6 +69,7 @@
6969
#' min_ncells = NULL
7070
#' )
7171
#' colData(sce_pseudo)
72+
#' rowData(sce_pseudo)
7273
registration_pseudobulk <-
7374
function(
7475
sce,
@@ -230,6 +231,12 @@ registration_pseudobulk <-
230231
spatialCoords(sce_pseudo) <- NULL
231232
imgData(sce_pseudo) <- NULL
232233
}
234+
235+
## if gene_anme and gene_id cols are available add gene_search to rowData
236+
if(all(c("gene_name", "gene_id") %in% colnames(rowData(sce_pseudo)))){
237+
rowData(sce_pseudo)$gene_search <- paste0(rowData(sce_pseudo)$gene_name, "; ", rowData(sce_pseudo)$gene_id)
238+
}
239+
233240
if (!is.null(pseudobulk_rds_file)) {
234241
message(Sys.time(), " saving sce_pseudo to ", pseudobulk_rds_file)
235242
saveRDS(sce_pseudo, file = pseudobulk_rds_file)

man/registration_pseudobulk.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)