MolecularAssay
createMolecularAssay.Rd
Creates and adds an object of class MolecularAssay
to the SPATA2
object.
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
Character value. Should best describe the molecular type of the count matrix.
Additionally, it defines the assay name, that is created with the count matrix and further
referred to via the argument assay_name
. Read more on molecular modalities in
SPATA2 here.
A count matrix. Column names correspond to the barcodes of the observations. Rownames correspond to the names of the molecular features (genes, proteins, metabolites etc.).
A list of processed matrices set in slot @mtr_proc.
Character value. The name of the matrix chosen as
the active matrix. If mtr_proc
is an empty
list, this value defaults to 'counts'
Logical value. Must be TRUE
to allow overwriting.
Logical. If TRUE
, informative messages regarding
the computational progress will be printed.
(Warning messages will always be printed.)
Gives access to set remaining slots of the MolecularAssay
object.
The updated input object, containing the added, removed or computed results.
Creating an assay only with processed matrices (mtr_proc
) while not specifying
mtr_counts
is possible. In that case, mtr_counts
is populated with an empty
matrix that contains all unique molecule names found in the matrices as rownames
and barcodes as colnames.
Generally speaking, the count matrix contains all molecule names! Processed matrices contain either identical molecule names or a subset of those found in the count matrix.
The molecules of the added assay must not already exist in the SPATA2
object.
Variables in SPATA2 are case sensitive! If you want to add, for instance, a protein assay to
the SPATA2
object that already contains genes, you can provide the protein names
like this Ldh while the gene names exist like this LDH. See stringr::str_to_title()
and
related functions.