details: http://www.bx.psu.edu/hg/galaxy/rev/75312c1cab05
changeset: 1578:75312c1cab05
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Tue Oct 28 10:55:39 2008 -0400
description:
Tweaks to my last commit - only persist job states defined in model, not job.
1 file(s) affected in this change:
lib/galaxy/jobs/__init__.py
diffs (71 lines):
diff -r 0f4fd4c20cd6 -r 75312c1cab05 lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py Tue Oct 28 10:21:02 2008 -0400
+++ b/lib/galaxy/jobs/__init__.py Tue Oct 28 10:55:39 2008 -0400
@@ -117,8 +117,8 @@
while self.running:
try:
self.monitor_step()
- except:
- log.exception( "Exception in monitor_step" )
+ except Exception, e:
+ log.exception( "Exception in monitor_step: %s" % str( e ) )
# Sleep
self.sleeper.sleep( 1 )
@@ -308,7 +308,7 @@
self.extra_filenames = extra_filenames
return extra_filenames
- def fail( self, message, state=None, exception=False ):
+ def fail( self, message, exception=False ):
"""
Indicate job failure by setting state and message on all output
datasets.
@@ -316,7 +316,7 @@
job = model.Job.get( self.job_id )
job.refresh()
# if the job was deleted, don't fail it
- if not job.state == job.states.DELETED:
+ if not job.state == model.Job.states.DELETED:
for dataset_assoc in job.output_datasets:
dataset = dataset_assoc.dataset
dataset.refresh()
@@ -325,10 +325,7 @@
dataset.info = message
dataset.set_size()
dataset.flush()
- if state is not None:
- job.state = state
- else:
- job.state = model.Job.states.ERROR
+ job.state = model.Job.states.ERROR
job.command_line = self.command_line
job.info = message
# If the failure is due to a Galaxy framework exception, save the traceback
@@ -385,13 +382,11 @@
idata.dataset.refresh() #we need to refresh the base Dataset, since that is where 'state' is stored
# don't run jobs for which the input dataset was deleted
if idata.deleted:
- msg = "input data %d was deleted before this job started" % idata.hid
- self.fail( msg, state=JOB_INPUT_DELETED )
+ self.fail( "input data %d was deleted before this job started" % idata.hid )
return JOB_INPUT_DELETED
# an error in the input data causes us to bail immediately
elif idata.state == idata.states.ERROR:
- msg = "input data %d is in an error state" % idata.hid
- self.fail( msg, state=JOB_INPUT_ERROR )
+ self.fail( "input data %d is in an error state" % idata.hid )
return JOB_INPUT_ERROR
elif idata.state != idata.states.OK:
# need to requeue
@@ -578,8 +573,8 @@
while self.running:
try:
self.monitor_step()
- except:
- log.exception( "Exception in monitor_step" )
+ except Exception, e:
+ log.exception( "Exception in monitor_step: %s" % str( e ) )
# Sleep
self.sleeper.sleep( 1 )
details: http://www.bx.psu.edu/hg/galaxy/rev/0f4fd4c20cd6
changeset: 1577:0f4fd4c20cd6
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Tue Oct 28 10:21:02 2008 -0400
description:
Improve job error messaging, some fixes for setting job state, job info, dataset state, and dataset info when job ends in error.
2 file(s) affected in this change:
lib/galaxy/jobs/__init__.py
templates/dataset/errors.tmpl
diffs (293 lines):
diff -r 8eec48aaca6e -r 0f4fd4c20cd6 lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py Mon Oct 27 17:03:50 2008 -0400
+++ b/lib/galaxy/jobs/__init__.py Tue Oct 28 10:21:02 2008 -0400
@@ -176,11 +176,17 @@
self.dispatcher.put( job )
log.debug( "job %d dispatched" % job.job_id)
elif job_state == JOB_DELETED:
- log.debug( "job %d deleted by user while still queued" % job.job_id )
+ msg = "job %d deleted by user while still queued" % job.job_id
+ job.info = msg
+ log.debug( msg )
else:
- log.error( "unknown job state '%s' for job %d" % ( job_state, job.job_id ))
- except:
- log.exception( "failure running job %d" % job.job_id )
+ msg = "unknown job state '%s' for job %d" % ( job_state, job.job_id )
+ job.info = msg
+ log.error( msg )
+ except Exception, e:
+ msg = "failure running job %d: %s" % ( job.job_id, str( e ) )
+ job.info = msg
+ log.exception( msg )
# Update the waiting list
self.waiting = new_waiting
# If special (e.g. fair) scheduling is enabled, dispatch all jobs
@@ -194,9 +200,10 @@
except Empty:
# squeue is empty, so stop dispatching
break
- except: # if something else breaks while dispatching
- job.fail( "failure dispatching job" )
- log.exception( "failure running job %d" % sjob.job_id )
+ except Exception, e: # if something else breaks while dispatching
+ msg = "failure running job %d: %s" % ( sjob.job_id, str( e ) )
+ job.fail( msg )
+ log.exception( msg )
def put( self, job_id, tool ):
"""Add a job to the queue (by job identifier)"""
@@ -301,7 +308,7 @@
self.extra_filenames = extra_filenames
return extra_filenames
- def fail( self, message, exception=False ):
+ def fail( self, message, state=None, exception=False ):
"""
Indicate job failure by setting state and message on all output
datasets.
@@ -309,25 +316,26 @@
job = model.Job.get( self.job_id )
job.refresh()
# if the job was deleted, don't fail it
- if job.state == job.states.DELETED:
- self.cleanup()
- return
- for dataset_assoc in job.output_datasets:
- dataset = dataset_assoc.dataset
- dataset.refresh()
- dataset.state = dataset.states.ERROR
- dataset.blurb = 'tool error'
- dataset.info = message
- dataset.set_size()
- dataset.flush()
- job.state = model.Job.states.ERROR
- job.command_line = self.command_line
- job.info = message
- # If the failure is due to a Galaxy framework exception, save
- # the traceback
- if exception:
- job.traceback = traceback.format_exc()
- job.flush()
+ if not job.state == job.states.DELETED:
+ for dataset_assoc in job.output_datasets:
+ dataset = dataset_assoc.dataset
+ dataset.refresh()
+ dataset.state = dataset.states.ERROR
+ dataset.blurb = 'tool error'
+ dataset.info = message
+ dataset.set_size()
+ dataset.flush()
+ if state is not None:
+ job.state = state
+ else:
+ job.state = model.Job.states.ERROR
+ job.command_line = self.command_line
+ job.info = message
+ # If the failure is due to a Galaxy framework exception, save the traceback
+ if exception:
+ job.traceback = traceback.format_exc()
+ job.flush()
+ # If the job was deleted, just clean up
self.cleanup()
def change_state( self, state, info = False ):
@@ -371,16 +379,19 @@
job.refresh()
for dataset_assoc in job.input_datasets:
idata = dataset_assoc.dataset
- if not idata: continue
+ if not idata:
+ continue
idata.refresh()
idata.dataset.refresh() #we need to refresh the base Dataset, since that is where 'state' is stored
# don't run jobs for which the input dataset was deleted
- if idata.deleted == True:
- self.fail( "input data %d was deleted before this job ran" % idata.hid )
+ if idata.deleted:
+ msg = "input data %d was deleted before this job started" % idata.hid
+ self.fail( msg, state=JOB_INPUT_DELETED )
return JOB_INPUT_DELETED
# an error in the input data causes us to bail immediately
elif idata.state == idata.states.ERROR:
- self.fail( "error in input data %d" % idata.hid )
+ msg = "input data %d is in an error state" % idata.hid
+ self.fail( msg, state=JOB_INPUT_ERROR )
return JOB_INPUT_ERROR
elif idata.state != idata.states.OK:
# need to requeue
@@ -467,8 +478,8 @@
os.remove( fname )
if self.working_directory is not None:
os.rmdir( self.working_directory )
- except:
- log.exception( "Unable to cleanup job %s" % self.job_id )
+ except Exception, e:
+ log.exception( "Unable to cleanup job %s, exception: %s" % ( str( self.job_id ), str( e ) ) )
def get_command_line( self ):
return self.command_line
@@ -617,7 +628,7 @@
job = model.Job.get( job_id )
job.refresh()
job.state = job.states.DELETED
- job.info = "Job deleted by user before it completed."
+ job.info = "Job output deleted by user before job completed."
job.flush()
for dataset_assoc in job.output_datasets:
dataset = dataset_assoc.dataset
@@ -630,7 +641,7 @@
dataset.deleted = True
dataset.blurb = 'deleted'
dataset.peek = 'Job deleted'
- dataset.info = 'Job deleted by user before it completed'
+ dataset.info = 'Job output deleted by user before job completed'
dataset.flush()
def put( self, job ):
diff -r 8eec48aaca6e -r 0f4fd4c20cd6 templates/dataset/errors.tmpl
--- a/templates/dataset/errors.tmpl Mon Oct 27 17:03:50 2008 -0400
+++ b/templates/dataset/errors.tmpl Tue Oct 28 10:21:02 2008 -0400
@@ -1,79 +1,69 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
+ <head>
+ <title>Dataset generation errors</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link href="/static/style/base.css" rel="stylesheet" type="text/css" />
+ <style>
+ pre
+ {
+ background: white;
+ color: black;
+ border: dotted black 1px;
+ overflow: auto;
+ padding: 10px;
+ }
+ </style>
+ </head>
-<head>
-<title>Dataset generation errors</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<link href="/static/style/base.css" rel="stylesheet" type="text/css" />
-<style>
-pre
-{
- background: white;
- color: black;
- border: dotted black 1px;
- overflow: auto;
- padding: 10px;
-}
-</style>
-</head>
+ <body>
+ <h2>Dataset generation errors</h2>
+ <p><b>Dataset $dataset.hid: $dataset.display_name</b></p>
-<body>
-
- <h2>Dataset generation errors</h2>
-
- <p><b>Dataset $dataset.hid: $dataset.display_name</b></p>
-
- #if $dataset.creating_job_associations
-
- #set job = $dataset.creating_job_associations[0].job
-
- #if job.traceback
- The Galaxy framework encountered the following error while attempting
- to run the tool:
+ #if $dataset.creating_job_associations
+ #set job = $dataset.creating_job_associations[0].job
+ #if job.traceback
+ The Galaxy framework encountered the following error while attempting to run the tool:
+ <pre>${job.traceback}</pre>
+ #end if
+ #if $job.stderr or $job.info
+ Tool execution generated the following error message:
+ #if $job.stderr
+ <pre>${job.stderr}</pre>
+ #elif $job.info
+ <pre>${job.info}</pre>
+ #end if
+ #else
+ Tool execution did not generate any error messages.
+ #end if
+ #if $job.stdout
+ The tool produced the following additional output:
+ <pre>${job.stdout}</pre>
+ #end if
+ #else
+ The tool did not create any additional job / error info.
+ #end if
- <pre>${job.traceback}</pre>
-
- #end if
-
- #if $job.stderr
- Tool execution generated the following error message:
- <pre>${job.stderr}</pre>
- #else
- Tool execution did not generate any error messages.
- #end if
-
- #if $job.stdout
- The tool produced the following additional output:
- <pre>${job.stdout}</pre>
- #end if
-
- #else
-
- The tool did not create any additional job / error info.
-
- #end if
-
- <h2>Report this error to the Galaxy Team</h2>
-
- <p>The Galaxy team regularly reviews errors that occur in the application.
- However, if you would like to provide additional information (such as
- what you were trying to do when the error occurred) and a contact e-mail
- address, we will be better able to investigate your problem and get back
- to you.</p>
-
- <div class="toolForm">
- <div class="toolFormTitle">Error Report</div>
- <div class="toolFormBody">
- <form name="report_error" action="${h.url_for( action='report_error')}" method="post" >
- <input type="hidden" name="id" value="$dataset.id" />
- <table>
- <tr valign="top"><td>Your Email:</td><td><input type="text" name="email" size="40" /></td></tr>
- <tr valign="top"><td>Message:</td><td><textarea name="message", rows="10" cols="40" /></textarea></td></tr>
- <tr><td></td><td><input type="submit" value="Report">
- </table>
- </form>
- </div>
- </div>
-
-</body>
+ <h2>Report this error to the Galaxy Team</h2>
+ <p>
+ The Galaxy team regularly reviews errors that occur in the application.
+ However, if you would like to provide additional information (such as
+ what you were trying to do when the error occurred) and a contact e-mail
+ address, we will be better able to investigate your problem and get back
+ to you.
+ </p>
+ <div class="toolForm">
+ <div class="toolFormTitle">Error Report</div>
+ <div class="toolFormBody">
+ <form name="report_error" action="${h.url_for( action='report_error')}" method="post" >
+ <input type="hidden" name="id" value="$dataset.id" />
+ <table>
+ <tr valign="top"><td>Your Email:</td><td><input type="text" name="email" size="40" /></td></tr>
+ <tr valign="top"><td>Message:</td><td><textarea name="message", rows="10" cols="40" /></textarea></td></tr>
+ <tr><td></td><td><input type="submit" value="Report">
+ </table>
+ </form>
+ </div>
+ </div>
+ </body>
</html>
details: http://www.bx.psu.edu/hg/galaxy/rev/415cc6dc8e35
changeset: 1575:415cc6dc8e35
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Mon Oct 27 16:03:43 2008 -0400
description:
Add a new URL_method attribute to data_source tool types whose value is either "get" or "post" ( some require a get request while others require a post request ). This fixes the Biomart problem ( along with a new, well documented hack that can be eliminated when Biomart encodes the value of URL in the initial response - they'll tell us when they've fixed this ). Also added some requested info to the "send to EpiGRAPH" tool.
12 file(s) affected in this change:
lib/galaxy/tools/__init__.py
lib/galaxy/util/__init__.py
lib/galaxy/web/controllers/tool_runner.py
tools/data_destination/epigraph.xml
tools/data_source/biomart.xml
tools/data_source/biomart_test.xml
tools/data_source/data_source.py
tools/data_source/epigraph_import.xml
tools/data_source/flymine.xml
tools/data_source/ucsc_tablebrowser.xml
tools/data_source/ucsc_tablebrowser_archaea.xml
tools/data_source/ucsc_tablebrowser_test.xml
diffs (299 lines):
diff -r 36a7ff82faf0 -r 415cc6dc8e35 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py Fri Oct 24 12:32:32 2008 -0400
+++ b/lib/galaxy/tools/__init__.py Mon Oct 27 16:03:43 2008 -0400
@@ -228,19 +228,21 @@
self.version = "1.0.0"
# Type of tool
self.tool_type = root.get( "tool_type", None )
- if self.tool_type is not None:
- # data_source tool
- if self.tool_type == "data_source":
- self.param_trans_dict = {}
- req_param_trans = root.find( "request_param_translation" )
- if req_param_trans is not None:
- for req_param in req_param_trans.findall( "request_param" ):
- # req_param tags must look like <request_param galaxy_name="dbkey" remote_name="GENOME" missing="" />
- trans_list = []
- remote_name = req_param.get( "remote_name" )
- trans_list.append( req_param.get( "galaxy_name" ) )
- trans_list.append( req_param.get( "missing" ) )
- self.param_trans_dict[ remote_name ] = trans_list
+ # data_source tool
+ if self.tool_type == "data_source":
+ self.URL_method = root.get( "URL_method", "get" ) # get is the default
+ # TODO: Biomart hack - eliminate when they encode URL - they'll let us know when...
+ self.add_to_URL = root.get( "add_to_URL", None )
+ self.param_trans_dict = {}
+ req_param_trans = root.find( "request_param_translation" )
+ if req_param_trans is not None:
+ for req_param in req_param_trans.findall( "request_param" ):
+ # req_param tags must look like <request_param galaxy_name="dbkey" remote_name="GENOME" missing="" />
+ trans_list = []
+ remote_name = req_param.get( "remote_name" )
+ trans_list.append( req_param.get( "galaxy_name" ) )
+ trans_list.append( req_param.get( "missing" ) )
+ self.param_trans_dict[ remote_name ] = trans_list
# Command line (template). Optional for tools that do not invoke a local program
command = root.find("command")
if command is not None and command.text is not None:
diff -r 36a7ff82faf0 -r 415cc6dc8e35 lib/galaxy/util/__init__.py
--- a/lib/galaxy/util/__init__.py Fri Oct 24 12:32:32 2008 -0400
+++ b/lib/galaxy/util/__init__.py Mon Oct 27 16:03:43 2008 -0400
@@ -143,7 +143,7 @@
# different parameters can be sanitized in different ways.
NEVER_SANITIZE = ['file_data', 'url_paste', 'URL']
- def __init__( self, params, safe=True, sanitize=True, tool_type=None, param_trans_dict={} ):
+ def __init__( self, params, safe=True, sanitize=True, tool=None ):
if safe:
for key, value in params.items():
# Check to see if we should translate certain parameter names. For example,
@@ -152,21 +152,27 @@
# param_trans_dict looks like { "GENOME" : [ "dbkey" "?" ] }
new_key = key
new_value = value
- if tool_type == 'data_source':
- if key in param_trans_dict:
- new_key = param_trans_dict[ key ][0]
+ if tool and tool.tool_type == 'data_source':
+ if key in tool.param_trans_dict:
+ new_key = tool.param_trans_dict[ key ][0]
if not value:
- new_value = param_trans_dict[ key ][1]
+ new_value = tool.param_trans_dict[ key ][1]
if key not in self.NEVER_SANITIZE and sanitize:
self.__dict__[ new_key ] = sanitize_param( new_value )
else:
self.__dict__[ new_key ] = new_value
- for key, value in param_trans_dict.items():
- # Make sure that all translated values used in Galaxy are added to the params
- galaxy_name = param_trans_dict[ key ][0]
- if galaxy_name not in self.__dict__:
- # This will set the galaxy_name to the "missing" value
- self.__dict__[ galaxy_name ] = param_trans_dict[ key ][1]
+ if tool and tool.tool_type == 'data_source':
+ # Add the tool's URL_method to params
+ self.__dict__[ 'URL_method' ] = tool.URL_method
+ # TODO: Biomart hack - eliminate when they encode URL - they'll let us know when...
+ if tool.add_to_URL is not None:
+ self.__dict__[ 'add_to_URL' ] = tool.add_to_URL
+ for key, value in tool.param_trans_dict.items():
+ # Make sure that all translated values used in Galaxy are added to the params
+ galaxy_name = tool.param_trans_dict[ key ][0]
+ if galaxy_name not in self.__dict__:
+ # This will set the galaxy_name to the "missing" value
+ self.__dict__[ galaxy_name ] = tool.param_trans_dict[ key ][1]
else:
self.__dict__.update(params)
diff -r 36a7ff82faf0 -r 415cc6dc8e35 lib/galaxy/web/controllers/tool_runner.py
--- a/lib/galaxy/web/controllers/tool_runner.py Fri Oct 24 12:32:32 2008 -0400
+++ b/lib/galaxy/web/controllers/tool_runner.py Mon Oct 27 16:03:43 2008 -0400
@@ -39,11 +39,7 @@
log.error( "index called with tool id '%s' but no such tool exists", tool_id )
trans.log_event( "Tool id '%s' does not exist" % tool_id )
return "Tool '%s' does not exist, kwd=%s " % (tool_id, kwd)
- try:
- param_trans_dict = tool.param_trans_dict
- except:
- param_trans_dict = {}
- params = util.Params( kwd, sanitize=tool.options.sanitize, tool_type=tool.tool_type, param_trans_dict=param_trans_dict )
+ params = util.Params( kwd, sanitize=tool.options.sanitize, tool=tool )
history = trans.get_history()
trans.ensure_valid_galaxy_session()
template, vars = tool.handle_input( trans, params.__dict__ )
diff -r 36a7ff82faf0 -r 415cc6dc8e35 tools/data_destination/epigraph.xml
--- a/tools/data_destination/epigraph.xml Fri Oct 24 12:32:32 2008 -0400
+++ b/tools/data_destination/epigraph.xml Mon Oct 27 16:03:43 2008 -0400
@@ -1,21 +1,40 @@
<?xml version="1.0"?>
-<tool name="Perform genome" id="epigraph_export">
- <description> analysis and prediction with EpiGRAPH</description>
- <redirect_url_params>GENOME=${input1.dbkey} NAME=${input1.name} INFO=${input1.info}</redirect_url_params>
- <inputs>
- <param format="bed" name="input1" type="data" label="Send this dataset to EpiGRAPH">
- <validator type="unspecified_build" />
- </param>
- <param name="REDIRECT_URL" type="hidden" value="http://epigraph.mpi-inf.mpg.de/WebGRAPH_Public_Test/faces/DataImport.jsp" />
- <param name="DATA_URL" type="baseurl" value="/datasets" />
- <param name="GALAXY_URL" type="baseurl" value="/tool_runner?tool_id=epigraph_import" />
- </inputs>
- <outputs/>
- <help>
+<tool name="Perform genome analysis" id="epigraph_export">
+ <description> and prediction with EpiGRAPH</description>
+ <redirect_url_params>GENOME=${input1.dbkey} NAME=${input1.name} INFO=${input1.info}</redirect_url_params>
+ <inputs>
+ <param format="bed" name="input1" type="data" label="Send this dataset to EpiGRAPH">
+ <validator type="unspecified_build" />
+ </param>
+ <param name="REDIRECT_URL" type="hidden" value="http://epigraph.mpi-inf.mpg.de/WebGRAPH_Public_Test/faces/DataImport.jsp" />
+ <param name="DATA_URL" type="baseurl" value="/datasets" />
+ <param name="GALAXY_URL" type="baseurl" value="/tool_runner?tool_id=epigraph_import" />
+ </inputs>
+ <outputs/>
+ <help>
+
+.. class:: warningmark
+
+After clicking the **Execute** button, you will be redirected to the EpiGRAPH website. Please be patient while the dataset is being imported. Inside EpiGRAPH, buttons are available to send the results of the EpiGRAPH analysis back to Galaxy. In addition, you can always abandon an EpiGRAPH session and return to Galaxy by directing your browser to your current Galaxy instance.
+
+-----
+
+.. class:: infomark
+
**What it does**
-This tool sends the selected dataset to EpiGRAPH for in-depth analysis and prediction.
+This tool sends the selected dataset to EpiGRAPH in order to perform an in-depth analysis with statistical and machine learning methods.
- </help>
+-----
+
+.. class:: infomark
+
+**EpiGRAPH outline**
+
+The EpiGRAPH_ web service enables biologists to uncover hidden associations in vertebrate genome and epigenome datasets. Users can upload or import sets of genomic regions and EpiGRAPH will test a wide range of attributes (including DNA sequence and structure, gene density, chromatin modifications and evolutionary conservation) for enrichment or depletion among these regions. Furthermore, EpiGRAPH learns to predictively identify genomic regions that exhibit similar properties.
+
+.. _EpiGRAPH: http://epigraph.mpi-inf.mpg.de/
+
+ </help>
</tool>
diff -r 36a7ff82faf0 -r 415cc6dc8e35 tools/data_source/biomart.xml
--- a/tools/data_source/biomart.xml Fri Oct 24 12:32:32 2008 -0400
+++ b/tools/data_source/biomart.xml Mon Oct 27 16:03:43 2008 -0400
@@ -1,5 +1,13 @@
<?xml version="1.0"?>
-<tool name="BioMart" id="biomart" tool_type="data_source">
+<!--
+ If the value of 'URL_method' is 'get', the request will consist of the value of 'URL' coming back in
+ the initial response. If value of 'URL_method' is 'post', any additional params coming back in the
+ initial response ( in addition to 'URL' ) will be encoded and appended to URL and a post will be performed.
+
+ TODO: Hack to get biomart to work - the 'add_to_URL' param can be eliminated when the Biomart team encodes URL prior to sending, meanwhile
+ everything including and beyond the first '&' is truncated from URL. They said they'll let us know when this is fixed at their end.
+-->
+<tool name="BioMart" id="biomart" tool_type="data_source" URL_method="get" add_to_URL="biomart_hack">
<description>Central server</description>
<command interpreter="python">data_source.py $output</command>
<inputs action="http://www.biomart.org/biomart/martview" check_values="false" method="get" target="_top">
diff -r 36a7ff82faf0 -r 415cc6dc8e35 tools/data_source/biomart_test.xml
--- a/tools/data_source/biomart_test.xml Fri Oct 24 12:32:32 2008 -0400
+++ b/tools/data_source/biomart_test.xml Mon Oct 27 16:03:43 2008 -0400
@@ -1,5 +1,13 @@
<?xml version="1.0"?>
-<tool name="BioMart" id="biomart" tool_type="data_source">
+<!--
+ If the value of 'URL_method' is 'get', the request will consist of the value of 'URL' coming back in
+ the initial response. If value of 'URL_method' is 'post', any additional params coming back in the
+ initial response ( in addition to 'URL' ) will be encoded and appended to URL and a post will be performed.
+
+ TODO: Hack to get biomart to work - the 'add_to_URL' param can be eliminated when the Biomart team encodes URL prior to sending, meanwhile
+ everything including and beyond the first '&' is truncated from URL. They said they'll let us know when this is fixed at their end.
+-->
+<tool name="BioMart" id="biomart_test" tool_type="data_source" URL_method="get" add_to_URL="biomart_hack">
<description>Test server</description>
<command interpreter="python">data_source.py $output</command>
<inputs action="http://test.biomart.org/biomart/martview" check_values="false" method="get" target="_top">
diff -r 36a7ff82faf0 -r 415cc6dc8e35 tools/data_source/data_source.py
--- a/tools/data_source/data_source.py Fri Oct 24 12:32:32 2008 -0400
+++ b/tools/data_source/data_source.py Mon Oct 27 16:03:43 2008 -0400
@@ -33,10 +33,20 @@
if not URL:
open( filename, 'w' ).write( "" )
stop_err( 'The remote data source application has not sent back a URL parameter in the request.' )
+ # TODO: Hack to get biomart to work - this can be eliminated when the Biomart team encodes URL prior to sending, meanwhile
+ # everything including and beyond the first '&' is truncated from URL. They said they'll let us know when this is fixed
+ # at their end.
+ add_to_URL = params.get( 'add_to_URL', None )
+ if add_to_URL:
+ URL += '&_export=1&GALAXY_URL=0'
+ URL_method = params.get( 'URL_method', None )
out = open( filename, 'w' )
CHUNK_SIZE = 2**20 # 1Mb
try:
- page = urllib.urlopen( URL, urllib.urlencode( params ) )
+ if not URL_method or URL_method == 'get':
+ page = urllib.urlopen( URL )
+ elif URL_method == 'post':
+ page = urllib.urlopen( URL, urllib.urlencode( params ) )
except:
stop_err( 'It appears that the remote data source application is currently off line. Please try again later.' )
while 1:
diff -r 36a7ff82faf0 -r 415cc6dc8e35 tools/data_source/epigraph_import.xml
--- a/tools/data_source/epigraph_import.xml Fri Oct 24 12:32:32 2008 -0400
+++ b/tools/data_source/epigraph_import.xml Mon Oct 27 16:03:43 2008 -0400
@@ -1,5 +1,10 @@
<?xml version="1.0"?>
-<tool name="EpiGRAPH" id="epigraph_import" tool_type="data_source">
+<!--
+ If the value of 'URL_method' is 'get', the request will consist of the value of 'URL' coming back in
+ the initial response. If value of 'URL_method' is 'post', any additional params coming back in the
+ initial response ( in addition to 'URL' ) will be encoded and appended to URL and a post will be performed.
+-->
+<tool name="EpiGRAPH" id="epigraph_import" tool_type="data_source" URL_method="get">
<description> server</description>
<command interpreter="python">data_source.py $output</command>
<inputs action="http://epigraph.mpi-inf.mpg.de/WebGRAPH_Public_Test/faces/Login.jsp" check_values="false" method="get">
diff -r 36a7ff82faf0 -r 415cc6dc8e35 tools/data_source/flymine.xml
--- a/tools/data_source/flymine.xml Fri Oct 24 12:32:32 2008 -0400
+++ b/tools/data_source/flymine.xml Mon Oct 27 16:03:43 2008 -0400
@@ -1,5 +1,10 @@
<?xml version="1.0"?>
-<tool name="Flymine" id="flymine" tool_type="data_source">
+<!--
+ If the value of 'URL_method' is 'get', the request will consist of the value of 'URL' coming back in
+ the initial response. If value of 'URL_method' is 'post', any additional params coming back in the
+ initial response ( in addition to 'URL' ) will be encoded and appended to URL and a post will be performed.
+-->
+<tool name="Flymine" id="flymine" tool_type="data_source" URL_method="post">
<description>server</description>
<command interpreter="python">data_source.py $output</command>
<inputs action="http://preview.flymine.org/preview/begin.do" check_values="false" method="get" target="_top">
diff -r 36a7ff82faf0 -r 415cc6dc8e35 tools/data_source/ucsc_tablebrowser.xml
--- a/tools/data_source/ucsc_tablebrowser.xml Fri Oct 24 12:32:32 2008 -0400
+++ b/tools/data_source/ucsc_tablebrowser.xml Mon Oct 27 16:03:43 2008 -0400
@@ -1,5 +1,10 @@
<?xml version="1.0"?>
-<tool name="UCSC Main" id="ucsc_table_direct1" tool_type="data_source">
+<!--
+ If the value of 'URL_method' is 'get', the request will consist of the value of 'URL' coming back in
+ the initial response. If value of 'URL_method' is 'post', any additional params coming back in the
+ initial response ( in addition to 'URL' ) will be encoded and appended to URL and a post will be performed.
+-->
+<tool name="UCSC Main" id="ucsc_table_direct1" tool_type="data_source" URL_method="post">
<description>table browser</description>
<command interpreter="python">data_source.py $output</command>
<inputs action="http://genome.ucsc.edu/cgi-bin/hgTables" check_values="false" method="get">
diff -r 36a7ff82faf0 -r 415cc6dc8e35 tools/data_source/ucsc_tablebrowser_archaea.xml
--- a/tools/data_source/ucsc_tablebrowser_archaea.xml Fri Oct 24 12:32:32 2008 -0400
+++ b/tools/data_source/ucsc_tablebrowser_archaea.xml Mon Oct 27 16:03:43 2008 -0400
@@ -1,5 +1,10 @@
<?xml version="1.0"?>
-<tool name="UCSC Archaea" id="ucsc_table_direct_archaea1" tool_type="data_source">
+<!--
+ If the value of 'URL_method' is 'get', the request will consist of the value of 'URL' coming back in
+ the initial response. If value of 'URL_method' is 'post', any additional params coming back in the
+ initial response ( in addition to 'URL' ) will be encoded and appended to URL and a post will be performed.
+-->
+<tool name="UCSC Archaea" id="ucsc_table_direct_archaea1" tool_type="data_source" URL_method="post">
<description>table browser</description>
<command interpreter="python">data_source.py $output</command>
<inputs action="http://archaea.ucsc.edu/cgi-bin/hgTables" check_values="false" method="get">
diff -r 36a7ff82faf0 -r 415cc6dc8e35 tools/data_source/ucsc_tablebrowser_test.xml
--- a/tools/data_source/ucsc_tablebrowser_test.xml Fri Oct 24 12:32:32 2008 -0400
+++ b/tools/data_source/ucsc_tablebrowser_test.xml Mon Oct 27 16:03:43 2008 -0400
@@ -1,5 +1,10 @@
<?xml version="1.0"?>
-<tool name="UCSC Test" id="ucsc_table_direct_test1" tool_type="data_source">
+<!--
+ If the value of 'URL_method' is 'get', the request will consist of the value of 'URL' coming back in
+ the initial response. If value of 'URL_method' is 'post', any additional params coming back in the
+ initial response ( in addition to 'URL' ) will be encoded and appended to URL and a post will be performed.
+-->
+<tool name="UCSC Test" id="ucsc_table_direct_test1" tool_type="data_source" URL_method="post">
<description>table browser</description>
<command interpreter="python">data_source.py $output</command>
<inputs action="http://genome-test.cse.ucsc.edu/cgi-bin/hgTables" check_values="false" method="get">