Skip to content

Commit

Permalink
more direct fill-in-the-blank question on size factors
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewGhazi committed Sep 16, 2024
1 parent 46d06ce commit 3697490
Showing 1 changed file with 44 additions and 9 deletions.
53 changes: 44 additions & 9 deletions episodes/eda_qc.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,30 @@ sce

:::: challenge

Some sophisticated experiments perform additional steps so that they can estimate size factors from so-called "spike-ins". Judging by the name, what do you think "spike-ins" are, and what additional steps are required to use them?
Fill in the blanks for normalization that uses simpler library size factors instead of deconvolution.

```{r eval=FALSE}
____ <- ____SizeFactors(sce)
sizeFactors(sce) <- ____
sce <- ____(sce)
sce
```

::: solution
```{r eval=FALSE}
lib.sf <- librarySizeFactors(sce)
Spike-ins are deliberately-introduced exogeneous RNA from an exotic or synthetic source at a known concentration. This provides a known signal to normalize to. Exotic or synthetic RNA (e.g. soil bacteria RNA in a study of human cells) is used in order to avoid confusing spike-in RNA with sample RNA. This has the obvious advantage of accounting for cell-wise variation, but adds additional sample-preparation work.
sizeFactors(sce) <- lib.sf
sce <- logNormCounts(sce)
sce
```

If you run this chunk, make sure to go back and re-run the normalization with deconvolution normalization if you want your work to align with the rest of this episode.
:::

::::
Expand Down Expand Up @@ -385,20 +403,14 @@ The blue line represents the uninteresting "technical" variance for any given ge

### Selecting highly variable genes

The next step is to select the subset of HVGs to use in downstream analyses. A larger set will assure that we do not remove important genes, at the cost of potentially increasing noise. Typically, we restrict ourselves to the top $n$ genes, here we chose $n = 1000$, but this choice should be guided by prior biological knowledge; for instance, we may expect that only about 10% of genes to be differentially expressed across our cell populations and hence select 10% of genes as higly variable (e.g., by setting `prop = 0.1`).
The next step is to select the subset of HVGs to use in downstream analyses. A larger set will assure that we do not remove important genes, at the cost of potentially increasing noise. Typically, we restrict ourselves to the top $n$ genes, here we chose $n = 1000$, but this choice should be guided by prior biological knowledge; for instance, we may expect that only about 10% of genes to be differentially expressed across our cell populations and hence select 10% of genes as highly variable (e.g., by setting `prop = 0.1`).

```{r}
hvg.sce.var <- getTopHVGs(dec.sce, n = 1000)
head(hvg.sce.var)
```

:::: challenge

Run an internet search for some of the most highly variable genes we've identified here. See if you can identify the type of protein they produce or what sort of process they're involved in. Do they make biological sense to you?

::::

## Dimensionality Reduction

Many scRNA-seq analysis procedures involve comparing cells based on their expression values across multiple genes. For example, clustering aims to identify cells with similar transcriptomic profiles by computing Euclidean distances across genes. In these applications, each individual gene represents a dimension of the data, hence we can think of the data as "living" in a ten-thousand-dimensional space.
Expand Down Expand Up @@ -583,6 +595,29 @@ The package `DropletTestFiles` includes the raw output from Cell Ranger of the p

::::::::::::::::::::::::::::::::::


:::: challenge

#### Extension challenge 1: Spike-ins

Some sophisticated experiments perform additional steps so that they can estimate size factors from so-called "spike-ins". Judging by the name, what do you think "spike-ins" are, and what additional steps are required to use them?

::: solution

Spike-ins are deliberately-introduced exogeneous RNA from an exotic or synthetic source at a known concentration. This provides a known signal to normalize against. Exotic (e.g. soil bacteria RNA in a study of human cells) or synthetic RNA is used in order to avoid confusing spike-in RNA with sample RNA. This has the obvious advantage of accounting for cell-wise variation, but can substantially increase the amount of sample-preparation work.

:::

::::

:::: challenge

#### Extension challenge 2: Background research

Run an internet search for some of the most highly variable genes we identified in the feature selection section. See if you can identify the type of protein they produce or what sort of process they're involved in. Do they make biological sense to you?

::::

::::::::::::::::::::::::::::::::::::: keypoints

- Empty droplets, i.e. droplets that do not contain intact cells and that capture only ambient or background RNA, should be removed prior to an analysis. The `emptyDrops` function from the [DropletUtils](https://bioconductor.org/packages/DropletUtils) package can be used to identify empty droplets.
Expand Down

0 comments on commit 3697490

Please sign in to comment.