ToIndex {grandR} | R Documentation |
Obtain the indices of the given genes
Description
Genes can be referred to by their names, symbols, row numbers in the gene table, or a logical vector referring to the gene table rows. This function accepts all these possibilities and returns the row number in the gene table for the given genes,
Usage
ToIndex(data, gene, regex = FALSE, remove.missing = TRUE, warn = TRUE)
Arguments
data |
The grandR object |
gene |
A vector of genes. Can be either numeric indices, gene names, gene symbols or a logical vector |
regex |
Treat gene as a regex and return all that match |
remove.missing |
if TRUE, do not return missing genes (return NA otherwise) |
warn |
if TRUE emit a warning if not all genes are found |
Value
Numeric indices corresponding to the given genes
See Also
Examples
sars <- ReadGRAND(system.file("extdata", "sars.tsv.gz", package = "grandR"),
design=c("Cell",Design$dur.4sU,Design$Replicate))
ToIndex(sars,c("MYC"))
ToIndex(sars,GeneInfo(sars)$Symbol=="MYC")
[Package grandR version 0.2.5 Index]