Skip to content

Commit 9589349

Browse files
Fixed the issue in the background genes flow.
1 parent eda133f commit 9589349

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

R/teEnrichmentCustom.R

+5-5
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ teEnrichmentCustom <- function(inputGenes = NULL, tissueSpecificGenes = NULL,
131131
if(!is.null(backgroundGenes))
132132
{
133133
bgGenesFlag <- TRUE
134-
geBackgroundGenes <- backgroundGenes
135-
backgroundGenes <- geneIds(geBackgroundGenes)
134+
totalGenes <- geneIds(backgroundGenes)
135+
finalTissueSpecificGenes <- finalTissueSpecificGenes %>%
136+
dplyr::filter(Gene %in% totalGenes)
137+
}else
138+
{
136139
message("No background list provided. Using all the
137140
genes as background.")
138-
totalGenes <- backgroundGenes
139-
ridx <- tissueSpecificGenes$Gene %in% totalGenes
140-
finalTissueSpecificGenes <- tissueSpecificGenes[ridx, , drop = FALSE]
141141
}
142142
#### Calculate the Hypergeometric P-Value#########
143143
tissueNames <- as.character(unique(finalTissueSpecificGenes$Tissue))

0 commit comments

Comments
 (0)