Hello,
We developped vvv2_display tool for virus variant calling and the Galaxy wrapper.
We add a new option to get a vcf additional output file. Therefore this output file must be created only if an option with the filename is provided (`-x snp_summary.vcf` for instance).
In the wrapper, I created an optional input with a if (`option_snp_vcf_summary|boolean`), a conditional vcf output (with `filter` to make it active or not):
- text in input (`option_snp_vcf_summary|snp_vcf_summary_f`)
- vcf in ouput (`option_snp_vcf_summary|snp_vcf_summary_f`)
, but I obtain only an empty vcf output file while when the program is ran in command line, I get the expected vcf output file.
Here is my wrapper code:
<tool id="vvv2_display" name="vvv2_display: Display SNP proportions and CDS of an assembly in png image" version="0.2.5.0" python_template_version="3.9">
<requirements>
<requirement type="package" version="0.2.5.0">vvv2_display</requirement>
</requirements>
<command detect_errors="exit_code"><![CDATA[
vvv2_display.py -f '$vadr_fail_annotation' -p '$vadr_pass_annotation' -s '$vadr_seqstat' -n '$vardict_vcf' -r '$snp_img' -w '$var_significant_thres' -o '$cov_depth' -e '$cov_depth_corr' -t '$snp_loc' -u '$snp_loc_summary' -j '$json_annot' -k '$bed_annot' -l '$correct_vcf' -m '$contig_limits' -N '$contig_names' $cov_depth_scale
## vcf significant output file option
#if str($option_snp_vcf_summary.boolean) == '2':
-x '${option_snp_vcf_summary.snp_vcf_summary_f}'
#end if
]]></command>
<inputs>
<param type="data" name="vadr_fail_annotation" format="tabular" />
<param type="data" name="vadr_pass_annotation" format="tabular" />
<param type="data" name="vadr_seqstat" format="txt" />
<param type="data" name="vardict_vcf" format="vcf" />
<param type="integer" name="var_significant_thres" value="7" min="0" max="100" label="min int threshold to keep significant variant (%age)" format="int" />
<param type="select" name="cov_depth_scale" label="tells if cov depth scale (ordinate) is displayed with log10 (default) or linear scale" help="tells if cov depth scale (ordinate) is displayed with log10 (default) or linear scale">
<option value="">log10 scale</option>
<option value="-y">linear scale</option>
</param>
<param type="data" name="cov_depth" format="txt" />
<conditional name="option_snp_vcf_summary">
<param type="select" name="boolean" label="tells if vcf summary output file is created" help="tells if vcf summary output file is created">
<option value="1">no summary vcf output</option>
<option value="2">additional vcf summary output</option>
</param>
<when value="1"/>
<when value="2">
<param type="text" name="snp_vcf_summary_f" format="vcf" argument="-x" help="provide the vcf summary output file name"/>
</when>
</conditional>
</inputs>
<outputs>
<data name="snp_img" format="png" label="png image showing variants"/>
<data name="snp_loc_summary" format="tabular" label="tsv file of significant variants only"/>
<!-- present only if ask for summary vcf output-->
<data name="option_snp_vcf_summary|snp_vcf_summary_f" format="vcf" label="vcf file of significant variants only" from_work_dir="option_snp_vcf_summary|snp_vcf_summary_f">
<filter>option_snp_vcf_summary['boolean'] == "2"</filter>
</data>
<!-- intermediate output files added for Galaxy compatibility -->
<data name="snp_loc" format="txt" hidden="true" label="tsv file of all variants"/>
<data name="json_annot" format="json" hidden="true" label="json file of annotations"/>
<data name="bed_annot" format="bed" hidden="true" label="bed file of of annotations"/>
<data name="correct_vcf" format="vcf" hidden="true" label="vcf file of variants corrected for positions when multi contigs"/>
<data name="contig_limits" format="txt" hidden="true" label="txt file with contig limits"/>
<data name="contig_names" format="txt" hidden="true" label="txt file with contig names"/>
<data name="cov_depth_corr" format="txt" hidden="true" label="txt file with pos and cov depth, pos corrected when multi contigs"/>
<!-- end intermediate output files added for Galaxy compatibility -->
</outputs>
<tests>
<test>
<param name="vadr_fail_annotation" value="test_vvv2_display/res_vadr_fail.tbl" ftype="tabular"/>
<param name="vadr_pass_annotation" value="test_vvv2_display/res_vadr_pass.tbl" ftype="tabular"/>
<param name="vadr_seqstat" value="test_vvv2_display/res_vadr.seqstat" ftype="txt"/>
<param name="vardict_vcf" value="test_vvv2_display/res_vardict.vcf" ftype="vcf"/>
<param name="var_significant_thres" value="7"/>
<param name="cov_depth_scale" value="-y" />
<param name="cov_depth" value="test_vvv2_display/res_covdepth.txt" />
<param name="option_snp_vcf_summary|boolean" value="2"/>
<output name="snp_img" file="test_vvv2_display/res_snp.png" ftype="png"/>
<output name="snp_loc_summary" file="test_vvv2_display/res_snp_summary.tsv" ftype="tabular"/>
<!-- <output name="option_snp_vcf_summary|snp_vcf_summary_f" file="test_vvv2_display/res_snp_summary.vcf" ftype="vcf"/> -->
<output name="option_snp_vcf_summary|snp_vcf_summary_f" file="test_vvv2_display/res_snp_summary.vcf" ftype="vcf"/>
<!-- intermediate output files -->
<output name="snp_loc" file="test_vvv2_display/res_snp.txt" ftype="txt"/>
<output name="json_annot" file="test_vvv2_display/res_vadr.json" ftype="json"/>
<output name="bed_annot" file="test_vvv2_display/res_vadr.4vardict.bed" ftype="bed"/>
<output name="correct_vcf" file="test_vvv2_display/res_correct.vcf" ftype="vcf"/>
<output name="contig_limits" file="test_vvv2_display/contig_limits.txt" ftype="txt"/>
<output name="contig_names" file="test_vvv2_display/contig_names.txt" ftype="txt"/>
<output name="cov_depth_corr" file="test_vvv2_display/res_covdepth_corrected.txt" ftype="txt"/>
<!-- end intermediate output files -->
</test>
</tests>
<help><![CDATA[
[vvv2_display.py]
Aim: Display of SNP proportions, annotations, for an assembly
in:
- vardict variant calling output
- vadr assembly annotations
out:
- png file (image of SNP proportion alongside the assembly with CDS positions)
- txt file with variant calling summary, location in CDS and surround DNA sequence.
usage: vvv2_display.py [-h] [-p FILE] [-f FILE] [-s FILE] [-n FILE] [-r FILE]
optional arguments:
-h, --help show this help message and exit
-p FILE, --pass_tbl_f FILE
in: tabular file of vadr annotations, with pass status
-f FILE, --fail_tbl_f FILE
in: tabular file of vadr annotations, with fail status
-s FILE, --seq_stat_f FILE
in: seq stat file of vadr annotator
-n FILE, --vcf_f FILE
in: vcf variant file provided by vardict
-r FILE, --png_var_f FILE
out: png file with variant proportions and annotations
-o FILE, --cov_depth_f FILE
[optional] in: text file of coverage depths (given by samtools depth)
]]></help>
<citations>
<citation type="bibtex">
@misc{githubvvv2_display,
author = {Touzain, Fabrice},
year = {2022},
title = {vvv2_display},
publisher = {GitHub},
journal = {GitHub repository},
url = {https://github.com/ANSES-Ploufragan/vvv2_display},
}</citation>
<citation type="doi">10.1016/j.virusres.2020.198201</citation>
</citations>
</tool>
May you explain me how to get the file name in input `option_snp_vcf_summary|snp_vcf_summary_f` and create the output vcf file with this name (or a Galaxy name, it does not matter for me), please?
Many thanks for your help.
Fabrice