gwpcrpois.groupest: Compatibility wrapper of 'gwpcrpois.groupest'

Description Usage Arguments Details Value Functions See Also

View source: R/estimate.R

Description

Uses the method of moments and sets the ctrl parameters to their previous defaults, i.e. include.mean.var=TRUE, obs.min.ingroup=2 and use.nonconv.groupest=TRUE.

Estimates the parameters efficiency and lambda0 separately for each group of UMIs (i.e, for example separately for each gene, each exon, each cell, ...). To reduce the noise of the raw group-specific parameters, the raw group-specific parameters are shrunken towards global estimates for efficiency and lambda0 that are specified

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
gwpcrpois.mom.groupwise(
  formula,
  data,
  threshold = 1,
  molecules = 1,
  loss = expression(p0),
  ctrl = list()
)

gwpcrpois.groupest(
  formula,
  data,
  method = "mom",
  threshold = 1,
  molecules = 1,
  loss = expression(p0),
  ctrl = list()
)

Arguments

formula

Formula of the form reads ~ key1 + key2 + ..., where reads is the column containing the per-UMI read count, and key1, key2, ... are the column(s) that uniquely identify a group. If multiple read counts are observed per UMI (for example if a protocol that yields strand-specific counts for the two strands of double- stranded molecules is used), c(reads1, reads2, ...) can be used as the left hand side to combine read counts from multiple columns. Note that in this case, the default loss expression is probably not appropriate. All the read counts in the columns listed in reads must be greater or equal than threshold.

data

a data.frame or data.table with one row per observed UMI. The required columns are determined by the formula.

threshold

minimal number of observations a molecular family must have to count as unambiguously detected. Setting this to a value v >= 0 conditions the distribution on c >= c, i.e every value of c less than that gets assigned probability zero.

molecules

initial copy number

loss

an expression specifying how the loss, i.e. the percentage of all molecules (or UMIs) that was not observed, or removed by the read count threshold. In the simple case of each read count observation representing a separate molecules, the default value p0 is correct – the lost molecules are then simply those whose read count lies below the specified threshold. In more complex scenarios, e.g. if a single molecule produces separate read count for each strand, which are then either both rejected or both accepted, the additional rejection cases must be considered by a custom loss expression

ctrl

a list of settings controlling the estimation procedure. Difference estimation methods recognize different possible ctrl settings, unrecognized settings are ignored without warning. See gwpcrpois.est for the ctrl settings affecting the raw group-specific estimates, and the Details section for settings affecting the shrinkage of those estimates.

method

the estimation method to use, either 'mle' for maximum likelihood estimation or 'mom' for method of moments. See Details.

Details

Apart from the ctrl parameters described in gwpcrpois.est, the following settings can be modified

core

number of CPU cores to use to compute group-specific estimates. If set to a value greather than 1, the parallel package must be loaded.

obs.min.ingroup

how many observed per-UMI read counts a group must contain for group-specific estimates to be computed and used. Default is 5.

use.nonconv.globalest

whether to use global estimates that didn't fully converge (i.e. where gwpcrpois.est reported a value other than 0 for convergence). Default is FALSE.

use.nonconv.groupest

whether to use group-specific estimates that didn't fully converge (i.e. where gwpcrpois.est reported a value other than 0 for convergence). Default is FALSE.

include.mean.var

whether to include columns with the group-wise global mean and variance of readcounts in the output table. Default is FALSE.

verbose

whether to output progress and diagnostic messages, default is FALSE.

Value

a data.table containing one row per group, and which besides the group key column(s) as indicated by the formula, contains the following columns

efficiency

the final group-specific estimate of the PCR efficiency

lambda0

the final group-specific estimate of the number of reads per molecule

loss

the final group-specific estimate of the fraction of lost molecules.

n.tot

the final group-specific estimate of the total (loss-corrected) number of molecules.

Functions

See Also

gwpcrpois


Cibiv/gwpcR documentation built on Aug. 31, 2021, 1:20 p.m.