meltSE: Converting a 'SummarizedExperiment' object into a long...

meltSER Documentation

Converting a SummarizedExperiment object into a long data.frame

Description

meltSE Converts a SummarizedExperiment object into a long data.frame which can be used for tidyverse-tools.

Usage

meltSE(
  x,
  assay.type = assay_name,
  assay_name = "counts",
  add.row = add_row_data,
  add_row_data = NULL,
  add.col = add_col_data,
  add_col_data = NULL,
  row.name = feature_name,
  feature_name = "FeatureID",
  col.name = sample_name,
  sample_name = "SampleID",
  ...
)

## S4 method for signature 'SummarizedExperiment'
meltSE(
  x,
  assay.type = assay_name,
  assay_name = "counts",
  add.row = add_row_data,
  add_row_data = NULL,
  add.col = add_col_data,
  add_col_data = NULL,
  row.name = feature_name,
  feature_name = "FeatureID",
  col.name = sample_name,
  sample_name = "SampleID",
  ...
)

Arguments

x

A numeric matrix or a SummarizedExperiment

assay.type

a character value to select an assayNames

assay_name

a single character value for specifying which assay to use for calculation. (Please use assay.type instead. At some point assay_name will be disabled.)

add.row

NULL, TRUE or a character vector to select information from the rowData to add to the molten assay data. If add.row = NULL no data will be added, if add.row = TRUE all data will be added and if add.row is a character vector, it will be used to subset to given column names in rowData. (default: add.row = NULL)

add_row_data

Deprecated. Use add.row instead.

add.col

NULL, TRUE or a character vector to select information from the colData to add to the molten assay data. If add.col = NULL no data will be added, if add.col = TRUE all data will be added and if add.col is a character vector, it will be used to subset to given column names in colData. (default: add.col = NULL)

add_col_data

Deprecated. Use add.col instead.

row.name

a character scalar to use as the output's name for the feature identifier. (default: row.name = "FeatureID")

feature_name

Deprecated. Use row.name instead.

col.name

a character scalar to use as the output's name for the sample identifier. (default: col.name = "SampleID")

sample_name

Deprecated. Use col.name instead.

...

optional arguments:

  • check_names: A boolean value passed to data.frame function's check.name argument. Determines if sample names are checked that they are syntactically valid variable names and are not duplicated. If they are not, sample names are modified. (default: check_names = TRUE)

Details

If the colData contains a column “SampleID” or the rowData contains a column “FeatureID”, they will be renamed to “SampleID_col” and “FeatureID_row”, if row names or column names are set.

Value

A tibble with the molten data. The assay values are given in a column named like the selected assay assay.type. In addition, a column “FeatureID” will contain the rownames, if set, and analogously a column “SampleID” with the colnames, if set

Author(s)

Sudarshan A. Shetty

Examples

data(GlobalPatterns)
molten_tse <- meltSE(GlobalPatterns,
                        assay.type = "counts",
                        add.row = TRUE,
                        add.col = TRUE
                        )
molten_tse

FelixErnst/mia documentation built on June 19, 2024, 3:51 a.m.