Skip to content

Commit

Permalink
Merge branch 'jabba_workflow' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
shihabdider committed Oct 31, 2023
2 parents ee0fe72 + 5d1b1ba commit 6405206
Show file tree
Hide file tree
Showing 8 changed files with 273 additions and 76 deletions.
8 changes: 4 additions & 4 deletions modules/local/ascat/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ process ASCAT_SEG {
input:
tuple val(meta), path(hets) // channel: [mandatory] [ meta, hets ]
tuple val(meta), path(cbs_cov) // channel: [mandatory] [ meta, cbs_cov ]
val(field) // channel: [mandatory] "foreground" for dryclean/ "ratio"
val(field) // channel: [mandatory] "foreground" for dryclean/ "ratio"
val(hets_thresh) // channel: cutoff for hetpileups; default=0.2
val(penalty) // channel: penalty for ASCAT; default=70
val(gc) // channel: perform GC correction? Default=TRUE
Expand Down Expand Up @@ -60,9 +60,9 @@ process ASCAT_SEG {
## find R installation and dryclean exec
echo "USING LIBRARIES: \$(Rscript -e 'print(.libPaths())')"
RSCRIPT_PATH=\$(if [[ ${workflow.containerEngine} == "singularity" && !task.ext.singularity_pull_docker_container ]]; then echo "./ascat_seg.R"; else echo "\${baseDir}/bin/ascat_seg.R"; fi)
Rscript \$RSCRIPT_PATH \\
--id ${meta.id} \\
--variants ${hets} \\
Expand Down Expand Up @@ -102,4 +102,4 @@ process ASCAT_SEG {
"""

}
}
6 changes: 3 additions & 3 deletions modules/local/cbs/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ process CBS {
val name

output:
path "*.cov.rds", emit: cbs_cov_rds
path "*seg.rds", emit: cbs_seg_rds
path "*nseg.rds", emit: cbs_nseg_rds
tuple val(meta), path "*.cov.rds", emit: cbs_cov_rds
tuple val(meta), path "*seg.rds", emit: cbs_seg_rds
tuple val(meta), path "*nseg.rds", emit: cbs_nseg_rds

when:
task.ext.when == null || task.ext.when
Expand Down
2 changes: 1 addition & 1 deletion modules/local/hetpileups/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ process HETPILEUPS {

output:
path "versions.yml" , emit: versions
path "sites.txt" , emit: het_pileups_wgs
tuple val(meta), path("*sites.txt") , emit: het_pileups_wgs

when:
task.ext.when == null || task.ext.when
Expand Down
99 changes: 74 additions & 25 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)
tuple val(meta), val(ploidy)
tuple val(meta), path(het_pileups_wgs)
tuple val(meta), 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)
path(het_pileups_wgs)
val(purity)
val(ploidy)
val(tilim)
val(epgap)
val(pp_method)
val(maxna)
val(flags)
path(blacklist_coverage)
path(blacklist_junctions)
val(iter)
val(pair)
val(indel)
path(cbs_nseg_rds)
val(purity)
val(pp_method)
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
58 changes: 32 additions & 26 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -92,32 +92,38 @@ params {
name = "tumor"

// JaBbA options
//field = "ratio"
//junctionUnfiltered = file("/dev/null")
//tfield = "tier"
//cbs_nseg_rds = file("/dev/null")
//cbs_seg_rds = file("/dev/null")
//slack = 100
//het_pileups_wgs = file("/dev/null")
//purity = "NA"
//ploidy = "NA"
//tilim = 6000
//epgap = 1e-8
//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
//lp = "TRUE"
//ism = "TRUE"
//treemem = 16
//fix_thres = -1
//gurobi = "FALSE"
//nonintegral = "FALSE"
blacklist_junctions = "/dev/null"
geno = "FALSE"
indel = "exclude"
tfield = "tier"
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"
purity = "NA"
pp_method = "ppgrid"
cnsignif = 0.00001
slack = 100
linear = "TRUE"
tilim = 7200
epgap = 1e-8
fix_thres = -1
lp = "TRUE"
ism = "TRUE"
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
4 changes: 2 additions & 2 deletions subworkflows/local/cov_ascat/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ workflow COV_ASCAT {
take:
hetpileups // channel: [mandatory] [ meta, hets ]
cbs_cov // channel: [mandatory] [ meta, cbs_cov ]
field // channel: [mandatory] "foreground" for dryclean/ "ratio"
field // channel: [mandatory] "foreground" for dryclean/ "ratio"
hets_threshold // channel: cutoff for hetpileups; default=0.2
penalty // channel: penalty for ASCAT; default=70
gc_correct // channel: perform GC correction? Default=TRUE
Expand Down Expand Up @@ -40,4 +40,4 @@ workflow COV_ASCAT {
ploidy

versions
}
}
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 // [ meta, cov]
junction_jabba // [ meta, junction]
ploidy_jabba // [ meta, ploidy ]
het_pileups_wgs_jabba // [ meta, hets ]
cbs_seg_rds_jabba // [ meta, seg_cbs ]
cbs_nseg_rds_jabba // [ meta, nseg_cbs ]
j_supp_jabba // [ meta, unfiltered_som_sv ]
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
maxna_jabba
blacklist_coverage_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 6405206

Please sign in to comment.