view snippy.xml @ 7:93d294cd4d59 draft default tip

Added snippy core
author simon-gladman
date Fri, 10 Jun 2016 00:10:22 -0400
parents 15f5a3074012
children
line wrap: on
line source

<tool id="snippy" name="snippy" version="0.2.0">
  <requirements>
      <requirement type="package" version="3.0">snippy</requirement>
  </requirements>
  <stdio>
      <exit_code range="1:" />
  </stdio>

    <command><![CDATA[
      #if str( $reftype.ref_type_selector ) == "fasta"
        cp $reftype.ref foo.fna &&
      #end if
      #if str( $reftype.ref_type_selector ) == "genbank"
        cp $reftype.ref foo.gbk &&
      #end if
      snippy
      --outdir out
      --cpus "\${GALAXY_SLOTS:-1}"
      #if str( $reftype.ref_type_selector ) == "fasta"
        --ref foo.fna
      #end if
      #if str( $reftype.ref_type_selector ) == "genbank"
        --ref foo.gbk
      #end if
      $cleanup
      #if str( $advanced.is_advanced ) == "advanced"
        --mapqual $advanced.mapqual
        --mincov $advanced.mincov
        --minfrac $advanced.minfrac
        #if $advanced.rgid
          --rgid $advanced.rgid
        #end if
        #if $advanced.bwaopt
          --bwaopt $advanced.bwaopt
        #end if
      #end if
      #if str( $fastq_input.fastq_input_selector ) == "paired"
        --pe1 $fastq_input.fastq_input1
        --pe2 $fastq_input.fastq_input2
      #end if
      #if str( $fastq_input.fastq_input_selector ) == "paired_collection"
        --pe1 $fastq_input.fastq_input1.forward
        --pe2 $fastq_input.fastq_input1.reverse
      #end if
      #if str( $fastq_input.fastq_input_selector ) == "single"
        --se $fastq_input.fastq_input1
      #end if
      #if str( $fastq_input.fastq_input_selector ) == "paired_iv"
        --peil $fastq_input.fastq_input1
      #end if

      &&

      gunzip out/snps.depth.gz

      &&

      tar -czf out.tgz out


    ]]></command>
    <inputs>
      <conditional name="reftype">
        <param name="ref_type_selector" type="select" label="Reference type" help="File type of the reference file. (Fasta or Genbank)">
          <option value="genbank">Genbank</option>
          <option value="fasta">Fasta</option>
        </param>
        <when value="fasta">
          <param name="ref" type="data" format="fasta" label="Reference Fasta" help="Fasta file to use as the reference" />
        </when>
        <when value="genbank">
          <param name="ref" type="data" format="genbank" label="Reference Genbank" help="Genbank file to use as the reference" />
        </when>
      </conditional>
      <conditional name="fastq_input">
        <param name="fastq_input_selector" type="select" label="Single or Paired-end reads" help="Select between paired and single end data">
          <option value="paired">Paired</option>
          <option value="single">Single</option>
          <option value="paired_collection">Paired Collection</option>
          <option value="paired_iv">Paired Interleaved</option>
        </param>
        <when value="paired">
          <param name="fastq_input1" type="data" format="fastqsanger,fasta" label="Select first set of reads" help="Specify dataset with forward reads"/>
          <param name="fastq_input2" type="data" format="fastqsanger,fasta" label="Select second set of reads" help="Specify dataset with reverse reads"/>
        </when>
        <when value="single">
          <param name="fastq_input1" type="data" format="fastqsanger,fasta" label="Select fastq dataset" help="Specify dataset with single reads"/>
        </when>
        <when value="paired_collection">
          <param name="fastq_input1" format="fastqsanger,fasta" type="data_collection" collection_type="paired" label="Select a paired collection" help="See help section for an explanation of dataset collections"/>
        </when>
        <when value="paired_iv">
          <param name="fastq_input1" type="data" format="fastqsanger" label="Select fastq dataset" help="Specify dataset with interleaved reads"/>
        </when>
      </conditional>
      <param name="cleanup" type="boolean" checked="true" truevalue="--cleanup" falsevalue="" label="Cleanup the non-snp output files" help="Remove all non-SNP files: BAMs, indices etc" />
      <conditional name="advanced">
        <param name="is_advanced" type="select" label="Advanced parameters" help="unhide advanced parameter settings">
          <option value="advanced">Show advanced settings</option>
          <option value="simple" selected="true">Hide advanced settings</option>
        </param>
        <when value="advanced">
          <param name="mapqual" type="float" value="60" label="Minimum mapping quality" help="Minimum mapping quality to allow" />
          <param name="mincov" type="float" value="10" label="Minimum coverage" help="Minimum coverage to call a snp" />
          <param name="minfrac" type="float" value="0.9" label="Minumum proportion for variant evidence" help="Minumum proportion for variant evidence" />
          <param name="rgid" type="text" value="" label="Bam header @RG ID" help="Use this @RG ID: in the BAM header" />
          <param name="bwaopt" type="text" value="" label="Extra BWA MEM options" help="Extra BWA MEM options, eg. -x pacbio" />
        </when>
        <when value="simple">

        </when>
      </conditional>
    </inputs>
    <outputs>
      <data format="vcf" name="snpvcf" label="${tool.name} on ${on_string} snps vcf file" from_work_dir="out/snps.vcf"/>
      <data format="gff3" name="snpgff" label="${tool.name} on ${on_string} snps gff file" from_work_dir="out/snps.gff"/>
      <data format="tabular" name="snptab" label="${tool.name} on ${on_string} snps table" from_work_dir="out/snps.tab"/>
      <data format="tabular" name="snpsum" label="${tool.name} on ${on_string} snps summary" from_work_dir="out/snps.txt"/>
      <data format="txt" name="snplog" label="${tool.name} on ${on_string} log file" from_work_dir="out/snps.log"/>
      <data format="fasta" name="snpalign" label="${tool.name} on ${on_string} aligned fasta" from_work_dir="out/snps.aligned.fa"/>
      <data format="fasta" name="snpconsensus" label="${tool.name} on ${on_string} consensus fasta" from_work_dir="out/snps.consensus.fa"/>
      <data format="tabular" name="snpsdepth" label="${tool.name} on ${on_string} mapping depth" from_work_dir="out/snps.depth"/>
      <data format="bam" name="snpsbam" label="${tool.name} on ${on_string} mapped reads (bam)" from_work_dir="out/snps.bam">
        <filter>cleanup is False</filter>
      </data>
      <data format="zip" name="outdir" label="${tool.name} on ${on_string} out dir" from_work_dir="out.tgz" />
    </outputs>

    <tests>
      <test>
        <param name="ref_type_selector" value="fasta" />
        <param name="ref" value="Ecoli.fna" ftype="fasta" />
        <param name="fastq_input_selector" value="paired" />
        <param name="fastq_input1" ftype="fastq" value="reads_1.fq" />
        <param name="fastq_input2" ftype="fastq" value="reads_2.fq" />
        <output name="snpsum" ftype="tabular" file="test/snps.txt" lines-diff="5" />
      </test>
    </tests>


    <help><![CDATA[
Synopsis:
  snippy 3.0 - fast bacterial variant calling from NGS reads

Author:
  Torsten Seemann <torsten.seemann@gmail.com>

Usage:
  snippy [options] --outdir <dir> --ref <ref> --pe1 <R1.fq.gz> --pe2 <R2.fq.gz>

  snippy [options] --outdir <dir> --ref <ref> --se <454.fastq>

  snippy [options] --outdir <dir> --ref <ref> --peil <velvet.fa.gz>

Options:
  --help            This help

  --version         Print version and exit

  --citation        Print citation for referencing snippy

  --quiet           No screen output (default OFF)

  --cpus [N]        Maximum number of CPU cores to use (default '8')

  --reference [X]   Reference genome. Supports FASTA, GenBank, EMBL (not GFF) (default '')

  --outdir [X]      Output folder (default '')

  --prefix [X]      Prefix for output files (default 'snps')

  --force           Force overwrite of existing output folder (default OFF)

  --pe1|R1|left [X] Reads, paired-end R1 (left) (default '')

  --pe2|R2|right [X] Reads, paired-end R2 (right) (default '')

  --se|single [X]   Single-end reads (default '')

  --peil [X]        Reads, paired-end R1/R2 interleaved (default '')

  --mapqual [n.n]   Minimum mapping quality to allow (default '60')

  --mincov [N]      Minimum coverage of variant site (default '10')

  --minfrac [n.n]   Minumum proportion for variant evidence (default '0.9')

  --report          Produce long report with visual alignment (slow) (default OFF)

  --cleanup         Remove all non-SNP files: BAMs, indices etc (default OFF)

  --rgid [X]        Use this @RG ID: in the BAM header (default '')

  --bwaopt [X]      Extra BWA MEM options, eg. -x pacbio (default '')

    ]]></help>
  <citations>
    <citation type="bibtex">@UNPUBLISHED{Seemann2013,
      author = "Seemann T",
      title = "snippy: fast bacterial variant calling from NGS reads",
      year = "2015",
      note = "https://github.com/tseemann/snippy"}</citation>
  </citations>


</tool>