summarizeMolecularProfiles {ToxicoGx} | R Documentation

## Takes molecular data from a ToxicoSet, and summarises them into one entry per drug and experimental condition.

### Description

Given a ToxicoSet with molecular data, this function will summarize the data into one profile per experimental condition (duration, dose level) using the chosen summary.stat and return a SummarizedExperiment object, with one Assay corresponding to a requested drug.

### Usage

    summarizeMolecularProfiles(
      tSet,
      mDataType,
      cell_lines = NULL,
      drugs = NULL,
      features = NULL,
      duration = NULL,
      dose = c("Control", "Low", "Middle", "High"),
      summary.stat = c("mean", "median", "first", "last"),
      fill.missing = TRUE,
      summarize = TRUE,
      verbose = TRUE
    )

### Arguments

`tSet` | `ToxicoSet` The ToxicoSet to summarize
`mDataType` | `character` which one of the molecular data types to use in the analysis, out of all the molecular data types available for the tSet for example: rna
`cell_lines` | `character` The cell lines to be summarized. If any cell.line has no data, missing values will be created
`drugs` | `character` The drugs to be summarized
`features` | `character` A vector of the feature names to include in the summary
`duration` | `character` A vector of durations to summarize across
`dose` | `character` The dose level to summarize replicates across
`summary.stat` | `character` which summary method to use if there are repeated cell_lines? Choices are "mean", "median", "first", or "last"
`fill.missing` | `boolean` should the missing cell lines not in the molecular data object be filled in with missing values?
`summarize` | A flag which when set to FALSE (defaults to TRUE) disables summarizing and returns the data unchanged as a ExpressionSet
`verbose` | `boolean` should messages be printed

### Value

`SummarizedExperiment` A SummarizedExperiment object with the molecular data summarized per cell line.

### Examples

    data(TGGATESsmall)
    summMP <- ToxicoGx::summarizeMolecularProfiles(
      tSet = TGGATESsmall, mDataType = "rna",
      cell_lines=cellNames(TGGATESsmall), drugs = head(drugNames(TGGATESsmall)),
      features = fNames(TGGATESsmall,"rna")[seq_len(100)], duration = "8",
      dose = c("Control", "High"), summary.stat = "median",
      fill.missing = TRUE, verbose=TRUE
      )

    #subset into expression matrix for a requested drug
    assays <- SummarizedExperiment::assays(summMP)[[drugNames(TGGATESsmall)[1]]]
    #summarization of phenoData for requested experiments
    phenoData <- SummarizedExperiment::colData(summMP)
    #summarization of phenoData for requested experiments
    featureData <- SummarizedExperiment::rowData(summMP) #featureData for requested experiments

[Package ToxicoGx version 1.4.0 Index]