From 828648648384b1988cc3dc9f2019491192074650 Mon Sep 17 00:00:00 2001 From: Alan O'Callaghan Date: Tue, 16 Apr 2024 15:39:47 +0100 Subject: [PATCH] Make old donor column that has the same ID as before --- inst/book/segerstolpe-pancreas.Rmd | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inst/book/segerstolpe-pancreas.Rmd b/inst/book/segerstolpe-pancreas.Rmd index 4b456a4..c13e80c 100644 --- a/inst/book/segerstolpe-pancreas.Rmd +++ b/inst/book/segerstolpe-pancreas.Rmd @@ -31,14 +31,17 @@ rownames(sce.seger) <- ens.id[keep] ``` We simplify the names of some of the relevant column metadata fields for ease of access. -Some editing of the cell type labels is necessary for consistency with other data sets. +Some editing of the cell type labels is necessary for consistency with other data sets, +and old versions of these data. ```{r sample-annotation} emtab.meta <- colData(sce.seger)[,c("cell type", "disease", "individual", "single cell well quality")] colnames(emtab.meta) <- c("CellType", "Disease", "Donor", "Quality") +emtab.meta$OldDonor <- gsub("(.*)_.*", "\\1", colnames(sce.seger)) colData(sce.seger) <- emtab.meta + sce.seger$CellType <- gsub(" cell", "", sce.seger$CellType) sce.seger$CellType <- paste0( toupper(substr(sce.seger$CellType, 1, 1)), @@ -62,7 +65,7 @@ library(scater) stats <- perCellQCMetrics(sce.seger) qc <- quickPerCellQC(stats, percent_subsets="altexps_ERCC_percent", batch=sce.seger$Donor, - subset=!sce.seger$Donor %in% c("HP1504901", "HP1509101")) + subset=!sce.seger$OldDonor %in% c("HP1504901", "HP1509101")) sce.seger <- sce.seger[,!(qc$discard | low.qual)] ```