Skip to content

Commit b5c6003

Browse files
author
Jain
committed
Added number of samples in the dataset in the output.
1 parent e661859 commit b5c6003

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

R/teEnrichment.R

+4-1
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ teEnrichment <- function(inputGenes = NULL, rnaSeqDataset = 1,
306306
colData = colnames(teInputGeneGroups))
307307
tissueName <- tissueDetails[tissueDetails$RName ==
308308
tissue, "TissueName"]
309+
samples <- tissueDetails[tissueDetails$RName ==
310+
tissue, "Sample"]
309311
nTeGenesInTissue <- nrow(tissueGenes)
310312
nTotalGenes <- nrow(geneMappingForCurrentDataset)
311313
nTotalInputGenes <- length(inputEnsemblGenes)
@@ -316,7 +318,7 @@ teEnrichment <- function(inputGenes = NULL, rnaSeqDataset = 1,
316318
foldChange <- (overlapGenes/nTotalInputGenes)/
317319
(nTeGenesInTissue/nTotalGenes)
318320
return(c(pValue, overlapGenes, tissueName,
319-
seTeExpressionData, seTeInputGeneGroups,foldChange))
321+
seTeExpressionData, seTeInputGeneGroups,foldChange,samples))
320322
})
321323

322324
df <- do.call("rbind", x)
@@ -329,6 +331,7 @@ teEnrichment <- function(inputGenes = NULL, rnaSeqDataset = 1,
329331
output <- data.frame(Log10PValue=pValueList,
330332
Tissue.Specific.Genes=unlist(df[, 2]),
331333
fold.change=unlist(df[, 6]),
334+
samples=unlist(df[, 7]),
332335
row.names = unlist(df[, 3]))
333336
seOutput <- SummarizedExperiment(assays = SimpleList(as.matrix(output)),
334337
rowData = row.names(output), colData = colnames(output))

tests/testthat/tests.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test_that("check the length of the output from teGeneEnrichment", {
2525
})
2626

2727
test_that("check number of columns of the enrichment matrix", {
28-
expect_equal(ncol(TSGEOutput), 3)
28+
expect_equal(ncol(TSGEOutput), 4)
2929
})
3030

3131
test_that("check number of tissues in the enrichment matrix using Human protein atlas output", {

0 commit comments

Comments
 (0)