view dbbuilder.xml @ 2:6c624803c5f9 draft

Update.
author galaxyp
date Fri, 10 May 2013 17:09:36 -0400
parents 487f80fb99ae
children a38cd98a6b41
line wrap: on
line source

<tool id="dbbuilder" version="0.2.0" name="Protein Database Downloader">
  <description>
  </description>
  <requirements>
    <requirement type="binary">wget</requirement>    
  </requirements>  
  <stdio>
    <exit_code range="1:"  level="fatal" description="Error downloading database." />
    <regex match="ERROR" level="fatal" source="stderr" description="Error downloading database." />
  </stdio>
  <!-- TODO: escape quotes. -->
    <!-- Add NCBI and maxquant contaminants. -->
    <!-- http://maxquant.org/contaminants.zip -->
    <!-- ftp://ftp.ncbi.nih.gov/refseq/H_sapiens/mRNA_Prot/human.protein.faa.gz-->
  <command>
    #if $source.from == "uniprot"
    #set $url = "http://www.uniprot.org/uniprot/?query=taxonomy%3a%22" + str($source.taxon) + "%22" + str($source.set) + str($source.reviewed) + "&amp;force=yes&amp;format=fasta" + str($source.include_isoform)
    #set $type = "direct"
    #elif $source.from == "cRAP"
    #set $url = "ftp://ftp.thegpm.org/fasta/cRAP/crap.fasta"
    #set $type = "direct"
    #elif $source.from == "url"
    #set $url = $source.url
    #set $type = "direct"
    #end if
    #if $type =="direct"
    wget -nv '$url' -O '${output_database}'
    #end if
  </command>
  <inputs>
    <conditional name="source">
      <param name="from" type="select" label="Download from">
        <option value="uniprot">UniProtKB</option>
        <option value="cRAP">cRAP (contaminants)</option>
        <option value="url">Custom URL</option>
      </param>
      <when value="uniprot">
        <param name="taxon" type="select" format="text" >
          <label>Taxonomy</label>
          <options from_file="uniprot_taxons.loc">
            <column name="name" index="0" />
            <column name="value" index="1" />
          </options>
        </param>
        <param name="reviewed" type="select">
          <option value="+">UniProtKB</option>
          <option value="+reviewed%3Ayes">UniProtKB/Swiss-Prot (reviewed only)</option>
          <option value="+reviewed%3Ano">UniProtKB/TrEMBL (unreviewed only)</option>
          <sanitizer>
            <valid>
              <add value="%"/>
            </valid>
          </sanitizer>
        </param>
        <param name="set" type="select" label="Proteome Set">
          <option value="+">Any</option>
          <option value="+keyword%3a1185" selected="true">Reference Proteome Set</option>
          <option value="+keyword%3a181">Complete Proteome Set</option>
          <sanitizer>
            <valid>
              <add value="%"/>
            </valid>
          </sanitizer>
        </param>
        <param name="include_isoform" type="boolean" truevalue="&amp;include=yes" falsevalue="" label="Include isoform data" />
      </when>
      <when value="cRAP" />
      <when value="url">
        <param name="url" value="" type="text" label="URL (http, ftp)">
          <sanitizer>
            <valid>
              <add value="%"/>
            </valid>
          </sanitizer>
        </param>
      </when>
    </conditional>
  </inputs>
  <outputs>
    <data format="fasta" name="output_database" label="Protein Database" />
  </outputs>
  <help>
**Output**

A FASTA file containing the specified protein sequences.

  </help>
</tool>