getTrimmedExternalSet: Get a trimmed version of an external data set

Description Usage Arguments Value Examples

View source: R/getTrimmedExternalSet.R

Description

Returns a SummarizedExperiment that is a subset of dataSet containing only genes that are present in AIBSARNA, for use in getSimScores or getUNDmatrix.

Usage

1
2
3
4
5
6
7
getTrimmedExternalSet(
  dataSet,
  dataSetId = "gene_symbol",
  AIBSARNA = NULL,
  AIBSARNAid = c("gene_id", "ensembl_gene_id", "gene_symbol", "entrez_id",
    "refseq_ids")
)

Arguments

dataSet

a CellScabbard or SummarizedExperiment object

dataSetId

the name of the column of gene identifiers in rowData(dataSet) to be used to compare dataSet 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 object containing trimmed data set

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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)
# use the appropriate id's to extract the trimmed gene set from the data
dataSetId = dataSetId(myGenes)
AIBSARNAid = AIBSARNAid(myGenes)
myTrimmedGeneSet <- getTrimmedExternalSet(myGenes,
    dataSetId = dataSetId, AIBSARNA, AIBSARNAid = AIBSARNAid)

# 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")
myTrimmedGeneSet <- getTrimmedExternalSet(myGeneSet,
    dataSetId = "gene_symbol", AIBSARNA, AIBSARNAid = "gene_symbol")

BrainSABER documentation built on Nov. 8, 2020, 7:28 p.m.