Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: OSCA.advanced
Title: Advanced Single-Cell Analysis
Version: 1.15.2
Date: 2024-07-01
Version: 1.15.3
Date: 2025-03-31
Authors@R: c(
person('Robert', 'Amezquita', role = 'aut'),
person('Aaron', 'Lun', role = 'aut'),
Expand Down
2 changes: 1 addition & 1 deletion inst/book/cell-cycle.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ tab
singler.assignments <- assignments
stopifnot(tab["G1",1] > 0.5 * sum(tab[,1]))
stopifnot(tab["G2M",2] > 0.5 * sum(tab[,2]))
stopifnot(tab["G1",3] > 0.5 * sum(tab[,3]))
stopifnot(tab["G1",3] > 0.45 * sum(tab[,3]))
stopifnot(tab["G2M",4] > 0.5 * sum(tab[,4]))
```

Expand Down
7 changes: 6 additions & 1 deletion inst/book/doublet-detection.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,12 @@ The barcode-rank plots are quite similar to what one might expect from gene expr
library(DropletUtils)

set.seed(101)
hash.calls <- emptyDrops(counts(hto.sce), by.rank=40000)
# HTO counts tend to exhibit stronger overdispersion (i.e., lower `alpha` in
# the `emptyDrops()` calculations), increasing the risk of violating
# `emptyDrops()`'s distributional assumptions.
# Setting `alpha=NULL` estimates alpha using maximum likelihood; see
# `?emptyDrops` for details.
hash.calls <- emptyDrops(counts(hto.sce), by.rank=40000, alpha=NULL)
is.cell <- which(hash.calls$FDR <= 0.001)
length(is.cell)

Expand Down
2 changes: 0 additions & 2 deletions inst/book/droplet-processing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ hist(log10(e.out.hto$Total[is.cell.hto]), xlab="Log[10] HTO count", main="")

While both approaches are valid, we tend to favor the cell calls derived from the gene matrix as this directly indicates that a cell is present in the droplet.
Indeed, at least a few libraries have very high total HTO counts yet very low total gene counts (Figure \@ref(fig:hto-total-comp)), suggesting that the presence of HTOs may not always equate to successful capture of that cell's transcriptome.
HTO counts also tend to exhibit stronger overdispersion (i.e., lower `alpha` in the `emptyDrops()` calculations), increasing the risk of violating `emptyDrops()`'s distributional assumptions.

```{r hto-total-comp, fig.cap="Total HTO counts plotted against the total gene counts for each library in the cell line mixture dataset. Each point represents a library while the dotted lines represent the thresholds below which libraries were assumed to be empty droplets."}
table(HTO=is.cell.hto, Genes=is.cell, useNA="always")
Expand All @@ -316,7 +315,6 @@ abline(h=metadata(e.out.hto)$lower, col="blue", lwd=2, lty=2)

```{r, echo=FALSE}
# Sanity checks for trash-talk above.
stopifnot(metadata(e.out.hto)$alpha < 50 * metadata(e.out.gene)$alpha)
stopifnot(sum(e.out.gene$Total < 100 & e.out.hto$Total > 1000) > 50)
```

Expand Down
Loading