Merge remote-tracking branch 'upstream/release_16.10' into dev

This commit is contained in:
Dannon Baker
2017-01-11 13:29:07 -05:00
8 changed files with 39 additions and 8 deletions
+2 -2
View File
@@ -506,7 +506,7 @@ class Data( object ):
"""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, deps=None, target_context=None):
def convert_dataset(self, trans, original_dataset, target_type, return_output=False, visible=True, deps=None, target_context=None, history=None):
"""This function adds a job to the queue to convert a dataset to another type. Returns a message about success/failure."""
converter = trans.app.datatypes_registry.get_converter_by_target_type( original_dataset.ext, target_type )
@@ -529,7 +529,7 @@ class Data( object ):
params[input_name] = original_dataset
# Run converter, job is dispatched through Queue
converted_dataset = converter.execute( trans, incoming=params, set_output_hid=visible )[1]
converted_dataset = converter.execute( trans, incoming=params, set_output_hid=visible, history=history )[1]
if len(params) > 0:
trans.log_event( "Converter params: %s" % (str(params)), tool_id=converter.id )
if not visible:
+2 -2
View File
@@ -2045,7 +2045,7 @@ class DatasetInstance( object ):
depends_list = []
return dict([ (dep, self.get_converted_dataset(trans, dep)) for dep in depends_list ])
def get_converted_dataset(self, trans, target_ext, target_context=None):
def get_converted_dataset(self, trans, target_ext, target_context=None, history=None):
"""
Return converted dataset(s) if they exist, along with a dict of dependencies.
If not converted yet, do so and return None (the first time). If unconvertible, raise exception.
@@ -2084,7 +2084,7 @@ class DatasetInstance( object ):
raise NoConverterException("A dependency (%s) is missing a converter." % dependency)
except KeyError:
pass # No deps
new_dataset = next(iter(self.datatype.convert_dataset( trans, self, target_ext, return_output=True, visible=False, deps=deps, target_context=target_context ).values()))
new_dataset = next(iter(self.datatype.convert_dataset( trans, self, target_ext, return_output=True, visible=False, deps=deps, target_context=target_context, history=history ).values()))
new_dataset.name = self.name
self.copy_attributes( new_dataset )
assoc = ImplicitlyConvertedDatasetAssociation( parent=self, file_type=target_ext, dataset=new_dataset, metadata_safe=False )
+3 -3
View File
@@ -41,7 +41,7 @@ class ToolAction( object ):
class DefaultToolAction( object ):
"""Default tool action is to run an external command"""
def collect_input_datasets( self, tool, param_values, trans, current_user_roles=None ):
def _collect_input_datasets( self, tool, param_values, trans, history, current_user_roles=None ):
"""
Collect any dataset inputs from incoming. Returns a mapping from
parameter name to Dataset instance for each tool parameter that is
@@ -66,7 +66,7 @@ class DefaultToolAction( object ):
if converted_dataset:
data = converted_dataset
else:
data = data.get_converted_dataset( trans, target_ext, target_context=parent )
data = data.get_converted_dataset( trans, target_ext, target_context=parent, history=history )
if not trans.app.security_agent.can_access_dataset( current_user_roles, data.dataset ):
raise Exception( "User does not have permission to use a dataset (%s) provided for input." % data.id )
@@ -189,7 +189,7 @@ class DefaultToolAction( object ):
# input datasets can process these normally.
inp_dataset_collections = self.collect_input_dataset_collections( tool, incoming )
# Collect any input datasets from the incoming parameters
inp_data = self.collect_input_datasets( tool, incoming, trans, current_user_roles=current_user_roles )
inp_data = self._collect_input_datasets( tool, incoming, trans, history=history, current_user_roles=current_user_roles )
return history, inp_data, inp_dataset_collections
@@ -150,6 +150,7 @@ class RemoteUser( object ):
'/user/api_keys',
'/user/edit_username',
'/user/dbkeys',
'/user/logout',
'/user/toolbox_filters',
'/user/set_default_permissions',
'/user/change_communication',
@@ -1052,6 +1052,10 @@ class WorkflowController( BaseUIController, SharableMixin, UsesStoredWorkflowMix
history=history
)
else:
# If there is just one dataset name selected or one dataset collection, these
# come through as string types instead of lists. xref #3247.
dataset_names = util.listify(dataset_names)
dataset_collection_names = util.listify(dataset_collection_names)
stored_workflow = extract_workflow(
trans,
user=user,
@@ -0,0 +1,23 @@
<tool id="implicit_conversion" name="implicit_conversion">
<command>
cut -f 1 '$input1' > 'col_output'
</command>
<inputs>
<param type="data" format="tabular" name="input1" label="Input 1" />
</inputs>
<outputs>
<data name="output1" format="tabular" from_work_dir="col_output" />
</outputs>
<tests>
<!-- Test implicit conversion. -->
<test>
<param name="input1" value="1.fasta" ftype="fasta" />
<param name="col" value="1" />
<output name="output1">
<assert_contents>
<has_line line="hg17" />
</assert_contents>
</output>
</test>
</tests>
</tool>
@@ -6,7 +6,9 @@
<datatype extension="tabular" type="galaxy.datatypes.tabular:Tabular" display_in_upload="true"/>
<datatype extension="interval" type="galaxy.datatypes.interval:Interval" display_in_upload="true" description="File must start with definition line in the following format (columns may be in any order)." >
</datatype>
<datatype extension="fasta" type="galaxy.datatypes.sequence:Fasta" display_in_upload="true" />
<datatype extension="fasta" type="galaxy.datatypes.sequence:Fasta" display_in_upload="true">
<converter file="fasta_to_tabular_converter.xml" target_datatype="tabular"/>
</datatype>
<datatype extension="fastq" type="galaxy.datatypes.sequence:Fastq" display_in_upload="true" />
<datatype extension="fastqsanger" type="galaxy.datatypes.sequence:FastqSanger" display_in_upload="true" />
<datatype extension="fastqsolexa" type="galaxy.datatypes.sequence:FastqSolexa" display_in_upload="true" />
@@ -74,6 +74,7 @@
<tool file="validation_repeat.xml" />
<tool file="empty_output.xml" />
<tool file="validation_empty_dataset.xml" />
<tool file="implicit_conversion.xml" />
<tool file="identifier_single.xml" />
<tool file="identifier_multiple.xml" />
<tool file="identifier_collection.xml" />