view find_intervals.xml @ 12:4b6590dd7250

Uploaded
author miller-lab
date Wed, 12 Sep 2012 17:10:26 -0400
parents
children
line wrap: on
line source

<tool id="gd_find_intervals" name="Find remarkable" version="1.0.0">
  <description>genomic intervals</description>

  <command interpreter="python">
    find_intervals.py "$input" "$input.metadata.dbkey" "$output" "$output.files_path"

    #if $override_metadata.choice == "0"
      "$input.metadata.ref" "$input.metadata.rPos"
    #else
      "$override_metadata.ref_col" "$override_metadata.rpos_col"
    #end if

    "$score_col" "$shuffles"

    #if $cutoff.type == 'percentage'
      "$cutoff.cutoff_pct"
    #else
      "=$cutoff.cutoff_val"
    #end if

    "$out_format"
  </command>

  <inputs>
    <param name="input" type="data" format="tabular" label="Input">
      <validator type="unspecified_build" message="This dataset does not have a reference species and cannot be used with this tool" />
    </param>

    <param name="score_col" type="data_column" data_ref="input" numerical="true" label="Column with score"/>

    <conditional name="cutoff">
      <param name="type" type="select" label="Cutoff type">
        <option value="percentage">percentage</option>
        <option value="value">value</option>
      </param>
      <when value="percentage">
        <param name="cutoff_pct" type="float" value="95" min="0" max="100" label="Percentage cutoff"/>
      </when>
      <when value="value">
        <param name="cutoff_val" type="float" value="0.0" label="Value cutoff"/>
      </when>
    </conditional>

    <param name="shuffles" type="integer" min="0" value="0" label="Number of randomizations"/>

    <param name="out_format" type="select" format="integer" label="Report SNPs">
      <option value="0" selected="true">No</option>
      <option value="1">Yes</option>
    </param>

    <conditional name="override_metadata">
      <param name="choice" type="select" format="integer" label="Choose columns">
        <option value="0" selected="true">No, get columns from metadata</option>
        <option value="1" >Yes, choose columns</option>
      </param>
      <when value="0" />
      <when value="1">
        <param name="ref_col" type="data_column" data_ref="input" numerical="false" label="Column with reference chromosome"/>
        <param name="rpos_col" type="data_column" data_ref="input" numerical="true" label="Column with reference position"/>
      </when>
    </conditional>
  </inputs>

  <outputs>
    <data name="output" format="interval">
        <change_format>
            <when input="out_format" value="1" format="bigwigpos" />
        </change_format>
    </data>
  </outputs>

  <tests>
    <test>
      <param name="input" value="test_in/sample.gd_snp" ftype="gd_snp" />
      <param name="score_col" value="5" />
      <param name="type" value="value" />
      <param name="cutoff_val" value="700.0" />
      <param name="shuffles" value="10" />
      <param name="out_format" value="0" />
      <param name="choice" value="0" />

      <output name="output" file="test_out/find_intervals/find_intervals.interval" />
    </test>
  </tests>

  <help>
**What it does**

The user selects a SNP table and specifies the columns containing (1)
chromosome, (2) position, (3) scores (such as an Fst-value for the SNP), (4)
a percentage or raw score for the "cutoff" and (5) the number of times the
data should be randomized (only intervals with score exceeding the maximum for
the randomized data are reported).  If a percentage (e.g. 95%) is specified
for #3, then that percentile of the scores is used as the cutoff; this may
not work well if many SNPs have the same score.  The program subtracts the
cutoff from every score, then finds genomic intervals (i.e., consecutive runs
of SNPs) whose total score cannot be increased by adding or subtracting one
or more SNPs at the ends of the interval.
  </help>
</tool>