convertESet: Convert the phenotype data of an ExpressionSet or MsnSet into...

Description Usage Arguments Value Examples

View source: R/fct_imports.R

Description

This function converts an ExpressionSet/MsnSet object into a dataframe to make it usable by the shiny application of wpm as well as by the wrapper function (version of wpm in command line)

Usage

1
convertESet(eSet_obj, gp_field = NULL)

Arguments

eSet_obj

an ExpressionSet/MsnSet object contaning the phenotype data

gp_field

character, corresponding to the phenotype data used to categorize samples into distinct groups if any

Value

a dataframe containing 3 fields: Sample, Group and ID.

Examples

1
2
3
4
5
6
7
8
9
sample_names <- c("s1","s2","s3","s4", "s5")
M <- matrix(NA, nrow = 4, ncol = 5)
colnames(M) <- sample_names
rownames(M) <- paste0("id", LETTERS[1:4])
pd <- data.frame(Environment = rep_len(LETTERS[1:3], 5),
                 Category = rep_len(1:2, 5), row.names = sample_names)
rownames(pd) <- colnames(M)
x <- MSnbase::MSnSet(exprs = M,pData =  pd)
convertESet(x, "Environment")

wpm documentation built on Nov. 8, 2020, 5:34 p.m.