options(knitr.table.format = "html") 
options(scipen=10)
knitr::opts_chunk$set(echo = TRUE, fig.path = savePath_basic)
knitr::opts_knit$set(root.dir = savePath_basic)

h.i <- 1
h.ii <- 1

r sampleName


r h.i Spot statistics

if(file.exists(file.path(dataPath, "web_summary.html"))){
  file.copy(file.path(dataPath, "web_summary.html"), 
            file.path(savePath_basic, "report-spaceRanger.html"), 
            overwrite = T)
  cat("* Here is the [summary report](./report-spaceRanger.html) from `Space Ranger`.", sep = "")
}

r h.i.r h.ii The number of UMIs and detected genes in spots

We display nUMI (total number of UMIs) and nGene (total number of detected genes) here.

(Hi-res image: view)

h.i <- h.i + 1
h.ii <- 1

r h.i Gene statistics

The number of genes expressed in at least one cell : r sum(nSpot > 0).

r h.i.r h.ii Mitochondrial genes

Summary of mitochondrial genes percentage (mito.percent) in cells:

format(summary(object@meta.data[["mito.percent"]]), digits = 3)

(Hi-res image: view)

h.ii <- h.ii + 1

r h.i.r h.ii Ribosome genes

Summary of ribosome genes percentage (ribo.percent) in cells:

format(summary(object@meta.data[["ribo.percent"]]), digits = 3)

(Hi-res image: view)

h.ii <- h.ii + 1

r h.i.r h.ii Ambient RNAs

r h.i.r h.ii.1 Highly-expressed genes

In order to analyze the gene expression profiles in detail and identify highly-expressed genes in background mRNAs from lysed cells, we calculate some metrics as shown below.

Here is a plot showing the distributions of gene proportion in spots for the first 100 genes. And the points (genes) are colored according to whether they belongs to mitochondrial, ribosome, or other genes.

(Hi-res image: view)

The plot below shows the relationship between detect.rate and prop.median.

(Hi-res image: view)

h.i <- h.i + 1
h.ii <- 1

r h.i Output

r h.i.r h.ii Threshold to filter spots

In the process above, we use r paste0("region.threshold : ", region.threshold) to filter the isolated spots, and r ncol(object) spots are left.

h.ii <- h.ii + 1

r h.i.r h.ii Output files

Running this script generates following files:

  1. Html report : report-stStat.html.
  2. Markdown report : report-stStat.md.
  3. Figure files : QC/.
  4. Data: data/.
  5. Text file with gene manifest : geneManifest.txt.
  6. SeuratObject after stStatistic : SeuratObject.



© G-Lab, Tsinghua University



Miaoyx323/stCancer documentation built on Nov. 14, 2024, 5:31 p.m.