Learn R Programming

PRIST (version 0.925)

thresholdSCRNACountMatrix: Threshold a count matrix using an adaptive threshold.

Description

An adaptive threshold is calculated from the conditional mean of expression, based on 10 bins of the genes with similar expression levels. Thresholds are chosen by estimating cutpoints in the bimodal density estimates of the binned data.

Usage

thresholdSCRNACountMatrix(data_all, conditions = NULL, cutbins = NULL,
  nbins = 10, bin_by = "median", qt = 0.975, min_per_bin = 50,
  absolute_min = 0, return_log = TRUE)

Arguments

data_all

matrix of counts. Rows are cells and columns are genes.

conditions

Bins are be determined per gene and per condition. Typically contrasts of interest should be specified.

cutbins

vector of cut points.

nbins

integer number of bins when cutbins is not specified.

bin_by

character "median", "proportion", "mean"

qt

when bin_by is "quantile", what quantile should be used to form the bins

min_per_bin

minimum number of genes within a bin

absolute_min

numeric giving a hard threshold below which everything is assumed to be noise

return_log

return the logged expression matrix or not. By default, returned expression matrix will be logged ( base 2 ).

Value

list of thresholded counts (on natural scale), thresholds, bins, densities estimated on each bin, and the original data