getSignatureNames.Rd
Extracts a character vector of molecular signature names.
getGeneSets(object, ..., class = NULL)
getMetaboliteSets(object, ..., class = NULL)
getProteinSets(object, ..., class = NULL)
getSignatureNames(object, ..., class = NULL, assay_name = activeAssay(object))
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
Additional selection helpers from the tidyselect package that match names according to a given pattern.
Character vector of signature classes with which to subset the output.
Only relevant if the SPATA2
object contains more than
one assay: Denotes the assay of interest and thus the
molecular modality to use. Defaults to the active assay
as set by activateAssay()
.
Character vector.
These functions retrieve signature names from the provided object.
getSignatureNames()
: The signature names from the assay specified in assay_name
.
getGeneSets()
: The signature names from the assay with @modality = 'gene' (assay_name = 'gene'
).
getMetaboliteSets()
: The signature names from the assay with @modality = 'metabolite' (assay_name = 'metabolite'
).
getProteinSets()
: The signature names from the assay with @modality = 'protein' (assay_name = 'protein'
).
If 'signature' is NULL
, it returns all molecules from the respective assay in the object.
vselect()
, lselect()
Documentation of slot @signatures in the MolecularAssay
-class.
To extract character vectors of molecule names getMolecules()
or getGenes()
, ...
To extract character vectors of signature names getSignatureNames()
, getGeneSets()
, ...
To add signatures addSignature()
or addGeneSet()
, ...
library(SPATA2)
object <- loadExampleObject("UKF269T", process = TRUE)
# only one assay exists...
getAssayNames(object)
# ... which is the default assay
activeAssay(object)
## extraction
# opt 1
all_signatures <- getSignatureNames(object, assay_name = "gene")
str(all_signatures)
# whether you specify assay_name or not does not make a difference since
# the object only contains one assay
hallmark_signatures <- getSignatureNames(object, class = "HM")
str(hallmark_signatures)
# opt 2
hallmark_signatures <- getGeneSets(object, class = "HM")
str(hallmark_signatures)
# opt 3 - failes cause no 'protein' assay
protein_signatures <- getProteinSets(object, assay_name = "protein")
## usage as character vector for argument input
set.seed(123)
color_by <- sample(all_signatures, size = 9)
plotSurfaceComparison(object, color_by = color_by, outline = T, pt_clrsp = "Reds 3")
coords_df <- getCoordsDf(object)
print(coords_df)
coords_df <- joinWithVariables(object, spata_df = coords_df, variables = hallmark_signatures)
print(coords_df)