dataInput {SDAMS}R Documentation

Mass spectrometry data input

Description

Two ways to input metabolomics or proteomics data from mass spectrometry or single-cell RNA sequencing data as SummarizedExperiment:

  1. createSEFromCSV creates SummarizedExperiment object from csv files;

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

Usage

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

createSEFromMatrix(feature, colData)

Arguments

featurePath

path for feature/gene data.

colDataPath

path for colData.

rownames1

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

rownames2

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

header1

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

header2

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

feature

a matrix with row being features/genes and column being subjects/cells.

colData

a column type data containing information about the subjects/cells.

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("gene", 1:20, sep = '')
colnames(featureInfo) <- paste('cell', 1:40, sep = '')
groupInfo <- data.frame(grouping=matrix(sample(0:1, 40, replace = TRUE),
                        ncol = 1))
rownames(groupInfo) <- colnames(featureInfo)

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

[Package SDAMS version 1.14.0 Index]