From 3bdb96499b1d1b29c22d747c51a80c3d15fd1425 Mon Sep 17 00:00:00 2001 From: Tanubrata Dey Date: Tue, 7 Nov 2023 12:27:29 -0500 Subject: [PATCH] Fixes minor bugs related to JaBbA --- main.nf | 1 + modules/local/jabba/main.nf | 88 +++++++++---------------------------- nextflow.config | 6 +-- nextflow_schema.json | 2 - workflows/heisenbio.nf | 8 +++- 5 files changed, 30 insertions(+), 75 deletions(-) diff --git a/main.nf b/main.nf index 9d27f1a..7662218 100644 --- a/main.nf +++ b/main.nf @@ -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') /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/modules/local/jabba/main.nf b/modules/local/jabba/main.nf index 259bdfb..0f4e7df 100644 --- a/modules/local/jabba/main.nf +++ b/modules/local/jabba/main.nf @@ -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) @@ -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())')" @@ -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 @@ -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: diff --git a/nextflow.config b/nextflow.config index a5f558a..528ce6c 100644 --- a/nextflow.config +++ b/nextflow.config @@ -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 @@ -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" @@ -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" diff --git a/nextflow_schema.json b/nextflow_schema.json index 4e466eb..051cb86 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -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" }, @@ -661,7 +660,6 @@ }, "epgap_jabba": { "type": "number", - "default": 1e-8, "description": "threshold for calling convergence", "fa_icon": "fas fa-wrench" }, diff --git a/workflows/heisenbio.nf b/workflows/heisenbio.nf index 80b8296..4b3cb45 100644 --- a/workflows/heisenbio.nf +++ b/workflows/heisenbio.nf @@ -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 @@ -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() @@ -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() @@ -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) } @@ -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!!!!!