mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
51 lines
1.9 KiB
XML
51 lines
1.9 KiB
XML
<tool id="column_param" name="Column Param" version="1.0.0">
|
|
<command><![CDATA[
|
|
cut -f '$col' '$input1' > '$output1' &&
|
|
echo "col $col" > '$output2' &&
|
|
echo "col_names $col_names" >> '$output2'
|
|
]]></command>
|
|
<inputs>
|
|
<param name="input1" type="data" format="tabular" label="Input 1" />
|
|
<param name="col" type="data_column" data_ref="input1" label="Column to Use" />
|
|
<param name="col_names" type="data_column" data_ref="input1" use_header_names="true" label="Column to Use" />
|
|
</inputs>
|
|
<outputs>
|
|
<data name="output1" format="tabular" />
|
|
<data name="output2" format="txt" />
|
|
</outputs>
|
|
<tests>
|
|
<test>
|
|
<param name="input1" value="2.tabular" />
|
|
<param name="col" value="2" />
|
|
<param name="col_names" value="2" />
|
|
<output name="output1">
|
|
<assert_contents>
|
|
<has_line line="68" />
|
|
</assert_contents>
|
|
</output>
|
|
<output name="output2">
|
|
<assert_contents>
|
|
<has_line line="col 2" />
|
|
<has_line line="col_names 2" />
|
|
</assert_contents>
|
|
</output>
|
|
</test>
|
|
<!-- test if non tabular data also creates entries by using the default
|
|
value (which is the 1st column, but empty if filling the options fails) -->
|
|
<test>
|
|
<param name="input1" value="1.bed" />
|
|
<output name="output1">
|
|
<assert_contents>
|
|
<has_line line="chr1" />
|
|
</assert_contents>
|
|
</output>
|
|
<output name="output2">
|
|
<assert_contents>
|
|
<has_line line="col 1" />
|
|
<has_line line="col_names 1" />
|
|
</assert_contents>
|
|
</output>
|
|
</test>
|
|
</tests>
|
|
</tool>
|