From 937e568e1957004df0f877cfcc98822350dac90a Mon Sep 17 00:00:00 2001 From: Ian Schenck Date: Tue, 27 Jan 2009 17:10:30 -0500 Subject: [PATCH] Ironed out nasty exceptions thrown on invalid genetrack outputs. Still need a way to resolve the optional 2nd output (exported intervals), and ensure the user picks at least 1 coverage dataset or 1 feature dataset. --- lib/galaxy/web/controllers/genetrack.py | 11 +++++++-- tools/visualization/genetrack.xml | 31 +++++++++++++++++-------- tools/visualization/genetrack_code.py | 1 - 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/lib/galaxy/web/controllers/genetrack.py b/lib/galaxy/web/controllers/genetrack.py index 019239d0da3..b3264b0954a 100644 --- a/lib/galaxy/web/controllers/genetrack.py +++ b/lib/galaxy/web/controllers/genetrack.py @@ -167,7 +167,10 @@ class WebRoot(BaseController): param = atlas.Param( word=word ) # search for a given - session = sql.get_session( conf.SQL_URI ) + try: + session = sql.get_session( conf.SQL_URI ) + except: + return trans.fill_template_mako('genetrack/invalid.html', dataset_id=dataset_id) if param.word: def search_query( word, text ): @@ -208,7 +211,11 @@ class WebRoot(BaseController): FIT_LABEL = "%s-SIGMA-%d" % (data.metadata.label, 20), PRED_LABEL = "PRED-%s-SIGMA-%d" % (data.metadata.label, 20), ) - session = sql.get_session( conf.SQL_URI ) + + try: + session = sql.get_session( conf.SQL_URI ) + except: + return trans.fill_template_mako('genetrack/invalid.html', dataset_id=dataset_id) if os.path.exists( conf.HDF_DATABASE ): db = hdf.hdf_open( conf.HDF_DATABASE, mode='r' ) diff --git a/tools/visualization/genetrack.xml b/tools/visualization/genetrack.xml index 8ab46560391..d48d4999953 100644 --- a/tools/visualization/genetrack.xml +++ b/tools/visualization/genetrack.xml @@ -3,8 +3,8 @@ Track creator/viewer - - + + genetrack.py -l $data_label @@ -24,14 +24,14 @@ - [a-zA-Z0-9]{0,25} + [a-zA-Z0-9]{1,25} - + - [a-zA-Z0-9]{0,25} - + [a-zA-Z0-9]{1,25} + @@ -47,16 +47,27 @@ numpy -This tool takes the input Fit Data and creates a peak and curve plot showing -the reads and fitness on each basepair. Features can be plotted below as tracks. +This tool takes the input Fit Data and creates a peak and curve plot +showing the reads and fitness on each basepair. Features can be +plotted below as tracks. Fit data is coverage output from tools like +the Lastz tool. Features are simply interval datasets that may be +plotted as tracks below the optional fit data. Both the fit data and +feature datasets are optional, but at least one of either is required +to generate a track. ----- **Syntax** - **Track Label** is the name of the generated track. -- **Fit Data** are the datasets to calculate coverage/reads across basepairs and generate a curve. -- **Features** are additional datasets (interval format) to be plotted below as tracks. + +- **Fit Data** is the dataset to calculate coverage/reads across + basepairs and generate a curve. This is optional, and tracks may + be created simply showing features. + +- **Features** are datasets (interval format) to be plotted as tracks. + These are also optional, but at least 1 feature track or 1 fit + data is required to generate a track. diff --git a/tools/visualization/genetrack_code.py b/tools/visualization/genetrack_code.py index 9c20ec27b73..b79f77b13ce 100644 --- a/tools/visualization/genetrack_code.py +++ b/tools/visualization/genetrack_code.py @@ -10,4 +10,3 @@ def exec_after_process(app, inp_data, out_data, param_dict, tool=None, stdout=No out_data['genetrack'].metadata.label = param_dict['data_label'] out_data['genetrack'].info = "Use the link below to view the custom track." out_data['bed_out'].info = "" - \ No newline at end of file