Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/fitTrendPoisson.R

Create a mean-variance trend for log-normalized expression values derived from Poisson-distributed counts.

1 2 3 4 5 6 7 8 9 | ```
fitTrendPoisson(
means,
size.factors,
npts = 1000,
dispersion = 0,
pseudo.count = 1,
BPPARAM = SerialParam(),
...
)
``` |

`means` |
A numeric vector of length 2 or more, containing the range of mean counts observed in the dataset. |

`size.factors` |
A numeric vector of size factors for all cells in the dataset. |

`npts` |
An integer scalar specifying the number of interpolation points to use. |

`dispersion` |
A numeric scalar specifying the dispersion for the NB distribution. If zero, a Poisson distribution is used. |

`pseudo.count` |
A numeric scalar specifying the pseudo-count to be added to the scaled counts before log-transformation. |

`BPPARAM` |
A BiocParallelParam object indicating how parallelization should be performed across interpolation points. |

`...` |
Further arguments to pass to |

This function is useful for modelling technical noise in highly diverse datasets without spike-ins, where fitting a trend to the endogenous genes would not be appropriate given the strong biological heterogeneity. It is mostly intended for UMI datasets where the technical noise is close to Poisson-distributed.

This function operates by simulating Poisson or negative binomial-distributed counts,
computing log-transformed normalized expression values from those counts,
calculating the mean and variance and then passing those metrics to `fitTrendVar`

.
The log-transformation ensures that variance is modelled in the same space that is used for downstream analyses like PCA.

Simulations are performed across a range of values in `means`

to achieve reliable interpolation,
with the stability of the trend determined by the number of simulation points in `npts`

.
The number of cells is determined from the length of `size.factors`

,
which are used to scale the distribution means prior to sampling counts.

A named list is returned containing:

`trend`

:A function that returns the fitted value of the trend at any value of the mean.

`std.dev`

:A numeric scalar containing the robust standard deviation of the ratio of

`var`

to the fitted value of the trend across all features used for trend fitting.

Aaron Lun

`fitTrendVar`

, which is used to fit the trend.

1 2 3 4 5 6 7 8 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.