Skip to content

Commit

Permalink
Merge branch 'CW-4940_output_full_name' into 'dev'
Browse files Browse the repository at this point in the history
Explicit naming and avoid nested directories [CW-4940]

Closes CW-4940

See merge request epi2melabs/workflows/wf-somatic-variation!155
  • Loading branch information
RenzoTale88 committed Sep 16, 2024
2 parents 0dfb97e + 333e3ba commit 81de957
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions modules/local/wf-somatic-snv.nf
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ process makeReport {
path(typing_vcf),
val(typing_opt)
output:
tuple val(meta), path("*report.html"), emit: html
tuple val(meta), path("${params.sample_name}.wf-somatic-snv-report.html"), emit: html
script:
// Define report name.
def report_name = "${params.sample_name}.wf-somatic-snv-report.html"
Expand Down Expand Up @@ -464,21 +464,21 @@ process clairs_create_paired_tensors {
val(variant_type),
path(candidate),
path(intervals),
path("tmp/pileup_tensor_can/")
path("pileup_tensor_can/")

script:
// If min_bq provided, use it; otherwise, if HAC model and is SNV then set min_bq to 15.
def min_bq = params.min_bq ? "--min_bq ${params.min_bq}" : model =~ "hac" && variant_type == 'snv' ? "--min_bq 15" : ""
"""
mkdir -p tmp/pileup_tensor_can
mkdir -p pileup_tensor_can
pypy3 \$CLAIRS_PATH/clairs.py create_pair_tensor_pileup \\
--normal_bam_fn ${normal_bam.getName()} \\
--tumor_bam_fn ${tumor_bam.getName()} \\
--ref_fn ${ref} \\
--samtools samtools \\
--ctg_name ${region.contig} \\
--candidates_bed_regions ${intervals} \\
--tensor_can_fn tmp/pileup_tensor_can/${intervals.getName()} \\
--tensor_can_fn pileup_tensor_can/${intervals.getName()} \\
--platform ont \\
${min_bq}
"""
Expand Down Expand Up @@ -515,7 +515,10 @@ process clairs_predict_pileup {
path(intervals),
path(tensor)
output:
tuple val(meta), val(variant_type), path("vcf_output/*p_${intervals.getName()}.vcf"), optional: true
tuple val(meta),
val(variant_type),
path("vcf_output/${variant_type == 'indel' ? 'indel_p' : 'p'}_${intervals.getName()}.vcf"),
optional: true

script:
// If requested, hybrid/genotyping mode, or vcf_fn are provided, then call also reference sites and germline sites.
Expand Down Expand Up @@ -667,7 +670,11 @@ process clairs_predict_full {
path(tensor),
val(model)
output:
tuple val(meta), val(variant_type), path("vcf_output/*fa_${intervals.getName()}.vcf"), emit: full_vcfs, optional: true
tuple val(meta),
val(variant_type),
path("vcf_output/${variant_type == 'indel' ? 'indel_fa' : 'fa'}_${intervals.getName()}.vcf"),
emit: full_vcfs,
optional: true

script:
// If requested, hybrid/genotyping mode, or vcf_fn are provided, then call also reference sites and germline sites.
Expand Down Expand Up @@ -757,8 +764,8 @@ process clairs_full_hap_filter {
output:
tuple val(meta),
val(variant_type),
path("vcf_output/*pileup_filter.vcf"),
path("vcf_output/*full_alignment_filter.vcf"),
path("vcf_output/${ctg}_${variant_type == 'indel' ? 'indel_pileup_filter.vcf' : 'pileup_filter.vcf'}"),
path("vcf_output/${ctg}_${variant_type == 'indel' ? 'indel_full_alignment_filter.vcf' : 'full_alignment_filter.vcf'}"),
emit: filtered_vcfs

script:
Expand Down

0 comments on commit 81de957

Please sign in to comment.