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.
1 2 3 4 5
Gene count matrix, a dgCMatrix.
The data frame from
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.
get_knee_df returns a tibble with two columns:
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
Code in part adapted from
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# 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.