Convert tabular data from a spreadsheet or a data.frame into a SingleCellExperiment object.

readSingleCellExperiment(table, ecol, fnames, ...)

Arguments

table

File or object holding the quantitative data. Can be either a character(1) with the path to a text-based spreadsheet (comma-separated values by default, but see ...) or an object that can be coerced to a data.frame. It is advised not to encode characters as factors.

ecol

A numeric indicating the indices of the columns to be used as assay 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 . by the read.csv function. If ecol does not match, the error message will display the column names as seen by the read.csv function.

fnames

An optional character(1) or numeric(1) indicating the column to be used as row names.

...

Further arguments that can be passed on to read.csv except stringsAsFactors, which is always FALSE.

Value

An instance of class SingleCellExperiment.

Note

The SingleCellExperiment class is built on top of the RangedSummarizedExperiment class. This means that some column names are forbidden in the rowData. Avoid using the following names: seqnames, ranges, strand, start, end, width, element

See also

Author

Laurent Gatto, Christophe Vanderaa

Examples

## Load a data.frame with PSM-level data
data("mqScpData")

## Create the QFeatures object
sce <- readSingleCellExperiment(mqScpData,
                                grep("RI", colnames(mqScpData)))