Learn R Programming

scpoisson (version 0.0.2)

qqplot_env_pois: Q-Q plot comparing samples with a theoretical Poisson distribution

Description

This function returns a Q-Q plot with envelope using a more "continuous" approximation of quantiles.

Usage

qqplot_env_pois(sample_data, lambda, envelope_size = 100, ...)

# S3 method for scppp qqplot_env_pois( sample_data, lambda, envelope_size = 100, L = 10, select_by = "entry", entry_size = 200, ... )

Value

A ggplot object.

Arguments

sample_data

A numeric vector of sample data points or an S3 object for class 'scppp'.

lambda

A numeric value specifying the theoretical Poisson parameter.

envelope_size

A numeric value specifying the size of envelope on Q-Q plot (default 100).

...

not used.

L

A numeric value specifying the number of latent vectors included when estimate the Poisson parameter for each matrix entry. This is not useful if a numeric vector is used as input.

select_by

A character indicating whether entries should be selected:

entry

Independent matrix entries with Poisson parameter estimates closest to lambda

cell

One particular cell with UMI count mean closest to lambda

gene

One particular gene with UMI count mean closest to lambda

This is not useful if a numeric vector is used as input.

entry_size

A numeric value specifying the number of entries used to compare with the theoretical Poisson distribution. This is not useful if a numeric vector is used as input, or the entries are selected by cell or gene.

Details

This is a function for Q-Q envelope plot used to compare whether given sample data points come from the theoretical Poisson distribution. By simulating repeated samples of the same size from the candidate theoretical distribution, and overlaying the envelope on the same figure, it provides a feeling of understanding the natural variation from the theoretical distribution.

If an S3 object for class 'scppp' is used as input and the stored result under "data" is a matrix, The GLM-PCA algorithm will be applied to estimate the Poisson parameter for each matrix entry. Then a specific number of entries will be selected as sample data points to compare with the theoretical Poisson distribution.

References

glmpcascpoisson