Learn R Programming

grandR (version 0.2.6)

ToIndex: 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)

Value

Numeric indices corresponding to the given genes

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

See Also

GeneInfo

Examples

Run this code
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")

Run the code above in your browser using DataLab