mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Various tool fixes, eliminated now unnecessary "refresh_on_change", eliminated old aggregation tool, fixed db conditional in mapping.
This commit is contained in:
@@ -241,9 +241,7 @@ def db_next_hid( self ):
|
||||
History._next_hid = db_next_hid
|
||||
|
||||
def init( file_path, url, **kwargs ):
|
||||
"""
|
||||
Connect mappings to the database
|
||||
"""
|
||||
"""Connect mappings to the database"""
|
||||
create_tables = kwargs.pop( 'create_tables', False )
|
||||
# Connect dataset to the file path
|
||||
Dataset.file_path = file_path
|
||||
@@ -255,7 +253,7 @@ def init( file_path, url, **kwargs ):
|
||||
if table.columns.has_key( "update_time" ):
|
||||
table.columns['update_time'].type = TIMESTAMP()
|
||||
# Connect the metadata to the database.
|
||||
if url.find( "sqlite" ) < 0 and url.find( '///' ) >= 0:
|
||||
elif url.startswith( "postgresql:///" ):
|
||||
import psycopg
|
||||
try:
|
||||
dbconn = url.split('///')
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<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>
|
||||
<param format="tabular" name="input" type="data" label="Sort Query" refresh_on_change="True" />
|
||||
<param format="tabular" name="input" type="data" label="Sort Query" />
|
||||
<param name="column" label="on column" type="columnlist" assoc_dataset="input" />
|
||||
<param name="order" type="select" label="in">
|
||||
<option value="ASC">Ascending order</option>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<description>occurences of each record</description>
|
||||
<command interpreter="python">uniq.py -i $input -o $out_file1 -c "$column" -d $delim</command>
|
||||
<inputs>
|
||||
<param name="input" type="data" format="tabular" label="from query" refresh_on_change="True" help="Query missing? See TIP below"/>
|
||||
<param name="input" type="data" format="tabular" label="from query" help="Query missing? See TIP below"/>
|
||||
<param name="column" type="columnlist" assoc_dataset="input" multiple="True" numerical="False" label="Count occurencies of values in column(s)" help="Multi-select list - hold the appropriate key while clicking to select multiple columns" />
|
||||
<param name="delim" type="select" label="Delimited by">
|
||||
<option value="T">Tab</option>
|
||||
|
||||
@@ -36,10 +36,16 @@ def main():
|
||||
if line and not line.startswith( '#' ):
|
||||
# Extract values and convert to floats
|
||||
row = []
|
||||
fields = line.split( "\t" )
|
||||
val = fields[column]
|
||||
if val.lower() == "na":
|
||||
row.append( float( "nan" ) )
|
||||
try:
|
||||
fields = line.split( "\t" )
|
||||
val = fields[column]
|
||||
if val.lower() == "na":
|
||||
row.append( float( "nan" ) )
|
||||
except:
|
||||
valid = False
|
||||
skipped_lines += 1
|
||||
if not first_invalid_line:
|
||||
first_invalid_line = i+1
|
||||
else:
|
||||
try:
|
||||
row.append( float( val ) )
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<description>of a numeric column</description>
|
||||
<command interpreter="python">histogram.py $input $out_file1 $numerical_column "$title" "$xlab" $breaks $density</command>
|
||||
<inputs>
|
||||
<param name="input" type="data" format="tabular" label="Dataset" refresh_on_change="True" help="Query missing? See TIP below"/>
|
||||
<param name="input" type="data" format="tabular" label="Dataset" help="Query missing? See TIP below"/>
|
||||
<param name="numerical_column" type="columnlist" assoc_dataset="input" numerical="True" label="Numerical column for x axis" />
|
||||
<param name="breaks" type="integer" size="4" value="0" label="Number of breaks (bars)"/>
|
||||
<param name="title" type="text" size="30" value="Histogram" label="Plot title"/>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<description>of two numeric columns</description>
|
||||
<command interpreter="python">scatterplot.py $input $out_file1 $col1 $col2 "$title" "$xlab" "$ylab"</command>
|
||||
<inputs>
|
||||
<param name="input" type="data" format="tabular" label="Dataset" refresh_on_change="True" help="Query missing? See TIP below"/>
|
||||
<param name="input" type="data" format="tabular" label="Dataset" help="Query missing? See TIP below"/>
|
||||
<param name="col1" type="columnlist" assoc_dataset="input" numerical="True" label="Numerical column for x axis" />
|
||||
<param name="col2" type="columnlist" assoc_dataset="input" numerical="True" label="Numerical column for y axis" />
|
||||
<param name="title" size="30" type="text" value="Scatterplot" label="Plot title"/>
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
<tool id="aggregate_scores_in_intervals1" description="from the table browser (equivalent to wiggle format)." name="Aggregate datapoints">
|
||||
<description>Appends the average, min, max, sum, and count of datapoints per interval</description>
|
||||
<command interpreter="python2.4">aggregate_scores_in_intervals.py $input2 $input1 $input1_chromCol $input1_startCol $input1_endCol $out_file1</command>
|
||||
<inputs>
|
||||
<page>
|
||||
<param format="wig" name="input2" type="data" label="Datapoints from table browser"/>
|
||||
<param format="interval" name="input1" type="data" label="Interval file"/>
|
||||
</page>
|
||||
</inputs>
|
||||
<outputs>
|
||||
<data format="interval" name="out_file1" metadata_source="input2"/>
|
||||
</outputs>
|
||||
<!-- TODO: This tool is currently not being used, uncomment and correct the tests if it ever is...
|
||||
<tests>
|
||||
<test>
|
||||
<param name="input1" value="aggregate_binned_scores_in_intervals.bed" />
|
||||
<param name="datasets" value="aggregate_binned_scores_in_intervals.wig" />
|
||||
<output name="out_file1" file="aggregate_binned_scores_in_intervals.out" />
|
||||
</test>
|
||||
</tests> -->
|
||||
<help>
|
||||
|
||||
.. class:: warningmark
|
||||
|
||||
This tool currently only works with data from genome builds hg16, hg17 or hg18.
|
||||
|
||||
.. class:: warningmark
|
||||
|
||||
This tool expects 2 input datasets, the first in wiggle format and the second in interval format.
|
||||
|
||||
-----
|
||||
|
||||
.. class:: infomark
|
||||
|
||||
**TIP:** Aggregating data may throw exceptions if the data type (e.g., string, integer) in every line of the columns is not appropriate for the computation (e.g., attempting numerical calculations on strings). If an exception is thrown, computation is stopped and an error message is displayed.
|
||||
|
||||
-----
|
||||
|
||||
**Syntax**
|
||||
|
||||
This tool returns aggregated data per interval in the form of the average, minimum and maximum of the data points for each given interval.
|
||||
|
||||
Note: Datapoints must be in the format returned by the table browser.
|
||||
|
||||
.. image:: ../../static/images/dat_points_table_brows_1.png
|
||||
|
||||
-----
|
||||
|
||||
**Example**
|
||||
|
||||
*Input*
|
||||
|
||||
.. image:: ../../static/images/aggregate_history1.png
|
||||
|
||||
*Result*
|
||||
|
||||
.. image:: ../../static/images/aggregate_history2.png
|
||||
|
||||
</help>
|
||||
</tool>
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<description>for numeric columns</description>
|
||||
<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 format="tabular" name="input1" type="data" label="Dataset" help="Query missing? See TIP below"/>
|
||||
<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>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#end for
|
||||
</command>
|
||||
<inputs>
|
||||
<param format="tabular" name="input1" type="data" label="Select data" refresh_on_change="True" help="Query missing? See TIP below."/>
|
||||
<param format="tabular" name="input1" type="data" label="Select data" help="Query missing? See TIP below."/>
|
||||
<param name="groupcol" label="Group by column" type="columnlist" assoc_dataset="input1" />
|
||||
<repeat name="operations" title="Operation">
|
||||
<param name="optype" type="select" label="Type">
|
||||
|
||||
Reference in New Issue
Block a user