MWAS_SummarizedExperiment: Create a SummarizeExperiment object

Description Usage Arguments Value References Examples

View source: R/MWAS_SummarizedExperiment.R

Description

This function formats the metabolic and clinical data into a SummarizedExperiment object.

Usage

1
MWAS_SummarizedExperiment(metabo_matrix, clinical_matrix, sample_type)

Arguments

metabo_matrix

numeric matrix containing the metabolic data (e.g. NMR peak intensities or metabolite concentrations). The columns of the matrix must correspond to the metabolic variables and the rows to the samples. Column and row names must contain the metabolite IDs (e.g. chemical shifts for NMR data) and the sample IDs, respectively.

clinical_matrix

numeric matrix containing the clinical data (e.g. age, gender). The columns of the matrix must correspond to the phenotypic variables and the rows to the samples. Column and row names must contain the phenotype IDs and the sample IDs, respectively. For samples without clinical data (e.g. quality control (QC) samples), NA values must be used.

sample_type

numeric vector indicating sample type (i.e. experimental sample or QC sample). The vector must be coded as follows: experimental sample = 0, QC sample = 1. If QC samples are not available, all the elements of this vector must be 0.

Value

A SummarizedExperiment object.

References

Morgan M, et al. (2016). SummarizedExperiment: SummarizedExperiment container. R package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Load data
data(metabo_SE)

## Get metabolic_data, clinical_data, and sample_type
library(SummarizedExperiment)
metabolic_data = t(assays(metabo_SE)$metabolic_data)
clinical_data = as.matrix(colData(metabo_SE)[, -5])
sample_type = as.vector(colData(metabo_SE)[, 5])

## Reconstruct SummarizedExperiment
data_SE = MWAS_SummarizedExperiment(metabolic_data, clinical_data,
                                    sample_type)

MWASTools documentation built on Nov. 8, 2020, 5:07 p.m.