getRelevantGenes {BrainSABER} | R Documentation

## Get a subset of AIBSARNA using a Gene Expression Vector

### Description

This function returns a subset of the AIBSARNA dataset, containing only the genes in `data`, which may be a vector, a SummarizedExperiment or derivative `assay()` and `rowData()`, or a CellScabbard. If a vector is used, it must consist of numerical gene expression values with names comparable to one column of identifiers present in AIBSARNA. If `data` is a CellScabbard, results are stored in the relevantGenes slot of the object.

### Usage

    getRelevantGenes(
      data,
      dataSetId = NULL,
      AIBSARNA = NULL,
      AIBSARNAid = c("gene_id", "ensembl_gene_id", "gene_symbol", "entrez_id",
        "refseq_ids")
    )

### Arguments

`data` | a vector of named gene expression values, or a compatible data set
`dataSetId` | (Optional) If `data` is not a vector, the name of the column of gene identifiers in rowData(dataSet) to be used to compare `data` to AIBSARNA.
`AIBSARNA` | an instance of the AIBSARNA dataset, built using the `buildAIBSARNA()` function
`AIBSARNAid` | the name of the column of rowData(AIBSARNA) that is comparable to dataSetId. One of "gene_id", "ensembl_gene_id", "gene_symbol", "entrez_id", "refseq_ids"

### Value

a SummarizedExperiment consisting of genes in `data`, sorted to match the order of the genes in `data`

### Examples

    AIBSARNA <- buildAIBSARNA(mini = TRUE)
    # Example 1 - using CellScabbard class
    # get a random sample of 3 genes
    totalGenes <- nrow(AIBSARNA)
    gene_idx <- sample.int(totalGenes, 3)
    sample_idx <- c(1,3,5)
    # Subset AIBSARNA
    exprs <- assay(AIBSARNA)[gene_idx, sample_idx]
    fd <- rowData(AIBSARNA)[gene_idx, ]
    pd <- colData(AIBSARNA)[sample_idx, ]
    # build a trimmed data set
    myGenes <- CellScabbard(exprsData = exprs, phenoData = pd, featureData = fd,
                            AIBSARNA = AIBSARNA, autoTrim = TRUE)
    relevantGenes(myGenes)

    # Example 2 - manual gene selection and relevant gene extraction
    myGenes <- c(4.484885, 0.121902, 0.510035)
    names(myGenes) <- c("TSPAN6", "DPM1", "C1orf112")
    myGeneSet <- getRelevantGenes(myGenes, AIBSARNA = AIBSARNA,
        AIBSARNAid = "gene_symbol")

[Package BrainSABER version 1.0.0 Index]