@@ -20,8 +20,9 @@ params:
2020---
2121
2222
23- <!-- UPPERCASE variable are text to be replaced. -->
24- <!-- There are several global variables obtained from st_report() function. -->
23+ <!-- Some UPPERCASE (e.g MODULE_NUMBER) variables are text to be replaced (see st_report() function). -->
24+ <!-- NB: This code contains several global variables derived from gm_report() function arguments. -->
25+
2526
2627``` {r start, include=FALSE, echo=FALSE, eval=TRUE}
2728library(knitr)
@@ -184,8 +185,14 @@ knitr::asis_output("Seurat provides a convenient framework for exploring quality
184185```
185186
186187``` {r section_gen_info_17c, echo=FALSE, eval="exp_metrics" %in% section, echo=FALSE, results = "asis"}
187- seurat_object[["percent.mt"]] <- Seurat::PercentageFeatureSet(seurat_object, pattern = "^[Mm][Tt]-")
188- seurat_object[["percent.ribo"]] <- Seurat::PercentageFeatureSet(seurat_object, pattern = "^[Rr][Pp][LlSs][0-9]+")
188+ if(length(grep("^[Mm][Tt]-", rownames(seurat_object))) > 0 ){
189+ seurat_object[["percent.mt"]] <- Seurat::PercentageFeatureSet(seurat_object, pattern = "^[Mm][Tt]-")
190+ }
191+
192+ if(length(grep("^[Rr][Pp][LlSs][0-9]+", rownames(seurat_object))) > 0 ){
193+ seurat_object[["percent.ribo"]] <- Seurat::PercentageFeatureSet(seurat_object, pattern = "^[Rr][Pp][LlSs][0-9]+")
194+ }
195+
189196var_qc <- grep("(^nFeature)|(nCount)|(percent.mt)|(percent.ribo)", colnames(seurat_object@meta.data), perl = TRUE, value = TRUE)
190197for(qc in var_qc){
191198 print(Seurat::VlnPlot(seurat_object, features = qc, ncol = 1))
0 commit comments