mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Enhanced sort tool to use columnlist tool parameter, altered functional test to work with new version. Some other miscellaneous cleanup.
This commit is contained in:
@@ -34,8 +34,7 @@ class FilterTests(TwillTestCase):
|
||||
|
||||
def test_21_Sort1(self):
|
||||
"""3E_Filter: Sort on column one"""
|
||||
self.run_tool("sort1", input="7.bed")
|
||||
self.submit_form(1, column="1", order="ASC", style="alpha")
|
||||
self.run_tool("sort1", input="7.bed", column="1", order="ASC", style="alpha")
|
||||
self.wait()
|
||||
self.check_data('sc_3E_sort.bed')
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ If your original data has the following format:
|
||||
|chrom|start|end|
|
||||
+-----+-----+---+
|
||||
|
||||
and you choose to compute phastCons scores, your output will look like this:
|
||||
and you choose to compute phastOdds scores, your output will look like this:
|
||||
|
||||
+-----+-----+---+-----+
|
||||
|chrom|start|end|score|
|
||||
|
||||
+12
-17
@@ -2,20 +2,16 @@
|
||||
<description>data in ascending or descending order</description>
|
||||
<command interpreter="python">sorter.py -i $input -o $out_file1 -cols $column -order $order -style $style</command>
|
||||
<inputs>
|
||||
<page>
|
||||
<param format="tabular" name="input" type="data" label="Sort Query"/>
|
||||
</page>
|
||||
<page>
|
||||
<param name="column" label="on column" type="select" dynamic_options="get_columns( input )" />
|
||||
<param name="order" type="select" label="in">
|
||||
<option value="ASC">Ascending order</option>
|
||||
<option value="DESC">Descending order</option>
|
||||
</param>
|
||||
<param name="style" type="select" label="Flavor">
|
||||
<option value="alpha">Alphabetical sort</option>
|
||||
<option value="num">Numerical sort</option>
|
||||
</param>
|
||||
</page>
|
||||
<param format="tabular" name="input" type="data" label="Sort Query" refresh_on_change="True" />
|
||||
<param name="column" label="on column" type="columnlist" assoc_dataset="input" />
|
||||
<param name="order" type="select" label="in">
|
||||
<option value="ASC">Ascending order</option>
|
||||
<option value="DESC">Descending order</option>
|
||||
</param>
|
||||
<param name="style" type="select" label="Flavor">
|
||||
<option value="alpha">Alphabetical sort</option>
|
||||
<option value="num">Numerical sort</option>
|
||||
</param>
|
||||
</inputs>
|
||||
<outputs>
|
||||
<data format="input" name="out_file1" metadata_source="input"/>
|
||||
@@ -23,7 +19,7 @@
|
||||
<tests>
|
||||
<test>
|
||||
<param name="input" value="1.bed"/>
|
||||
<param name="column" value="c1"/>
|
||||
<param name="column" value="1"/>
|
||||
<param name="order" value="ASC"/>
|
||||
<param name="style" value="num"/>
|
||||
<output name="out_file1" file="fs-sort.dat"/>
|
||||
@@ -50,6 +46,5 @@ This tool sorts the dataset on any column in either ascending or descending orde
|
||||
|
||||
The list of numbers 4,17,3,5 collates to 3,4,5,17 by numerical sorting, while it collates to 17,3,4,5 by alphabetical sorting.
|
||||
|
||||
</help>
|
||||
<code file="sorter_code.py"/>
|
||||
</help>
|
||||
</tool>
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
|
||||
def get_columns( input1 ):
|
||||
columns = []
|
||||
|
||||
for col in range(1, input1.metadata.columns+1):
|
||||
option = "c" + str(col)
|
||||
columns.append((option,str(col),False))
|
||||
return columns
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python2.4
|
||||
#Greg Von Kuster
|
||||
|
||||
import sys
|
||||
from rpy import *
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
#Greg Von Kuster
|
||||
|
||||
import sys
|
||||
from Numeric import *
|
||||
from rpy import *
|
||||
|
||||
def fail( message ):
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<command interpreter="python">cor.py $input1 $out_file1 $numeric_columns $method</command>
|
||||
<inputs>
|
||||
<param format="tabular" name="input1" type="data" label="Dataset" refresh_on_change="True" help="Query missing? See TIP below"/>
|
||||
<param name="numeric_columns" label="Numeric columns" type="columnlist" numerical="True" multiple="True" assoc_dataset="input1" help="Multi-select list - hold the appropriate key while clicking to select multiple columns" />
|
||||
<param name="numeric_columns" label="Numerical columns" type="columnlist" numerical="True" multiple="True" assoc_dataset="input1" help="Multi-select list - hold the appropriate key while clicking to select multiple columns" />
|
||||
<param name="method" type="select" label="Method">
|
||||
<option value="pearson">Pearson</option>
|
||||
<option value="kendall">Kendall rank</option>
|
||||
|
||||
Reference in New Issue
Block a user