MSnSet instance. It is a wrapper around
Biobase's readExpressionSet function with an
additional featureDataFile parameter to include feature data.
See also readExpressionSet for more details.
readMSnSet2 is a simple version that takes a single text
spreadsheet as input and extracts the expression data and feature
meta-data to create and MSnSet. Note that when using readMSnSet2, one should not set
rownames as additional argument to defined feature names. It is
ignored and used to set fnames if not provided otherwise.
readMSnSet(exprsFile, phenoDataFile, featureDataFile, experimentDataFile, notesFile, path, annotation, exprsArgs = list(sep = sep, header = header, row.names = row.names, quote = quote, ...), phenoDataArgs = list(sep = sep, header = header, row.names = row.names, quote = quote, stringsAsFactors = stringsAsFactors, ...), featureDataArgs = list(sep = sep, header = header, row.names = row.names, quote = quote, stringsAsFactors = stringsAsFactors, ...), experimentDataArgs = list(sep = sep, header = header, row.names = row.names, quote = quote, stringsAsFactors = stringsAsFactors, ...), sep = "\t", header = TRUE, quote = "", stringsAsFactors = FALSE, row.names = 1L, widget = getOption("BioC")$Base$use.widgets, ...)
readMSnSet2(file, ecol, fnames, ...)read.table is called
with this as its file argument and further arguments given by
exprsArgs.read.AnnotatedDataFrame is called
with this as its file argument and further arguments given by
phenoDataArgs.read.MIAME is called with this
as its file argument and further arguments given by
experimentDataArgs.readLines is used to input the file.read.table when reading in the expression matrix.read.AnnotatedDataFrame) when reading
the phenotypic data.read.MIAME) when reading the experiment data.read.table-like functions.read.AnnotatedDataFrame.read.table-like functions. read.AnnotatedDataFrame is called
with this as its file argument and further arguments given by
phenoDataArgs.read.AnnotatedDataFrame) when reading the phenotypic
data. character indicating the spreadsheet file or a
data.frame (new in version 1.19.8). Default, when file
is a character, is to read the file as a comma-separated
values (csv). If different, use the additional arguments, passed to
read.csv, to parametrise file import. Passing a data.frame can be particularly useful if the
spreadsheet is in Excel format. The appropriate sheet can first be
read into R as a data.frame using, for example
readxl::read_excel, and then pass it to readMSnSet2.
numeric indicating the indices of the columns to
be used as expression values. Can also be a character
indicating the names of the columns. Caution must be taken if the
column names are composed of special characters like ( or
- that will be converted to a .. If ecol does
not match, the error message will dislpay the column names are see
by R. character or numeric of length
1 indicating the column to be used as feature names. MSnSet class. grepEcols and getEcols helper
functions to identify the ecol values. The MSnbase-io
vignette illustrates these functions in detail. It can be accessed
with vignette("MSnbase-io").
## Not run:
# exprsFile <- "path_to_intensity_file.csv"
# fdatafile <- "path_to_featuredata_file.csv"
# pdatafile <- "path_to_sampledata_file.csv"
# ## Read ExpressionSet with appropriate parameters
# res <- readMSnSet(exprsFile, pdataFile, fdataFile, sep = "\t", header=TRUE)
# ## End(Not run)
library("pRolocdata")
f0 <- dir(system.file("extdata", package = "pRolocdata"),
full.names = TRUE,
pattern = "hyperLOPIT-SIData-ms3-rep12-intersect.csv")
basename(f0)
res <- readMSnSet2(f0, ecol = 8:27)
res
Run the code above in your browser using DataLab