This is the main function to access slot data for all genes as a (potentially sparse) matrix.
GetMatrix(
data,
mode.slot = DefaultSlot(data),
columns = NULL,
genes = Genes(data),
name.by = "Symbol",
summarize = NULL
)
A (potentially) sparse matrix containing the desired values
A grandR object
Which kind of data to access (see details)
which columns (i.e. samples or cells) to return (see details)
Restrict the output table to the given genes
A column name of Coldata(data). This is used as the rownames of the output table
Should replicates by summarized? see details
To refer to data slots, the mode.slot syntax can be used: It is either a data slot, or one of (new,old,total) followed by a dot followed by a slot. For new or old, the data slot value is multiplied by ntr or 1-ntr. This can be used e.g. to obtain the new counts.
Columns can be given as a logical, integer or character vector representing a selection of the columns (samples or cells).
The expression is evaluated in an environment havin the Coldata
, i.e. you can use names of Coldata
as variables to
conveniently build a logical vector (e.g., columns=Condition=="x").
The summarization parameter can only be specified if columns is NULL. It is either a summarization matrix (GetSummarizeMatrix) or TRUE (in which case GetSummarizeMatrix(data) is called). If there a NA values, they are imputed as the mean per group!
GetData,GetAnalysisTable,DefaultSlot,Genes,GetSummarizeMatrix