-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: fix inputs of post jabba processes
- Loading branch information
1 parent
17be003
commit 2b0deb6
Showing
23 changed files
with
2,678 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
withAutoprint( | ||
{ | ||
library(optparse) | ||
options(bitmapType = "cairo") | ||
|
||
options(error = function() { | ||
traceback(2) | ||
quit("no", 1) | ||
}) | ||
if (!exists("opt")) { | ||
option_list <- list( | ||
make_option(c("-i", "--id"), type = "character", help = "sample id"), | ||
make_option(c("-g", "--gGraph"), type = "character", help = "an RDS file contains a gGraph or JaBbA graph with cn annotation on nodes and edges"), | ||
make_option(c("-r", "--gencode"), type = "character", help = "an RDS or GTF file of GENCODE"), | ||
make_option(c("-o", "--outdir"), type = "character", default = "./", help = "Directory to dump output into"), | ||
make_option(c("--cores"), type = "integer", default = 1L, help = "Number of cores") | ||
) | ||
parseobj <- OptionParser(option_list = option_list) | ||
opt <- parse_args(parseobj) | ||
saveRDS(opt, paste(opt$outdir, "cmd.args.rds", sep = "/")) | ||
} | ||
|
||
library(gGnome) | ||
library(gUtils) | ||
library(parallel) ## needed for mc.cores | ||
|
||
## setDTthreads(10) | ||
if (grepl(".rds$", opt$gencode)) { | ||
gencode <- readRDS(as.character(opt$gencode)) | ||
} else { | ||
gencode <- rtracklayer::import(opt$gencode) | ||
} | ||
|
||
|
||
## call complex events | ||
## fus = fusions(gG(jab = opt$gGraph), gencode, verbose = TRUE, opt$cores) | ||
fus <- fusions(gG(jab = opt$gGraph), gencode, verbose = TRUE, mc.cores = opt$cores) | ||
|
||
## update events with sample id | ||
if (length(fus)) { | ||
fus$set(id = opt$id) | ||
fus$set(mincn = fus$eval(edge = min(cn, na.rm = TRUE))) | ||
} | ||
|
||
saveRDS(fus, paste0(opt$outdir, "/", "fusions.rds")) | ||
|
||
quit("no", 0) | ||
}, | ||
echo = FALSE | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Config file for defining DSL2 per module options and publishing paths | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Available keys to override module options: | ||
ext.args = Additional arguments appended to command in module. | ||
ext.args2 = Second set of arguments appended to command in module (multi-tool modules). | ||
ext.args3 = Third set of arguments appended to command in module (multi-tool modules). | ||
ext.prefix = File name prefix for output files. | ||
ext.when = When to run the module. | ||
---------------------------------------------------------------------------------------- | ||
*/ | ||
// ALLEIC_CN configs | ||
|
||
process { | ||
|
||
withName: 'MSKILABORG_NFJABBA:NFJABBA:ALLEIC_CN:NON_INTEGER_BALANCE' { | ||
ext.when = { params.tools && params.tools.split(',').contains('alleic_cn') } | ||
publishDir = [ | ||
mode: params.publish_dir_mode, | ||
path: { "${params.outdir}/alleic_cn/non_integer_balance/${meta.id}/" }, | ||
pattern: "*{.rds*,.command.*}" | ||
] | ||
} | ||
|
||
withName: 'MSKILABORG_NFJABBA:NFJABBA:ALLEIC_CN:NON_INTEGER_BALANCE_WITH_GRIDSS' { | ||
ext.when = { params.tools && params.tools.split(',').contains('alleic_cn') } | ||
publishDir = [ | ||
mode: params.publish_dir_mode, | ||
path: { "${params.outdir}/alleic_cn/non_integer_balance_with_gridss/${meta.id}/" }, | ||
pattern: "*{.rds*,.command.*}" | ||
] | ||
} | ||
|
||
withName: 'MSKILABORG_NFJABBA:NFJABBA:ALLEIC_CN:NON_INTEGER_BALANCE_WITH_SVABA' { | ||
ext.when = { params.tools && params.tools.split(',').contains('alleic_cn') } | ||
publishDir = [ | ||
mode: params.publish_dir_mode, | ||
path: { "${params.outdir}/alleic_cn/non_integer_balance_with_svaba/${meta.id}/" }, | ||
pattern: "*{.rds*,.command.*}" | ||
] | ||
} | ||
|
||
withName: 'MSKILABORG_NFJABBA:NFJABBA:ALLEIC_CN:LP_PHASED_BALANCE' { | ||
ext.when = { params.tools && params.tools.split(',').contains('alleic_cn') } | ||
publishDir = [ | ||
mode: params.publish_dir_mode, | ||
path: { "${params.outdir}/alleic_cn/lp_phased_balance/${meta.id}/" }, | ||
pattern: "*{.rds*,.command.*}" | ||
] | ||
} | ||
|
||
withName: 'MSKILABORG_NFJABBA:NFJABBA:ALLEIC_CN:LP_PHASED_BALANCE_WITH_GRIDSS' { | ||
ext.when = { params.tools && params.tools.split(',').contains('alleic_cn') } | ||
publishDir = [ | ||
mode: params.publish_dir_mode, | ||
path: { "${params.outdir}/alleic_cn/lp_phased_balance_with_gridss/${meta.id}/" }, | ||
pattern: "*{.rds*,.command.*}" | ||
] | ||
} | ||
|
||
withName: 'MSKILABORG_NFJABBA:NFJABBA:ALLEIC_CN:LP_PHASED_BALANCE_WITH_SVABA' { | ||
ext.when = { params.tools && params.tools.split(',').contains('alleic_cn') } | ||
publishDir = [ | ||
mode: params.publish_dir_mode, | ||
path: { "${params.outdir}/alleic_cn/lp_phased_balance_with_svaba/${meta.id}/" }, | ||
pattern: "*{.rds*,.command.*}" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.