Skip to content

Commit

Permalink
optionally keep genes in enrichr
Browse files Browse the repository at this point in the history
  • Loading branch information
hrehrauer committed Dec 13, 2024
1 parent 81a203b commit 8109a78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 7 additions & 2 deletions R/app-ScSeurat.R
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,13 @@ addCellQcToSeurat <- function(scData, param=NULL, BPPARAM=NULL, ribosomalGenes=N
return(scData)
}

querySignificantClusterAnnotationEnrichR <- function(genesPerCluster, dbs, overlapGeneCutOff = 3, adjPvalueCutOff = 0.001, reportTopN = 5) {
querySignificantClusterAnnotationEnrichR <- function(genesPerCluster, dbs, overlapGeneCutOff = 3, adjPvalueCutOff = 0.001,
reportTopN = 5, keepGenes=FALSE) {
enrichRout <- list()
columnsToKeep <- c("Term", "Cluster", "Overlap", "OverlapGenesN", "Adjusted.P.value", "Odds.Ratio", "Combined.Score")
if (keepGenes){
columnsToKeep <- c(columnsToKeep, "Genes")
}
for (cluster in unique(names(genesPerCluster))) {
enriched <- enrichr(as.character(genesPerCluster[[cluster]]), dbs)

Expand All @@ -422,7 +427,7 @@ querySignificantClusterAnnotationEnrichR <- function(genesPerCluster, dbs, overl
filter(., Adjusted.P.value < adjPvalueCutOff) %>%
filter(., OverlapGenesN > overlapGeneCutOff) %>%
head(reportTopN)
enrichRout[[cluster]][[db]] <- enriched_db[, c("Term", "Cluster", "Overlap", "OverlapGenesN", "Adjusted.P.value", "Odds.Ratio", "Combined.Score")]
enrichRout[[cluster]][[db]] <- enriched_db[, columnsToKeep]
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions inst/extdata/EZ_GLOBAL_VARIABLES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ CNVNATOR="/usr/local/ngseq/src/CNVnator_v0.3.3/src/cnvnator"
## SMRT
SMRT_CMD="SMRT=/misc/ngseq8/opt/smrtanalysis.2.3.0/install/smrtanalysis_2.3.0.140936; source $SMRT/etc/setup.sh; fofnToSmrtpipeInput.py input.fofn > input.xml; smrtpipe.py --params=settings.xml xml:input.xml"

############# R-SGE options
# RSGE_RUN_JOB="/usr/local/ngseq/opt/sushi_scripts/Rsge/RunSgeJob"
# RSGE_MONITOR_JOB="/usr/local/ngseq/opt/sushi_scripts/Rsge/MonitorJob.sh"
# QSUB="/usr/local/ge62/bin/lx24-amd64/qsub"
# SGE_ROOT="/usr/local/ge62"


## METAGENONMICS (MOTHUR-UPARSE-QIIME)
METAGENOMICS_ROOT="/usr/local/ngseq/templateFiles/"
Expand Down

0 comments on commit 8109a78

Please sign in to comment.