Mercurial > repos > thanhlv > snippy
changeset 5:e10e0c41a6f3 draft
planemo upload commit 6844ab5e7c82adc0f3a28153f1769b9d6a865002-dirty
| author | thanhlv |
|---|---|
| date | Mon, 09 Sep 2019 09:41:12 -0400 |
| parents | c1f4daf167c2 |
| children | d9c204f7042c |
| files | snippy-core.xml snippy.xml |
| diffstat | 2 files changed, 32 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/snippy-core.xml Mon Sep 09 08:23:04 2019 -0400 +++ b/snippy-core.xml Mon Sep 09 09:41:12 2019 -0400 @@ -8,19 +8,39 @@ </macros> <expand macro="requirements" /> <command detect_errors="exit_code"><![CDATA[ + #if $reference_source.reference_source_selector == 'history' + ln -sf '$reference_source.ref_file' 'ref' && + #elif $reference_source.reference_source_selector == 'cached' + ln -sf '$reference_source.ref_file.fields.path' 'ref' && + #end if #for $indir in $indirs #set $sample_name = os.path.splitext(os.path.basename(str($indir.name)))[0] mkdir '$sample_name' && tar -xf '$indir' -C '$sample_name' --strip-components=1 && #end for #set snippy_dirs = " ".join(["'{0}'".format(os.path.splitext(os.path.basename(str($indir.name)))[0]) for $indir in $indirs]) snippy-core - --ref '$ref' + --ref 'ref' ${snippy_dirs} ]]></command> <inputs> <param name="indirs" type="data" multiple="true" format="zip" label="Snippy input zipped dirs" help="Select all the snippy inputs for alignment" /> - <param name="ref" type="data" format="fasta,genbank" label="Reference File (either in fasta or genbank format)" help="Fasta or Genbank file to use as the reference" /> + <conditional name="reference_source"> + <param name="reference_source_selector" type="select" label="Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options. See `Indexes` section of help below. If you would like to perform self-mapping select `history` here, then choose your input file as reference."> + <option value="cached">Use a built-in genome index</option> + <option value="history">Use a genome from history and build index</option> + </param> + <when value="cached"> + <param name="ref_file" type="select" label="Using reference genome" help="Select genome from the list"> + <options from_data_table="all_fasta"> + <validator type="no_options" message="No reference genomes are available" /> + </options> + </param> + </when> + <when value="history"> + <param name="ref_file" type="data" format="fasta,genbank" label="Use the following dataset as the reference sequence" help="You can upload a FASTA or FASTQ sequence to the history and use it as reference" /> + </when> + </conditional> <param name="outputs" type="select" multiple="true" display="checkboxes" label="Output selection"> <option value="outaln" selected="True">A core SNP alignment in the fasta format</option> <option value="outfull" selected="False">A whole genome SNP alignment (includes invariant sites)</option> @@ -48,7 +68,15 @@ <tests> <test><!-- Test #1 - test with 3 zipped directories --> <param name="indirs" value="a.tgz,b.tgz,c.tgz" /> - <param name="ref" value="reference.fasta" /> + <param name="reference_source|reference_source_selector" value="history"/> + <param name="reference_source|ref_file" value="reference.fasta" ftype="fasta"/> + <param name="outputs" value="outtxt" /> + <output name="alignment_summary" ftype="txt" file="a_b_c.core.txt" /> + </test> + <test><!-- Test #2 - test with 3 zipped directories --> + <param name="indirs" value="a.tgz,b.tgz,c.tgz" /> + <param name="reference_source|reference_source_selector" value="cached"/> + <param name="reference_source|ref_file" value="test_id"/> <param name="outputs" value="outtxt" /> <output name="alignment_summary" ftype="txt" file="a_b_c.core.txt" /> </test>
--- a/snippy.xml Mon Sep 09 08:23:04 2019 -0400 +++ b/snippy.xml Mon Sep 09 09:41:12 2019 -0400 @@ -81,7 +81,7 @@ </param> </when> <when value="history"> - <param name="ref_file" type="data" format="fasta" label="Use the following dataset as the reference sequence" help="You can upload a FASTA or FASTQ sequence to the history and use it as reference" /> + <param name="ref_file" type="data" format="fasta,genbank" label="Use the following dataset as the reference sequence" help="You can upload a FASTA or FASTQ sequence to the history and use it as reference" /> </when> </conditional> <conditional name="fastq_input"> @@ -169,7 +169,6 @@ <tests> <test> <!-- test 0 - fasta ref no snps --> - <!-- <param name="ref" value="reference.fasta" ftype="fasta" /> --> <param name="reference_source|reference_source_selector" value="history"/> <param name="reference_source|ref_file" value="reference.fasta" ftype="fasta"/> <param name="fastq_input_selector" value="paired" /> @@ -183,7 +182,6 @@ </test> <test> <!-- test 1 - fasta ref one snp --> - <!-- <param name="ref" value="reference.fasta" ftype="fasta" /> --> <param name="reference_source|reference_source_selector" value="history"/> <param name="reference_source|ref_file" value="reference.fasta" ftype="fasta"/> <param name="fastq_input_selector" value="paired" /> @@ -197,7 +195,6 @@ </test> <test> <!-- test 2 - fasta ref one snp paired_collection --> - <!-- <param name="ref" value="reference.fasta" ftype="fasta" /> --> <param name="reference_source|reference_source_selector" value="history"/> <param name="reference_source|ref_file" value="reference.fasta" ftype="fasta"/> <param name="fastq_input_selector" value="paired_collection" /> @@ -215,7 +212,6 @@ </test> <test> <!-- test 3 - fasta ref one snp single --> - <!-- <param name="ref" value="reference.fasta" ftype="fasta" /> --> <param name="reference_source|reference_source_selector" value="history"/> <param name="reference_source|ref_file" value="reference.fasta" ftype="fasta"/> <param name="fastq_input_selector" value="single" />
