get_knee_df | R Documentation |
Plot a transposed knee plot, showing the inflection point and the number of remaining cells after inflection point filtering. It's transposed since it's more generalizable to multi-modal data.
get_knee_df(mat)
get_inflection(df, lower = 100)
knee_plot(df, inflection)
mat |
Gene count matrix, a dgCMatrix. |
df |
The data frame from |
lower |
Minimum total UMI counts for barcode for it to be considered when calculating the inflection point; this helps to avoid the noisy part of the curve for barcodes with very few counts. |
inflection |
Output of |
get_knee_df
returns a tibble with two columns: total
for
total UMI counts for each barcode, and rank
for rank of the total
counts, with number 1 for the barcode with the most counts.
get_inflection
returns a numeric(1)
for the total UMI count
at the inflection point.
knee_plot
returns a ggplot2
object.
Code in part adapted from barcodeRanks
from DropetUtils
.
# Download dataset already in BUS format
library(TENxBUSData)
TENxBUSData(".", dataset = "hgmm100")
tr2g <- transcript2gene(c("Homo sapiens", "Mus musculus"),
type = "vertebrate",
ensembl_version = 99, kallisto_out_path = "./out_hgmm100")
m <- make_sparse_matrix("./out_hgmm100/output.sorted.txt",
tr2g = tr2g, est_ncells = 1e5,
est_ngenes = nrow(tr2g), TCC = FALSE)
df <- get_knee_df(m)
infl <- get_inflection(df)
knee_plot(df, infl)
# Clean up files from the example
unlink("out_hgmm100")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.