view tools/filters/gff/gff_filter_by_attribute.xml @ 0:9071e359b9a3

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:37:19 -0500
parents
children
line wrap: on
line source

<tool id="gff_filter_by_attribute" name="Filter GFF data by attribute" version="0.1">
  <description>using simple expressions</description>
  <command interpreter="python">
    gff_filter_by_attribute.py $input $out_file1 "$cond" '${input.metadata.attribute_types}'
  </command>
  <inputs>
    <param format="gff" name="input" type="data" label="Filter" help="Dataset missing? See TIP below."/>
    <param name="cond" size="40" type="text" value="gene_id=='uc002loc.1'" label="With following condition" help="Double equal signs, ==, must be used as shown above. To filter for an arbitrary string, use the Select tool.">
      <validator type="empty_field" message="Enter a valid filtering condition, see syntax and examples below."/>
    </param>
  </inputs>
  <outputs>
    <data format="input" name="out_file1" metadata_source="input"/>
  </outputs>
  <tests>
    <test>
        <param name="input" value="gff_filter_attr_in1.gff"/>
        <param name="cond" value="conf_lo>0"/>
        <output name="out_file1" file="gff_filter_by_attribute_out1.gff"/>
    </test>
    <test>
        <param name="input" value="gff_filter_attr_in1.gff"/>
        <param name="cond" value="conf_lo==0 or conf_hi>125"/>
        <output name="out_file1" file="gff_filter_by_attribute_out2.gff"/>
    </test>
  </tests>

  <help>

.. class:: warningmark

Double equal signs, ==, must be used as *"equal to"* (e.g., **c1 == 'chr22'**)

.. class:: infomark

**TIP:** Attempting to apply a filtering condition may throw exceptions if the data type (e.g., string, integer) in every line of the attribute being filtered is not appropriate for the condition (e.g., attempting certain numerical calculations on strings).  If an exception is thrown when applying the condition to a line, that line is skipped as invalid for the filter condition.  The number of invalid skipped lines is documented in the resulting history item as a "Condition/data issue".

.. class:: infomark

**TIP:** If your data is not TAB delimited, use *Text Manipulation-&gt;Convert*

-----

**Syntax**

The filter tool allows you to restrict the dataset using simple conditional statements.

- Make sure that multi-character operators contain no white space ( e.g., **&lt;=** is valid while **&lt; =** is not valid )
- When using 'equal-to' operator **double equal sign '==' must be used** ( e.g., **attribute_name=='chr1'** )
- Non-numerical values must be included in single or double quotes ( e.g., **attribute_name=='XX22'** )

</help>
</tool>