Skip to content

Commit

Permalink
feat: Add JaBbA workflow wiring
Browse files Browse the repository at this point in the history
Some parameters were removed since they are no longer present in the
current jba executable. Others were modified. Did not add ASCAT since
the default purity/ploidy caller is actually sequenza which is imported
by default (the JaBbA docker container also has it installed).
  • Loading branch information
shihabdider committed Oct 23, 2023
1 parent 2bb6695 commit 5d1b1ba
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 45 deletions.
97 changes: 73 additions & 24 deletions modules/local/jabba/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,43 @@ process JABBA {

input:
tuple val(meta), path(cov_rds)
tuple val(meta), path(junctionFilePath)
val(field)
path(junctionUnfiltered)
tuple val(meta), path(junction)
path(j_supp)
path(blacklist_junctions)
val(geno)
val(indel)
val(tfield)
path(cbs_nseg_rds)
val(iter)
val(rescue_window)
val(rescue_all)
val(nudgebalanced)
val(edgenudge)
val(strict)
val(allin)
val(field)
path(cbs_seg_rds)
val(slack)
val(maxna)
path(blacklist_coverage)
path(cbs_nseg_rds)
path(het_pileups_wgs)
val(purity)
val(ploidy)
val(tilim)
val(epgap)
val(purity)
val(pp_method)
val(maxna)
val(flags)
path(blacklist_coverage)
path(blacklist_junctions)
val(iter)
val(pair)
val(indel)
val(cnsignif)
val(slack)
val(linear)
val(tilim)
val(epgap)
val(outdir)
val(name)
val(fix_thres)
val(lp)
val(ism)
val(treemem)
val(fix_thres)
val(filter_loose)
val(gurobi)
val(nonintegral)
val(verbose)
val(help)

output:
tuple val(meta), path("*.jabba.simple.rds") , emit: jabba_rds, optional: true
Expand All @@ -53,12 +63,7 @@ process JABBA {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

def VERSION = '1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.

// TODO nf-core: Where possible, a command MUST be provided to obtain the version number of the software e.g. 1.10
// If the software is unable to output a version number on the command-line then it can be manually specified
// e.g. https://github.com/nf-core/modules/blob/master/modules/nf-core/homer/annotatepeaks/main.nf
// Each software used MUST provide the software name and version number in the YAML version file (versions.yml)
def VERSION = '1.1'
"""
#!/bin/bash
Expand Down Expand Up @@ -95,7 +100,46 @@ process JABBA {
echo $jba
set +x
export cmd="Rscript $jba \$@"
export cmd="Rscript $jba $cov_rds $junction \\
--j.supp $j_supp \\
--blacklist.junctions $blacklist_junctions \\
--geno $geno \\
--indel $indel \\
--tfield $tfield \\
--iterate $iter \\
--rescue.window $rescue_window \\
--rescue.all $rescue_all \\
--nudgebalanced $nudgebalanced \\
--edgenudge $edgenudge \\
--strict $strict \\
--allin $allin \\
--field $field \\
--seg $cbs_seg_rds \\
--maxna $maxna \\
--blacklist.coverage $blacklist_coverage \\
--nseg $cbs_nseg_rds \\
--hets $het_pileups_wgs \\
--ploidy $ploidy \\
--purity $purity \\
--ppmethod $pp_method \\
--cnsignif $cnsignif \\
--slack $slack \\
--linear $linear \\
--tilim $tilim \\
--epgap $epgap \\
--outdir $outdir \\
--name $name \\
--cores $task.cpus \\
--mem $task.mem \\
--fix.thres $fix_thres \\
--lp $lp \\
--ism $ism \\
--filter_loose $filter_loose \\
--gurobi $gurobi \\
--nonintegral $nonintegral \\
--verbose $verbose \\
--help $help \\
"
{ echo "Running:" && echo "\$(echo $cmd)" && echo && eval $cmd; }
cmdsig=\$?
Expand All @@ -107,6 +151,11 @@ process JABBA {
fi
exit 0
cat <<-END_VERSIONS > versions.yml
"${task.process}":
JaBbA: ${VERSION}
END_VERSIONS
"""

stub:
Expand Down
42 changes: 24 additions & 18 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -75,32 +75,38 @@ params {
build_dryclean = "hg19"

// JaBbA options
field = "ratio"
junctionUnfiltered = file("/dev/null")
blacklist_junctions = "/dev/null"
geno = "FALSE"
indel = "exclude"
tfield = "tier"
cbs_nseg_rds = file("/dev/null")
cbs_seg_rds = file("/dev/null")
slack = 100
het_pileups_wgs = file("/dev/null")
purity = "NA"
iter = 2
rescue_window = 10000
rescue_all = "TRUE"
nudgebalanced = "TRUE"
edgenudge = 0.1
strict = "FALSE"
allin = "FALSE"
field = "foreground"
cbs_seg_rds = "/dev/null"
maxna = 0.9
cbs_nseg_rds = "/dev/null"
het_pileups_wgs = "/dev/null"
ploidy = "NA"
tilim = 6000
epgap = 1e-8
purity = "NA"
pp_method = "ppgrid"
maxna = 0.8
flags = ""
blacklist_coverage = file("/dev/null")
blacklist_junctions = file("/dev/null")
iter = 0
pair = "tumor"
indel = "exclude"
cnsignif = 0.00001
slack = 100
linear = "TRUE"
tilim = 7200
epgap = 1e-8
fix_thres = -1
lp = "TRUE"
ism = "TRUE"
treemem = 16
fix_thres = -1
filter_loose = "FALSE"
gurobi = "FALSE"
nonintegral = "FALSE"
verbose = "TRUE"
help = "FALSE"

// Variant Calling
only_paired_variant_calling = false // if true, skips germline variant calling for normal-paired samples
Expand Down
91 changes: 91 additions & 0 deletions subworkflows/local/jabba/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
//
// JaBbA
//

include { JABBA } from '../../../modules/local/jabba/main.nf'

workflow COV_JUNC_JABBA {

take:
cov_rds_jabba
junction_jabba
j_supp_jabba
blacklist_junctions_jabba
geno_jabba
indel_jabba
tfield_jabba
iter_jabba
rescue_window_jabba
rescue_all_jabba
nudgebalanced_jabba
edgenudge_jabba
strict_jabba
allin_jabba
field_jabba
cbs_seg_rds_jabba
maxna_jabba
blacklist_coverage_jabba
cbs_nseg_rds_jabba
het_pileups_wgs_jabba
ploidy_jabba
purity_jabba
pp_method_jabba
cnsignif_jabba
slack_jabba
linear_jabba
tilim_jabba
epgap_jabba
outdir_jabba
name_jabba
fix_thres_jabba
lp_jabba
ism_jabba
filter_loose_jabba
gurobi_jabba
nonintegral_jabba
verbose_jabba
help_jabba

main:
versions = Channel.empty()
jabba_rds = Channel.empty()
jabba_gg = Channel.empty()
jabba_vcf = Channel.empty()
jabba_raw_rds = Channel.empty()
opti = Channel.empty()
jabba_seg = Channel.empty()
karyograph = Channel.empty()

JABBA(cov_rds_jabba, junction_jabba, j_supp_jabba,
blacklist_junctions_jabba, geno_jabba, indel_jabba, tfield_jabba,
iter_jabba, rescue_window_jabba, rescue_all_jabba, nudgebalanced_jabba,
edgenudge_jabba, strict_jabba, allin_jabba, field_jabba, cbs_seg_rds_jabba,
maxna_jabba, blacklist_coverage_jabba, cbs_nseg_rds_jabba,
het_pileups_wgs_jabba, ploidy_jabba, purity_jabba, pp_method_jabba,
cnsignif_jabba, slack_jabba, linear_jabba, tilim_jabba, epgap_jabba,
outdir_jabba, name_jabba, fix_thres_jabba, lp_jabba, ism_jabba,
filter_loose_jabba, gurobi_jabba, nonintegral_jabba, verbose_jabba,
help_jabba)

jabba_rds = JABBA.out.jabba_rds
jabba_gg = JABBA.out.jabba_gg
jabba_vcf = JABBA.out.jabba_vcf
jabba_raw_rds = JABBA.out.jabba_raw_rds
opti = JABBA.out.opti
jabba_seg = JABBA.out.jabba_seg
karyograph = JABBA.out.karyograph

versions = JABBA.out.versions

emit:
jabba_rds
jabba_gg
jabba_vcf
jabba_raw_rds
opti
jabba_seg
karyograph

versions
}

Loading

0 comments on commit 5d1b1ba

Please sign in to comment.