ToIndex {grandR} | R Documentation |
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,
ToIndex(data, gene, regex = FALSE)
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 |
Numeric indices corresponding to the given genes
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")