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

Calculate counts-per-million (CPM) values from the count data.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
calculateCPM(x, ...)
## S4 method for signature 'ANY'
calculateCPM(
x,
size.factors = NULL,
subset.row = NULL,
size_factors = NULL,
subset_row = NULL
)
## S4 method for signature 'SummarizedExperiment'
calculateCPM(x, ..., assay.type = "counts", exprs_values = NULL)
## S4 method for signature 'SingleCellExperiment'
calculateCPM(x, size.factors = NULL, ...)
``` |

`x` |
A numeric matrix of counts where features are rows and cells are columns. Alternatively, a SummarizedExperiment or a SingleCellExperiment containing such counts. |

`...` |
For the generic, arguments to pass to specific methods. For the SummarizedExperiment method, further arguments to pass to the ANY method. For the SingleCellExperiment method, further arguments to pass to the SummarizedExperiment method. |

`size.factors` |
A numeric vector containing size factors to adjust the library sizes.
If |

`subset.row` |
A vector specifying the subset of rows of |

`size_factors, subset_row, exprs_values` |
Soft-deprecated counterparts to the arguments above. |

`assay.type` |
A string or integer scalar specifying the assay of |

If `size.factors`

are provided or available in `x`

, they are used to define the effective library sizes.
This is done by scaling all size factors such that the mean factor is equal to the mean sum of counts across all features.
The effective library sizes are then used as the denominator of the CPM calculation.

A numeric matrix of CPM values with the same dimensions as `x`

(unless `subset.row`

is specified).

Aaron Lun

`normalizeCounts`

, on which this function is based.

1 2 3 | ```
example_sce <- mockSCE()
cpm(example_sce) <- calculateCPM(example_sce)
str(cpm(example_sce))
``` |

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.