compTBNoise {RaceID}R Documentation

Function for fitting a negative binomial noise model of technical and biological variability across cells in pruned k-nearest neighbourhoods.

Description

This function fits negative binomial models to transcript counts of pruned k-nearest neighbourhoods inferred by pruneKnn thereby deconvoluting variability into sampling noise, global cell-to-cell variability of transcript counts, and residual variability, which corresponds to biological noise.

Usage

compTBNoise(
  res,
  expData,
  pvalue = 0.01,
  genes = NULL,
  minN = 5,
  no_cores = NULL,
  gamma = 0.5,
  x0 = 0,
  lower = 0,
  upper = 100
)

Arguments

res

List object with k nearest neighbour information returned by pruneKnn function.

expData

Matrix of gene expression values with genes as rows and cells as columns. These values have to correspond to unique molecular identifier counts.

pvalue

Positive real number between 0 and 1. All nearest neighbours with link probability < pvalue are discarded. Default is 0.01.

genes

Vector of gene names corresponding to a subset of rownames of expData. Only for these genes local gene expression variability is computed. Default is NULL and values for all genes are returned.

minN

Positive integer number. Noise inference is only done for k-nearest neighbourhoods with at least minN neighbours remaining after pruning.

no_cores

Positive integer number. Number of cores for multithreading. If set to NULL then the number of available cores minus two is used. Default is NULL.

gamma

Positive real number. Scale paramter of the cauchy prior. Default is 0.5.

x0

Real number greater or equal to zero. Location parameter of the cauchy prior.

lower

Real number greater or equal to zero. Lower bound for the maximum a posterior inference of the biological noise. Default is 0.

upper

Real number greater or equal to zero. Upper bound for the maximum a posterior inference of the biological noise. Default is 100.

Value

List object of three components:

mu

Vector of mean expression for all k-nearest neighbourhoods. Componenets are set to NA if less than minN neighbours are present in pruned neighbourhood.

rt

Vector of dispersion parameters capturing global cell-to-cell variability of transcript counts for all k-nearest neighbourhoods. Componenets are set to NA if less than minN neighbours are present in pruned neighbourhood.

epsilon

Matrix of biological noise estimates for all genes across for all k-nearest neighbourhoods. Componenets are set to NA if less than minN neighbours present in pruned neighbourhood.

pars

List of parameters.

Examples

## Not run: 
res <- pruneKnn(intestinalDataSmall,knn=10,alpha=1,no_cores=1,FSelect=FALSE)
noise <- compTBNoise(res,intestinalDataSmall,pvalue=0.01,genes = NULL,no_cores=1)

## End(Not run)

[Package RaceID version 0.3.5 Index]