mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
prepare for new trackster
This commit is contained in:
@@ -27,3 +27,6 @@ run_functional_tests.html
|
||||
|
||||
# Project files
|
||||
*.kpf
|
||||
|
||||
# Chrom len files
|
||||
*.len
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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."""
|
||||
|
||||
@@ -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 = """
|
||||
<tool id="__SET_METADATA__" name="Set External Metadata" version="1.0.0" tool_type="set_metadata">
|
||||
<type class="SetMetadataTool" module="galaxy.tools"/>
|
||||
<action module="galaxy.tools.actions.metadata" class="SetMetadataToolAction"/>
|
||||
<command>$__SET_EXTERNAL_METADATA_COMMAND_LINE__</command>
|
||||
<action module="galaxy.tools.actions.metadata" class="SetMetadataToolAction"/>
|
||||
<command>$__SET_EXTERNAL_METADATA_COMMAND_LINE__</command>
|
||||
<inputs>
|
||||
<param format="data" name="input1" type="data" label="File to set metadata on."/>
|
||||
<param format="data" name="input1" type="data" label="File to set metadata on."/>
|
||||
<param name="__ORIGINAL_DATASET_STATE__" type="hidden" value=""/>
|
||||
<param name="__SET_EXTERNAL_METADATA_COMMAND_LINE__" type="hidden" value=""/>
|
||||
</inputs>
|
||||
@@ -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( '<param type="text" name="%s" label="Set metadata value for "%s"" value="%s" help="%s"/>' % ( meta_name, meta_name, meta_spec.default, help_txt ) )
|
||||
inputs.append( '<param type="text" name="%s" label="Set metadata value for "%s"" value="%s" help="%s"/>' % ( 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' ]
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user