Skip to content

Commit

Permalink
Merge workflows with dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tanubrata committed Oct 19, 2023
2 parents b31b53b + ec26a90 commit 2bb6695
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 80 deletions.
30 changes: 26 additions & 4 deletions modules/local/dryclean/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ process DRYCLEAN {
'mskilab/dryclean:latest' }"

input:
tuple val(meta), path(pon) path(input)
tuple val(meta), path(input)
path pon
val centered
val cbs
val cnsignif
val cores
val wholeGenome
val blacklist
path blacklist_path
Expand All @@ -25,14 +25,15 @@ process DRYCLEAN {
output:
tuple val(meta), path("*.drycleaned.cov.rds") , emit: decomposed_cov, optional: true
tuple val(meta), path("*.dryclean.object.rds") , emit: dryclean_object, optional: true
//path "versions.yml" , emit: versions
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '0.0.2'
"""
#!/bin/bash
set -o allexport
Expand Down Expand Up @@ -65,7 +66,23 @@ process DRYCLEAN {
export drycln=$drycleanPath/extdata/drcln
echo $drycln
set +x
CMD="Rscript $drycln \$@"
CMD="Rscript $drycln \\
--input ${input} \\
--pon ${pon} \\
--centered ${centered} \\
--cbs ${cbs} \\
--cnsignif ${cnsignif} \\
--cores ${task.cpus} \\
--wholeGenome ${wholeGenome} \\
--blacklist ${blacklist} \\
--blacklist_path ${blacklist_path} \\
--germline.filter ${germline_filter} \\
--germline.file ${germline_file} \\
--human ${human} \\
--field ${field} \\
--build ${build} \\
"
if [ ! -s ./drycleaned.cov.rds ]; then
if ! { echo "Running:" && echo "${CMD}" && eval ${CMD}; }; then
Expand All @@ -75,6 +92,11 @@ process DRYCLEAN {
echo "If you wish to rerun Dryclean - please purge directory first"
fi
exit 0
cat <<-END_VERSIONS > versions.yml
"${task.process}":
dryclean: ${VERSION}
END_VERSIONS
"""

stub:
Expand Down
2 changes: 1 addition & 1 deletion modules/local/gridss/gridss/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ process GRIDSS_GRIDSS {
path(fasta_fai)
path(bwa_index) // required: bwa index folder
path(blacklist_gridss) // optional: gridss blacklist bed file based on genome


output:
tuple val(meta), path("*.vcf.gz") , emit: vcf, optional:true
Expand Down
34 changes: 16 additions & 18 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,24 @@ params {
//indel_mask = null // Must provide blacklist bed file for indels based on genome to run Svaba

// fragCounter options
midpoint_frag = "TRUE" // If TRUE only count midpoint if FALSE then count bin footprint of every fragment interval: Default=TRUE
midpoint_frag = "TRUE" // If TRUE only count midpoint if FALSE then count bin footprint of every fragment interval: Default=TRUE
windowsize_frag = 200 // Window / bin size : Default=200
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

// Dryclean options
centered = "TRUE"
cbs = "FALSE"
cnsignif = 0.00001
//cores = 1 //Should use ${task.cpus} based on tag of the module, mention in module!
wholeGenome = "TRUE"
blacklist = "FALSE"
blacklist_path = null
germline_filter = "FALSE"
germline_file = null
human = "TRUE"
field = "reads.corrected"
build = "hg19"
centered_dryclean = "TRUE"
cbs_dryclean = "FALSE"
cnsignif_dryclean = 0.00001
wholeGenome_dryclean = "TRUE"
blacklist_dryclean = "FALSE"
blacklist_path_dryclean = "NA"
germline_filter_dryclean = "FALSE"
germline_file_dryclean = "NA"
human_dryclean = "TRUE"
field_dryclean = "reads.corrected"
build_dryclean = "hg19"

// JaBbA options
field = "ratio"
Expand All @@ -96,12 +95,12 @@ params {
pair = "tumor"
indel = "exclude"
cnsignif = 0.00001
lp = true
ism = true
lp = "TRUE"
ism = "TRUE"
treemem = 16
fix_thres = -1
gurobi = false
nonintegral = false
gurobi = "FALSE"
nonintegral = "FALSE"

// Variant Calling
only_paired_variant_calling = false // if true, skips germline variant calling for normal-paired samples
Expand Down Expand Up @@ -155,7 +154,6 @@ params {
multiqc_methods_description = null



// Boilerplate options
outdir = null
publish_dir_mode = 'copy'
Expand Down
9 changes: 5 additions & 4 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"sv_calling",
"coverage",
"variant_calling",
"annotate"
"annotate",
"coverage"
]
},
"outdir": {
Expand Down Expand Up @@ -300,7 +301,7 @@
"fa_icon": "fas fa-forward",
"description": "Option to mention whether the dataset is paired or single ended for fragCounter",
"hidden": true,
"help_text": "If TRUE, will consider the dataset is paired ened, else single ended"
"help_text": "If TRUE, will consider the dataset is paired ended, else single ended"
},
"exome_frag": {
"type": "string",
Expand All @@ -313,7 +314,7 @@
"type": "number",
"default": 200,
"fa_icon": "fas fa-wrench",
"description": "Default bin size for gragCounter",
"description": "Default bin size for fragCounter",
"hidden": true,
"help_text": "By default the bin size is 200, adjust as necessary."
},
Expand Down Expand Up @@ -417,7 +418,7 @@
"hidden": true,
"help_text": "Specify if the human sample is hg19/hg38"
}
}
}
},
"variant_calling": {
"title": "Variant Calling",
Expand Down
30 changes: 0 additions & 30 deletions subworkflows/local/bam_Dryclean/main.nf

This file was deleted.

4 changes: 2 additions & 2 deletions subworkflows/local/bam_svcalling_gridss/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include { GRIDSS_SOMATIC } from '../../../modules/local/gridss/somaticFilter/ma

workflow BAM_SVCALLING_GRIDSS {
take:
cram // channel: [mandatory] [ meta, normalcram, normalcrai, tumorcram, tumorcrai ]
cram // channel: [mandatory] [ meta, normalcram, normalcrai, tumorcram, tumorcrai ]
fasta // channel: [mandatory] reference fasta
fasta_fai // channel: [mandatory] reference fasta index
bwa_index // channel: [mandatory] bwa index path
Expand Down Expand Up @@ -65,7 +65,7 @@ workflow BAM_SVCALLING_GRIDSS_SOMATIC {
somatic_all
somatic_high_confidence
all_vcf

versions

}
Expand Down
44 changes: 44 additions & 0 deletions subworkflows/local/dryclean/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// DRYCLEAN
//

include { DRYCLEAN } from '../../../modules/local/dryclean/main.nf'

workflow COV_DRYCLEAN {

take:
input_dryclean // channel: [mandatory] [ meta, input ]
pon_dryclean
centered_dryclean
cbs_dryclean
cnsignif_dryclean
wholeGenome_dryclean
blacklist_dryclean
blacklist_path_dryclean
germline_filter_dryclean
germline_file_dryclean
human_dryclean
field_dryclean
build_dryclean

main:
versions = Channel.empty()
dryclean_cov = Channel.empty()
dryclean_obj = Channel.empty()

DRYCLEAN(input_dryclean, pon_dryclean, centered_dryclean, cbs_dryclean,
cnsignif_dryclean, wholeGenome_dryclean, blacklist_dryclean,
blacklist_path_dryclean, germline_filter_dryclean, germline_file_dryclean,
human_dryclean, field_dryclean, build_dryclean)

dryclean_cov = DRYCLEAN.out.decomposed_cov
dryclean_obj = DRYCLEAN.out.dryclean_object

versions = DRYCLEAN.out.versions

emit:
dryclean_cov // only need to emit the coverage for JaBbA

versions
}

Loading

0 comments on commit 2bb6695

Please sign in to comment.