view literal.xml @ 8:534516105ca9

visualize.py: The second tool, for a more aesthetic, abstract visualization.
author Nick Stoler <nstoler@psu.edu>
date Sun, 02 Mar 2014 23:47:41 -0500
parents 2d99feb4a8e3
children 54223991334b
line wrap: on
line source

<tool id="visualdna" name="DNA visualizer" version="0.1">
  <description>Visualize DNA with colored pixels.</description>
  <command interpreter="python">literal.py $input -o $output -c -s ${width}x${height}
  #if $colors.custom:
    -b $colors.background -G $colors.G -C $colors.C -A $colors.A -T $colors.T 
  #end if
  </command>
  <inputs>
    <param name="input" type="data" format="fasta,text" label="Input sequence" />
    <param name="width" type="integer" value="512" min="0" max="16384" label="Output image width" help="in pixels (max 16384)" />
    <param name="height" type="integer" value="512" min="0" max="16384" label="Output image height" help="in pixels (max 16384)" />
    <conditional name="colors">
      <param name="custom" type="select" label="Base colors">
        <option value="" selected="True">Use default colors</option>
        <option value="true">Use custom colors</option>
      </param>
      <when value="">
        <!-- do nothing -->
      </when>
      <when value="true">
        <!-- 'G':'255,255,255', 'C':'0,0,255', 'A':'0,255,0', 'T':'255,0,0' -->
        <param name="background" type="text" value="255,255,255" label="Background RGB value" help="Three numbers 0 through 255, separated by commas (no spaces)">
          <validator type="regex" message='Color must be in the form of "R,G,B"'>^[0-9]+,[0-9]+,[0-9]+$</validator>
        </param>
        <param name="G" type="text" value="255,255,255" label="G RGB value" help="Three numbers 0 through 255, separated by commas (no spaces)">
          <validator type="regex" message='Color must be in the form of "R,G,B"'>^[0-9]+,[0-9]+,[0-9]+$</validator>
        </param>
        <param name="C" type="text" value="0,0,255" label="C RGB value" help="Three numbers 0 through 255, separated by commas (no spaces)">
          <validator type="regex" message='Color must be in the form of "R,G,B"'>^[0-9]+,[0-9]+,[0-9]+$</validator>
        </param>
        <param name="A" type="text" value="0,255,0" label="A RGB value" help="Three numbers 0 through 255, separated by commas (no spaces)">
          <validator type="regex" message='Color must be in the form of "R,G,B"'>^[0-9]+,[0-9]+,[0-9]+$</validator>
        </param>
        <param name="T" type="text" value="255,0,0" label="T RGB value" help="Three numbers 0 through 255, separated by commas (no spaces)">
          <validator type="regex" message='Color must be in the form of "R,G,B"'>^[0-9]+,[0-9]+,[0-9]+$</validator>
        </param>
      </when>
    </conditional>
  </inputs>
  <outputs>
    <data name="output" format="png"/>
  </outputs>

  <help>

.. class:: infomark

**What it does**

This tool converts DNA sequence into a PNG image by representing each base with one colored pixel.

-----

.. class:: infomark

**Input Format**

The input sequence can be in FASTA format or a plain text file containing only the sequence. Any non-ATGC characters (case-insensitive) will be skipped. In a FASTA file with multiple sequences, all sequences will be used.

  </help>

</tool>