mkAssay {TBSignatureProfiler} | R Documentation

## Add SummarizedExperiment assays to the data structure.

### Description

Given an input of a Summarized Experiment with a counts or CPM assay, This function creates additional assays for a gene expression count dataset to be used in further analysis.

### Usage

    mkAssay(
      SE_obj,
      input_name = "counts",
      output_name = NULL,
      log = FALSE,
      counts_to_CPM = TRUE,
      prior_counts = 3
    )

### Arguments

`SE_obj` | a `SummarizedExperiment` object containing gene expression data. Required.
`input_name` | a character string specifying the name of the assay to be referenced for creating additional assays. Default is `"counts"`.
`output_name` | a character string to concatenate to "log" when computing a log assay. If `NULL`, then `input_name` will be substituted. Only used if `log = TRUE`. Default is `NULL`.
`log` | logical. Indicate whether an assay returned should be the log of whichever assay is specified in `"output_name"`. If `counts_to_CPM = TRUE` as well, then a log CPM assay will also be created. Default is `FALSE`.
`counts_to_CPM` | logical. This argument only applies if the `input_type` is a counts assay. If `TRUE`, then the output assays will include a normalized CPM assay. If `log = TRUE` as well, then a log CPM assay will also be created. Default is `TRUE`.
`prior_counts` | an integer specifying the average count to be added to each observation to avoid taking the log of zero. Used only if `log = TRUE`. The default is `3`.

### Value

This function returns a `SummarizedExperiment` object with up to 3 additional assay types attached to the original inputted object.

`cpm` | Counts per million
`logcpm` | Log counts per million
`log_<output_name>` | Log of original inputted assay. `<output_name>` will be replaced by inputted parameter.

### Author(s)

Aubrey Odom

### Examples

    # Create a log assay of the original assay input
    # TB_hiv dataset already has counts data
    log_only <- mkAssay(TB_hiv, log = TRUE, counts_to_CPM = FALSE)
    log_only

    # Create a CPM assay
    CPM_only <- mkAssay(TB_hiv)
    CPM_only

    # Create a logCPM, logcounts, and CPM assay
    all_assays <- mkAssay(TB_hiv, log = TRUE)
    all_assays

[Package TBSignatureProfiler version 1.2.0 Index]