getGenes | R Documentation |
Retrieves the names of molecules present in the given object, optionally filtered by a specific signature.
getGenes(object, signatures = NULL, simplify = TRUE, ...)
getMetabolites(object, signatures = NULL, simplify = TRUE, ...)
getMolecules(
object,
signatures = NULL,
simplify = TRUE,
assay_name = activeAssay(object)
)
getProteins(object, signatures = NULL, simplify = TRUE, ...)
object |
An object of class |
signatures |
Character vector or |
simplify |
Only relevant if |
... |
Used to absorb deprecated arguments or functions. |
assay_name |
Only relevant if the |
These functions retrieve molecule names from the provided object.
getMolecules()
: The molecules from the assay specified in assay_name
.
getGenes()
: The molecules from the assay with @modality = 'gene' (assay_name = 'gene'
).
getMetabolites()
: The molecules from the assay with @modality = 'metabolite' (assay_name = 'metabolite'
).
getProteins()
: The molecules from the assay with @modality = 'protein' (assay_name = 'protein'
).
If 'signature' is NULL
, it returns all molecules from the respective assay in the object.
A character vector or a named list of character vectors.
Molecule names are picked from the raw count matrix the assay.
getMatrix()
, getSignatureList()
library(SPATA2)
object <- loadExampleObject("UKF313T")
getAssayNames(object)
## no subsetting by signatures
# opt 1
genes <- getMolecules(object)
str(genes)
# opt 2
genes <- getMolecules(object, assay_name = "gene")
str(genes)
# opt 3
genes <- getGenes(object)
# opt 4 - fails cause no 'protein' assay
proteins <- getProteins(object)
## using signatures argument
# character vector of molecules of specific signatures (simplify defaults to TRUE)
genes_hyp <- getGenes(object, signatures = "HM_HYPOXIA")
genes_hyp
# list of gene sets
tcr_gs <- c("RCTM_TCR_SIGNALING", "RCTM_DOWNSTREAM_SIGNALING")
# simplify = TRUE (default) merges the output to a character vector of unique names
tcr_genes_vec <- getGenes(object, signatures = tcr_gs, simplify = TRUE)
str(tcr_genes_vec)
# simplify = FALSE returns a list
tcr_genes_lst <- getGenes(object, signatures = tcr_gs, simplify = FALSE)
str(tcr_genes_lst)
## DEPRECATED: of_gene_sets
tcr_genes <- getGenes(object, of_gene_sets = tcr_gs, simplify = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.