details: http://www.bx.psu.edu/hg/galaxy/rev/0126990119e9 changeset: 3287:0126990119e9 user: Dan Blankenberg <dan@bx.psu.edu> date: Wed Jan 27 16:33:49 2010 -0500 description: Fixes for GeneTrack. TODO: HDF indexes are handled in a fragile way: GeneTrack should accept an explicit filename for the index instead of using dataset_name.hdf. diffstat: eggs.ini | 4 ++-- lib/galaxy/datatypes/tracks.py | 2 +- tools/visualization/genetrack_indexer.py | 15 +++++++++++++-- tools/visualization/genetrack_indexer.xml | 2 +- tools/visualization/genetrack_peak_prediction.xml | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) diffs (86 lines): diff -r 57e5f8e4d341 -r 0126990119e9 eggs.ini --- a/eggs.ini Wed Jan 27 16:09:14 2010 -0500 +++ b/eggs.ini Wed Jan 27 16:33:49 2010 -0500 @@ -61,7 +61,7 @@ MySQL_python = _5.0.67_static python_lzo = _static bx_python = _dev_3b9d30e47619 -GeneTrack = _dev_e380f21c704218622155b9d230a44b3c9c452524 +GeneTrack = _dev_86867fc7bf46680cfafbb0749be8410b749c5593 SQLAlchemy = _dev_r6498 ; nose = .dev_r7156749efc58 @@ -84,7 +84,7 @@ decorator = http://pypi.python.org/packages/source/d/decorator/decorator-3.1.2.tar.gz docutils = http://downloads.sourceforge.net/docutils/docutils-0.4.tar.gz elementtree = http://effbot.org/downloads/elementtree-1.2.6-20050316.tar.gz -GeneTrack = http://github.com/ialbert/genetrack-central/tarball/e380f21c704218622155b9d2... +GeneTrack = http://github.com/ialbert/genetrack-central/tarball/86867fc7bf46680cfafbb074... lrucache = http://evan.prodromou.name/lrucache/lrucache-0.2.tar.gz Mako = http://www.makotemplates.org/downloads/Mako-0.2.5.tar.gz nose = http://pypi.python.org/packages/source/n/nose/nose-0.11.1.tar.gz diff -r 57e5f8e4d341 -r 0126990119e9 lib/galaxy/datatypes/tracks.py --- a/lib/galaxy/datatypes/tracks.py Wed Jan 27 16:09:14 2010 -0500 +++ b/lib/galaxy/datatypes/tracks.py Wed Jan 27 16:33:49 2010 -0500 @@ -30,7 +30,7 @@ if hda.has_data: # Get the disk file name and data id file_name = hda.dataset.get_file_name() - data_id = hda.dataset.id + data_id = hda.id # Make it secure hashkey = hmac_new( app.config.tool_secret, file_name ) encoded = binascii.hexlify( file_name ) diff -r 57e5f8e4d341 -r 0126990119e9 tools/visualization/genetrack_indexer.py --- a/tools/visualization/genetrack_indexer.py Wed Jan 27 16:09:14 2010 -0500 +++ b/tools/visualization/genetrack_indexer.py Wed Jan 27 16:33:49 2010 -0500 @@ -6,7 +6,7 @@ usage: %prog input output shift """ -import sys +import sys, shutil, os from galaxy import eggs import pkg_resources pkg_resources.require( "GeneTrack" ) @@ -36,4 +36,15 @@ sys.exit(-1) else: tabs2genetrack.transform(inpname=options.inpname, outname=options.outname,\ - format=options.format, shift=options.shift, index=options.index) + format=options.format, shift=options.shift, index=options.index, options=options) + + #HACK ALERT + #output created in job working directory has a different name than the final destination. + #GeneTrack uses dataset_name.hdf for indexes + #This will fix the different name problem, but this is not a secure solution + #This is Exceptionally Fragile as any change to the way that temporary output names are created could break + #GeneTrack should allow explicit definition of the index file, not filename.hdf + if options.workdir and os.path.isdir( options.workdir ): + for filename in os.listdir( options.workdir ): + if filename.endswith( '.dat.hdf' ) and filename.startswith( 'galaxy_dataset_' ): + shutil.move( os.path.join( options.workdir, filename ), os.path.join( options.workdir, filename[ len( 'galaxy_' ): ] ) ) diff -r 57e5f8e4d341 -r 0126990119e9 tools/visualization/genetrack_indexer.xml --- a/tools/visualization/genetrack_indexer.xml Wed Jan 27 16:09:14 2010 -0500 +++ b/tools/visualization/genetrack_indexer.xml Wed Jan 27 16:33:49 2010 -0500 @@ -3,7 +3,7 @@ <description> - creates a visualization from a bed file</description> <command interpreter="python"> - genetrack_indexer.py -i $input -o $output -s $shift -v 0 -f BED -x + genetrack_indexer.py -i $input -o $output -s $shift -v 0 -f BED -x -w $output.files_path </command> <inputs> diff -r 57e5f8e4d341 -r 0126990119e9 tools/visualization/genetrack_peak_prediction.xml --- a/tools/visualization/genetrack_peak_prediction.xml Wed Jan 27 16:09:14 2010 -0500 +++ b/tools/visualization/genetrack_peak_prediction.xml Wed Jan 27 16:33:49 2010 -0500 @@ -3,7 +3,7 @@ <description> - generates peak predictions from an index file</description> <command interpreter="python"> - genetrack_peak_prediction.py -i $input -o $output --level=$level --sigma=$sigma --mode=$mode --exclusion=$exclusion --strand=$strand -v 0 + genetrack_peak_prediction.py -i $input -o $output --level=$level --sigma=$sigma --mode=$mode --exclusion=$exclusion --strand=$strand -v 0 -w $input.extra_files_path </command> <inputs>