data on any column using simple expressions filtering.py $input $out_file1 "$cond" ${input.metadata.columns} "${input.metadata.column_types}" .. 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 columns 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->Convert* ----- **Syntax** The filter tool allows you to restrict the dataset using simple conditional statements. - Columns are referenced with **c** and a **number**. For example, **c1** refers to the first column of a tab-delimited file - Make sure that multi-character operators contain no white space ( e.g., **<=** is valid while **< =** is not valid ) - When using 'equal-to' operator **double equal sign '==' must be used** ( e.g., **c1=='chr1'** ) - Non-numerical values must be included in single or double quotes ( e.g., **c6=='+'** ) - Filtering condition can include logical operators, but **make sure operators are all lower case** ( e.g., **(c1!='chrX' and c1!='chrY') or not c6=='+'** ) ----- **Example** - **c1=='chr1'** selects lines in which the first column is chr1 - **c3-c2<100*c4** selects lines where subtracting column 3 from column 2 is less than the value of column 4 times 100 - **len(c2.split(',')) < 4** will select lines where the second column has less than four comma separated elements - **c2>=1** selects lines in which the value of column 2 is greater than or equal to 1 - Numbers should not contain commas - **c2<=44,554,350** will not work, but **c2<=44554350** will - Some words in the data can be used, but must be single or double quoted ( e.g., **c3=='exon'** )