Skip to content

Commit

Permalink
fix snippy multi resume bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed May 19, 2020
1 parent adcf393 commit 819f234
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions pipeline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ if(!params.skip_snippy_pairwise && (!params.skip_assembly_download || (!params.s
file "output${params.snippy_ctg_depth}X/*/*_snippy.subs.vcf" into ch_snippy_subs_vcf_detect_density
file "output${params.snippy_ctg_depth}X/*/*_snippy.bam" into ch_snippy_bam_pairwise_qualimap
file "output${params.snippy_ctg_depth}X/*/*_snippy.csv" into ch_snippy_csv_snpEff_multiqc
file "*output*/${assembly_fna.baseName}" into ch_snippy_outdir_assembly

// Shell script to execute
script:
Expand All @@ -709,6 +710,9 @@ if(!params.skip_snippy_pairwise && (!params.skip_assembly_download || (!params.s
--basequal ${params.snippy_base_qual} \
--report;
# Save Output Dir for snippy_multi channel
snippyDir=`pwd`"/output${params.snippy_ctg_depth}X/${assembly_fna.baseName}/"
snippy_snps_in=output${params.snippy_ctg_depth}X/${assembly_fna.baseName}/${assembly_fna.baseName}_snippy.txt
snippy_snps_txt=output${params.snippy_ctg_depth}X/${assembly_fna.baseName}/${assembly_fna.baseName}_snippy.summary.txt
Expand All @@ -735,6 +739,11 @@ if(!params.skip_snippy_pairwise && (!params.skip_assembly_download || (!params.s
"""
}

// Collect the snippy output dir for multi allDir
ch_snippy_outdir_assembly
.collect()
.set { ch_snippy_outdir_assembly_collect_multi }

}

// ------------------------Multi Sample Variant Summary-----------------------//
Expand Down Expand Up @@ -920,6 +929,7 @@ if(!params.skip_snippy_multi && !params.skip_snippy_merge_mask_bed && !params.sk
input:
file reference_genome_gb from ch_reference_gb_snippy_multi
file bed_mask from ch_bed_mask_snippy_multi
val snippy_outdir_path from ch_snippy_outdir_assembly_collect_multi

output:
file "snippy-core.aln" into ch_snippy_core_aln_filter
Expand All @@ -930,10 +940,11 @@ if(!params.skip_snippy_multi && !params.skip_snippy_merge_mask_bed && !params.sk
script:
"""
# Store a list of all the Snippy output directories in a file
ls -d1 ${outdir}/snippy_pairwise/output${params.snippy_ctg_depth}X/* > allDir;
# Save the contents of that file as a variable
allDir=`cat allDir`;
echo \$allDir;
allDir=`for path in ${snippy_outdir_path};
do
echo \$path | sed 's/\\[\\|,\\|\\]//g' ;
done | tr '\n' ' ' `;
# Perform multiple genome alignment (with custom filtering)
snippy-core \
--ref ${reference_genome_gb} \
Expand Down

0 comments on commit 819f234

Please sign in to comment.