dataInput {SDAMS}R Documentation

Mass spectrometry data input

Description

Two ways to input metabolomics or proteomics data from mass spectrometry as SummarizedExperiment:

  1. createSEFromCSV creates SummarizedExperiment object from csv files;

  2. createSEFromMatrix creates SummarizedExperiment object from separate matrices: one for feature data and the other one for group.

Usage

createSEFromCSV(featurePath, groupPath, rownames1 = 1, rownames2 = 1,
                  header1 = TRUE, header2 = TRUE)

createSEFromMatrix(feature, group)

Arguments

featurePath

path for feature data.

groupPath

path for subject grouping data.

rownames1

indicator for feature data with row names. If NULL, row numbers are automatically generated.

rownames2

indicator for group data with row names. If NULL, row numbers are automatically generated.

header1

a logical value indicating whether the first row of feature is column names. The default value is TRUE.

header2

a logical value indicating whether the first row of group is column names. The default value is TRUE. If group input is a vector, set to False.

feature

a matrix with row being features and column being subjects.

group

a one column matrix containing subject grouping information.

Value

An object of SummarizedExperiment class.

Author(s)

Yuntong Li <yuntong.li@uky.edu>, Chi Wang <chi.wang@uky.edu>, Li Chen <lichenuky@uky.edu>

See Also

SDA input requires an object of SummarizedExperiment class.

Examples

# ---------- csv input -------------
directory1 <- system.file("extdata", package = "SDAMS", mustWork = TRUE)
path1 <- file.path(directory1, "ProstateFeature.csv")
directory2 <- system.file("extdata", package = "SDAMS", mustWork = TRUE)
path2 <- file.path(directory2, "ProstateGroup.csv")

exampleSE <- createSEFromCSV(path1, path2)
exampleSE

# ---------- matrix input -------------
set.seed(100)
featureInfo <- matrix(runif(800, -2, 5), ncol = 40)
featureInfo[featureInfo<0] <- 0
rownames(featureInfo) <- paste("feature", 1:20, sep = '')
colnames(featureInfo) <- paste('subject', 1:40, sep = '')
groupInfo <- data.frame(grouping=matrix(sample(0:1, 40, replace = TRUE),
                        ncol = 1))
rownames(groupInfo) <- colnames(featureInfo)

exampleSE <- createSEFromMatrix(feature = featureInfo, group = groupInfo)
exampleSE

[Package SDAMS version 1.0.0 Index]