testPrior function

Posterior check of the model

Posterior check of the model

This functions compares variance estimates obtained from the maximum a posterior estimate with a given prior to the data. The ratio between the predicted variance and the actual variance for a random subset of genes is computed across all pruned k nearest neighbourhoods.

testPrior( res, expData, gamma = c(0.2, 0.5, 1, 5, 1000), rseed = 12345, ngenes = 200, pvalue = 0.01, minN = 5, no_cores = NULL, x0 = 0, lower = 0, upper = 100 )

Arguments

  • res: List object with k nearest neighbour information returned by pruneKnn.
  • expData: Matrix of gene expression values with genes as rows and cells as columns. These values have to correspond to unique molecular identifier counts.
  • gamma: Vector of gamma-values to test for the Cauchy prior distribution. Default is c(0.2,0.5,1,5,1000). Large values correspond to weak priors (gamma=1000 corresponds to a maximum likelihood estimate).
  • rseed: Integer number. Random seed to enforce reproducible gene sampling. Default is 12345.
  • ngenes: Positive integer number. Randomly sampled number of genes (from rownames of expData) used for noise estimation. Genes are sampled uniformly across the entire expression range. Default is 200.
  • pvalue: Input parameter for compTBNoise. See help(compTBNoise).
  • minN: Input parameter for compTBNoise. See help(compTBNoise).
  • no_cores: Input parameter for compTBNoise. See help(compTBNoise).
  • x0: Input parameter for compTBNoise. See help(compTBNoise).
  • lower: Input parameter for compTBNoise. See help(compTBNoise).
  • upper: Input parameter for compTBNoise. See help(compTBNoise).

Returns

List of three components: - pp.var.ratio: List of vectors for each gamma value of ratios between predicted and actual variances across all sampled genes and neighbourhoods.

  • noise: List of noise objects obtained from compTBNoise for each gamma value.

  • tc: Vector of total transcript counts for all cells

  • Maintainer: Dominic Grün
  • License: GPL-3
  • Last published: 2024-11-24

Useful links