Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Release v1.4.0 #120

Merged
merged 12 commits into from
Mar 9, 2021
Prev Previous commit
fix bugs in path change
  • Loading branch information
baigal628 committed Mar 6, 2021
commit f561ee15230b94a5261d4c8c9c5957f764264d8d
16 changes: 8 additions & 8 deletions R/RNAAnnotateTranscriptionFactor.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ RNAAnnotateTranscriptionFactor <- function(RNA, genes, cluster = NULL, project =
method = toupper(method)
if(method == "RABIT"){
scorename = "log(Rabitscore)"
out_fdr_max_log = tryCatch(expr = RunRABIT(genes = genes, project = project, rabit.path = rabit.path, organism = org),
out_fdr_max_log = tryCatch(expr = RunRABIT(genes = genes, project = project, rabit.path = rabit.path, organism = org, outdir="."),
error = function(cond) {return(cond$message)})
}
if(method == "LISA"){
scorename = "log(Lisascore)"
if(lisa.mode == "multi"){
out_fdr_max_log = RunLISAMulti(genes = genes, project = project, organism = organism, lisa.path = lisa.path)
out_fdr_max_log = RunLISAMulti(genes = genes, project = project, organism = organism, lisa.path = lisa.path, outdir=".")
}
if(lisa.mode == "one-vs-rest"){
out_fdr_max_log = RunLISAWeb(genes = genes, project = project, organism = organism)
out_fdr_max_log = RunLISAWeb(genes = genes, project = project, organism = organism, outdir=".")
}
}

Expand Down Expand Up @@ -210,7 +210,7 @@ RNAAnnotateTranscriptionFactor <- function(RNA, genes, cluster = NULL, project =
}


RunLISAMulti <- function(genes, project, organism = "GRCh38", lisa.path = lisa.path)
RunLISAMulti <- function(genes, project, organism = "GRCh38", lisa.path = lisa.path, outdir=".")
{
if(organism == "GRCh38"){
species = "hg38"
Expand Down Expand Up @@ -267,7 +267,7 @@ RunLISAMulti <- function(genes, project, organism = "GRCh38", lisa.path = lisa.p
return(tf_all_log10)
}

RunLISAWeb <- function(genes, project, organism = "GRCh38")
RunLISAWeb <- function(genes, project, organism = "GRCh38", outdir=".")
{
if(organism == "GRCh38"){
species = "hg38"
Expand All @@ -278,7 +278,7 @@ RunLISAWeb <- function(genes, project, organism = "GRCh38")

cluster_markers_list <- split(genes, genes$cluster)

outputDir <- paste0(project, ".lisa")
outputDir <- file.path(outdir, paste0(project, ".lisa"))
if (!file.exists(outputDir)) dir.create(path=outputDir)

res_zip_url_list = rep("zip", length(cluster_markers_list))
Expand Down Expand Up @@ -382,7 +382,7 @@ DownloadResult <- function(resurl, destfile)
}


RunRABIT <- function(genes, project, rabit.path, organism = "hsa")
RunRABIT <- function(genes, project, rabit.path, organism = "hsa", outdir=".")
{
if(organism == "hsa"){
genes$entrezid = MAGeCKFlute::TransGeneID(genes$gene, fromType = "Symbol", toType = "Entrez",
Expand All @@ -401,7 +401,7 @@ RunRABIT <- function(genes, project, rabit.path, organism = "hsa")
genes = na.omit(genes)
cluster_markers_list <- split(genes, genes$cluster)

outputDir <- paste0(project, ".RABIT")
outputDir <- file.path(outdir, paste0(project, ".RABIT"))
if (!file.exists(outputDir)){
dir.create(path=outputDir)
}else{
Expand Down