From 2a3c96e3f24282bc9f6a37dad06d68a2000c29a5 Mon Sep 17 00:00:00 2001 From: Kanwei Li Date: Mon, 21 Sep 2009 20:13:20 -0400 Subject: [PATCH] prepare for new trackster --- .hgignore | 3 +++ .../converters/wiggle_to_array_tree_converter.py | 2 +- lib/galaxy/datatypes/data.py | 2 +- lib/galaxy/datatypes/registry.py | 16 ++++++++-------- lib/galaxy/web/controllers/tracks.py | 6 +++--- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.hgignore b/.hgignore index f852fab5694..7187248f261 100644 --- a/.hgignore +++ b/.hgignore @@ -27,3 +27,6 @@ run_functional_tests.html # Project files *.kpf + +# Chrom len files +*.len diff --git a/lib/galaxy/datatypes/converters/wiggle_to_array_tree_converter.py b/lib/galaxy/datatypes/converters/wiggle_to_array_tree_converter.py index 1f254d731c7..1c1426aab80 100644 --- a/lib/galaxy/datatypes/converters/wiggle_to_array_tree_converter.py +++ b/lib/galaxy/datatypes/converters/wiggle_to_array_tree_converter.py @@ -3,7 +3,7 @@ from __future__ import division import sys - +from galaxy import eggs import pkg_resources; pkg_resources.require( "bx-python" ) from bx.arrays.array_tree import * from bx.arrays.wiggle import IntervalReader diff --git a/lib/galaxy/datatypes/data.py b/lib/galaxy/datatypes/data.py index a921b8c0b0e..80cb80b4b88 100644 --- a/lib/galaxy/datatypes/data.py +++ b/lib/galaxy/datatypes/data.py @@ -223,7 +223,7 @@ class Data( object ): """Returns available converters by type for this dataset""" return datatypes_registry.get_converters_by_datatype(original_dataset.ext) def find_conversion_destination( self, dataset, accepted_formats, datatypes_registry, **kwd ): - """Returns ( target_ext, exisiting converted dataset )""" + """Returns ( target_ext, existing converted dataset )""" return datatypes_registry.find_conversion_destination_for_dataset_by_extensions( dataset, accepted_formats, **kwd ) def convert_dataset(self, trans, original_dataset, target_type, return_output = False, visible = True ): """This function adds a job to the queue to convert a dataset to another type. Returns a message about success/failure.""" diff --git a/lib/galaxy/datatypes/registry.py b/lib/galaxy/datatypes/registry.py index 0c2af51e0c4..9083b7f1d49 100644 --- a/lib/galaxy/datatypes/registry.py +++ b/lib/galaxy/datatypes/registry.py @@ -211,7 +211,7 @@ class Registry( object ): except KeyError: #datatype was never declared mimetype = 'application/octet-stream' - self.log.warning('unkown mimetype in data factory %s' % ext) + self.log.warning('unknown mimetype in data factory %s' % ext) return mimetype def get_datatype_by_extension(self, ext ): @@ -265,10 +265,10 @@ class Registry( object ): tool_xml_text = """ - - $__SET_EXTERNAL_METADATA_COMMAND_LINE__ + + $__SET_EXTERNAL_METADATA_COMMAND_LINE__ - + @@ -326,7 +326,7 @@ class Registry( object ): return None def find_conversion_destination_for_dataset_by_extensions( self, dataset, accepted_formats, converter_safe = True ): - """Returns ( target_ext, exisiting converted dataset )""" + """Returns ( target_ext, existing converted dataset )""" for convert_ext in self.get_converters_by_datatype( dataset.ext ): if isinstance( self.get_datatype_by_extension( convert_ext ), accepted_formats ): datasets = dataset.get_converted_files_by_type( convert_ext ) @@ -347,12 +347,12 @@ class Registry( object ): rval = {} for ext, d_type in self.datatypes_by_extension.iteritems(): inputs = [] - for meta_name, meta_spec in d_type.metadata_spec.iteritems(): - if meta_spec.set_in_upload: + for meta_name, meta_spec in d_type.metadata_spec.iteritems(): + if meta_spec.set_in_upload: help_txt = meta_spec.desc if not help_txt or help_txt == meta_name: help_txt = "" - inputs.append( '' % ( meta_name, meta_name, meta_spec.default, help_txt ) ) + inputs.append( '' % ( meta_name, meta_name, meta_spec.default, help_txt ) ) rval[ ext ] = "\n".join( inputs ) if 'auto' not in rval and 'txt' in rval: #need to manually add 'auto' datatype rval[ 'auto' ] = rval[ 'txt' ] diff --git a/lib/galaxy/web/controllers/tracks.py b/lib/galaxy/web/controllers/tracks.py index d5eee98df0a..d754bd2ef4e 100644 --- a/lib/galaxy/web/controllers/tracks.py +++ b/lib/galaxy/web/controllers/tracks.py @@ -33,7 +33,7 @@ messages = Bunch( ) # Dataset type required for each track type. This needs to be more flexible, -# there might be mutliple types of indexes that suffice for a given track type. +# there might be multiple types of indexes that suffice for a given track type. track_type_to_dataset_type = { "line": "array_tree" } @@ -158,7 +158,7 @@ class TracksController( BaseController ): converted_dataset_type = track_type_to_dataset_type[track_type] converted_dataset = self.__dataset_as_type( trans, dataset, converted_dataset_type ) # If at this point we still don't have an `array_tree_dataset`, there - # is now way we can display this data as an array tree + # is no way we can display this data as an array tree if converted_dataset is None: return messages.NO_DATA # Need to check states again for the converted version @@ -186,7 +186,7 @@ class TracksController( BaseController ): return dataset # See if we can convert the dataset if type not in dataset.get_converter_types(): - log.debug( "Conversion from '%s' to '%d' not possible", dataset.extension, type ) + log.debug( "Conversion from '%s' to '%s' not possible", dataset.extension, type ) return None # See if converted dataset already exists converted_datasets = dataset.get_converted_files_by_type( type )