Skip to content

Commit

Permalink
Fixes minor bugs related to JaBbA
Browse files Browse the repository at this point in the history
  • Loading branch information
tanubrata committed Nov 7, 2023
1 parent c9fe005 commit 3bdb964
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 75 deletions.
1 change: 1 addition & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ params.build_dryclean = WorkflowMain.getGenomeAttribute(params, 'build_dr
params.hapmap_sites = WorkflowMain.getGenomeAttribute(params, 'hapmap_sites')
params.pon_dryclean = WorkflowMain.getGenomeAttribute(params, 'pon_dryclean')
params.blacklist_coverage_jabba = WorkflowMain.getGenomeAttribute(params, 'blacklist_coverage_jabba')
//params.blacklist_junctions_jabba = WorkflowMain.getGenomeAttribute(params, 'blacklist_junctions_jabba')

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
88 changes: 20 additions & 68 deletions modules/local/jabba/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ process JABBA {
tuple val(meta), path(cbs_seg_rds, stageAs: "cbs_seg.rds")
tuple val(meta), path(cbs_nseg_rds, stageAs: "cbs_nseg.rds")
tuple val(meta), path(j_supp)
path(blacklist_junctions)
val(blacklist_junctions)
val(geno)
val(indel)
val(tfield)
Expand Down Expand Up @@ -68,29 +68,7 @@ process JABBA {
set -o allexport
# Check if the environment has the module program installed
if command -v module &> /dev/null
then
# Check if the required modules are available
if module avail R/4.0.2 &> /dev/null && module avail gcc/9.2.0 &> /dev/null
then
## load correct R and gcc versions
module unload R
module load R/4.0.2
module unload gcc
module load gcc/9.2.0
fi
fi
set -x
R_LIB_PATH="/gpfs/commons/groups/imielinski_lab/lib/R-4.0.2"
if [ -d "\$R_LIB_PATH" ]; then
export R_LIBS=\$R_LIB_PATH
fi
export R_DATATABLE_NUM_THREADS=1
#unset R_HOME
#R_PROFILE_USER="/dev/null"
## find R installation
echo "USING LIBRARIES: \$(Rscript -e 'print(.libPaths())')"
Expand All @@ -100,46 +78,26 @@ process JABBA {
echo \$jba
set +x
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 \\
--name $name \\
--cores $task.cpus \\
--mem $task.memory \\
--fix.thres $fix_thres \\
--lp $lp \\
--ism $ism \\
--filter_loose $filter_loose \\
--gurobi $gurobi \\
--nonintegral $nonintegral \\
--verbose $verbose \\
--help $help \\
export cmd="Rscript \$jba ${junction} ${cov_rds} \\
--j.supp ${j_supp} \\
--indel ${indel} \\
--tfield ${tfield} \\
--field ${field} \\
--seg ${cbs_seg_rds} \\
--blacklist.coverage ${blacklist_coverage} \\
--nseg ${cbs_nseg_rds} \\
--hets ${het_pileups_wgs} \\
--ploidy ${ploidy} \\
--purity ${purity} \\
--ppmethod ${pp_method} \\
--cores ${task.cpus} \\
"
cat <<-END_VERSIONS > versions.yml
"${task.process}":
JaBbA: ${VERSION}
END_VERSIONS
{ echo "Running:" && echo "\$(echo \$cmd)" && echo && eval \$cmd; }
cmdsig=\$?
if [ "\$cmdsig" = 0 ]; then
Expand All @@ -148,13 +106,7 @@ process JABBA {
echo "Broke!"
exit \$cmdsig
fi
exit 0
cat <<-END_VERSIONS > versions.yml
"${task.process}":
JaBbA: ${VERSION}
END_VERSIONS
"""

stub:
Expand Down
6 changes: 3 additions & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ params {

// fragCounter options
midpoint_frag = "TRUE" // If TRUE only count midpoint if FALSE then count bin footprint of every fragment interval: Default=TRUE
windowsize_frag = 1000 // Window / bin size : Default=200 (but dryclean uses 1000 binsize)
windowsize_frag = 200 // Window / bin size : Default=200 (but dryclean uses 1000 binsize)
minmapq_frag = 1 // Minimal map quality : Default = 1
paired_frag = "TRUE" // Is the dataset paired : Default = TRUE
exome_frag = "FALSE" // Use exons as bins instead of fixed window : Default = FALSE
Expand Down Expand Up @@ -92,7 +92,7 @@ params {
name_cbs = "tumor"

// JaBbA options
blacklist_junctions_jabba = "/dev/null"
blacklist_junctions_jabba = "NULL"
geno_jabba = "FALSE"
indel_jabba = "exclude"
tfield_jabba = "tier"
Expand All @@ -112,7 +112,7 @@ params {
slack_jabba = 100
linear_jabba = "TRUE"
tilim_jabba = 7200
epgap_jabba = 1e-8
epgap_jabba = 0.00000001
fix_thres_jabba = -1
lp_jabba = "TRUE"
ism_jabba = "TRUE"
Expand Down
2 changes: 0 additions & 2 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@
"properties": {
"blacklist_junctions_jabba": {
"type": "string",
"default": "/dev/null",
"description": "rearrangement junctions to be excluded from consideration",
"fa_icon": "fas fa-file"
},
Expand Down Expand Up @@ -661,7 +660,6 @@
},
"epgap_jabba": {
"type": "number",
"default": 1e-8,
"description": "threshold for calling convergence",
"fa_icon": "fas fa-wrench"
},
Expand Down
8 changes: 6 additions & 2 deletions workflows/heisenbio.nf
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ blacklist_path_dryclean = params.blacklist_path_dryclean ? Channel.fro
germline_file_dryclean = params.germline_file_dryclean ? Channel.fromPath(params.germline_file_dryclean).collect() : Channel.empty() // This is the path to the germline mask for dryclean (optional).

// JaBbA
blacklist_junctions_jabba = params.blacklist_junctions_jabba ? Channel.fromPath(params.blacklist_junctions_jabba).collect() : Channel.empty()
//blacklist_junctions_jabba = params.blacklist_junctions_jabba ? Channel.fromPath(params.blacklist_junctions_jabba).collect() : Channel.empty()
blacklist_coverage_jabba = params.blacklist_coverage_jabba ? Channel.fromPath(params.blacklist_coverage_jabba).collect() : Channel.empty()

// Initialize value channels based on params, defined in the params.genomes[params.genome] scope
Expand Down Expand Up @@ -314,6 +314,7 @@ field_cbs = params.field_cbs ?: Channel.e
name_cbs = params.name_cbs ?: Channel.empty()

// JaBbA
blacklist_junctions_jabba = params.blacklist_junctions_jabba ?: Channel.empty()
geno_jabba = params.geno_jabba ?: Channel.empty()
indel_jabba = params.indel_jabba ?: Channel.empty()
tfield_jabba = params.tfield_jabba ?: Channel.empty()
Expand All @@ -327,6 +328,7 @@ allin_jabba = params.allin_jabba ?: Channel.empty()
field_jabba = params.field_jabba ?: Channel.empty()
maxna_jabba = params.maxna_jabba ?: Channel.empty()
purity_jabba = params.purity_jabba ?: Channel.empty()
//ploidy_jabba = params.ploidy_jabba ?: Channel.empty()
pp_method_jabba = params.pp_method_jabba ?: Channel.empty()
cnsignif_jabba = params.cnsignif_jabba ?: Channel.empty()
slack_jabba = params.slack_jabba ?: Channel.empty()
Expand Down Expand Up @@ -965,7 +967,9 @@ workflow HEISENBIO {

all_sv_vcfs = Channel.empty()
all_sv_vcfs = all_sv_vcfs.mix(BAM_SVCALLING_SVABA.out.all_output) //This one contains multiple files of vcf, to get individual files, call individual output

vcf_from_sv_calling = Channel.empty().mix(BAM_SVCALLING_SVABA.out.som_sv)

unfiltered_som_sv = Channel.empty()
unfiltered_som_sv = unfiltered_som_sv.mix(BAM_SVCALLING_SVABA.out.unfiltered_som_sv)
}
Expand All @@ -984,7 +988,7 @@ workflow HEISENBIO {
versions = versions.mix(BAM_SVCALLING_GRIDSS_SOMATIC.out.versions)

vcf_from_sv_calling = Channel.empty().mix(BAM_SVCALLING_GRIDSS_SOMATIC.out.all_vcf)
vcf_from_sv_calling.view()
//vcf_from_sv_calling.view()
}

// TODO: CHANNEL_SVCALLING_CREATE_CSV(vcf_from_sv_calling, params.tools, params.outdir) // Need to fix this!!!!!
Expand Down

0 comments on commit 3bdb964

Please sign in to comment.