Fix Errors reported by Cathy regarding the GMAJ tool.

With these notes:

User's can now specify the warnings that they which to report ('nowarns').  There are likely more options but they are unknown.

Using Firefox 1.5.0.12 on Ubuntu with no extensions/addons installed gives me no issues with loading the applet while Javascript is enabled or disabled (works for me).
This commit is contained in:
Daniel Blankenberg
2008-05-20 19:54:12 +00:00
parent 9ed40448e0
commit 8c5787f21d
4 changed files with 55 additions and 33 deletions
+2 -2
View File
@@ -32,7 +32,7 @@ class DefaultToolAction( object ):
if target_ext in data.get_converter_types():
assoc = data.get_associated_files_by_type( "CONVERTED_%s" % target_ext )
if assoc: data = assoc[0].dataset
else:
elif not tool.config_files:
#run converter here
assoc = trans.app.model.DatasetAssociatedFile( parent_id = data.id, file_type = "CONVERTED_%s" % target_ext, metadata_safe = False )
new_data = data.datatype.convert_dataset( trans, data, target_ext, return_output = True, visible = False ).values()[0]
@@ -40,7 +40,7 @@ class DefaultToolAction( object ):
new_data.name = data.name
assoc.dataset_id = new_data.id
data = new_data
break
break
return data
if isinstance( input, DataToolParameter ):
if isinstance( value, list ):
+14 -4
View File
@@ -1049,6 +1049,8 @@ class DataToolParameter( ToolParameter ):
assoc = data.get_associated_files_by_type( "CONVERTED_%s" % target_ext )
if assoc:
data = assoc[0].dataset
elif self.tool.config_files:
continue #dataset conversion and configuration files currently only work with datasets that have already been converted
selected = ( value and ( data in value ) )
field.add_option( "%s: (as %s) %s" % ( hid, target_ext, data.name[:30] ), data.id, selected )
break #we only report the first valid converter, assume self.extensions is a priority list
@@ -1065,7 +1067,10 @@ class DataToolParameter( ToolParameter ):
else:
field.options[-1] = a, b, True
if self.optional:
field.add_option( "Selection is Optional", 'None', True )
if not value:
field.add_option( "Selection is Optional", 'None', True )
else:
field.add_option( "Selection is Optional", 'None', False )
return field
def get_initial_value( self, trans, context ):
@@ -1079,14 +1084,21 @@ class DataToolParameter( ToolParameter ):
assert trans is not None, "DataToolParameter requires a trans"
history = trans.history
assert history is not None, "DataToolParameter requires a history"
if self.optional:
return None
history = trans.history
most_recent_dataset = [None]
filter_key = filter_value = None
if self.options:
filter_key, filter_value = self.options.get_options( trans, context )
def dataset_collector( datasets ):
def is_convertable( dataset ):
for target_ext in self.extensions:
if target_ext in data.get_converter_types():
return True
return False
for i, data in enumerate( datasets ):
if isinstance( data.datatype, self.formats) and not data.deleted and data.state not in [data.states.ERROR]:
if data.visible and not data.deleted and data.state not in [data.states.ERROR] and ( isinstance( data.datatype, self.formats) or is_convertable( data ) ):
if self.options and filter_key == 'build' and data.get_dbkey() != filter_value:
continue
most_recent_dataset[0] = data
@@ -1096,8 +1108,6 @@ class DataToolParameter( ToolParameter ):
most_recent_dataset = most_recent_dataset.pop()
if most_recent_dataset is not None:
return most_recent_dataset
elif self.optional:
return None
else:
return ''
+6 -9
View File
@@ -530,20 +530,17 @@ class RootController( BaseController ):
"""Adds a POSTed file to a History"""
try:
history = trans.app.model.History.get( history_id )
data = trans.app.model.Dataset()
data.name = name
data.extension = ext
data.dbkey = dbkey
data.info = info
data = trans.app.model.Dataset( name = name, info = info, extension = ext, dbkey = dbkey )
data.flush()
data_file = open(data.file_name, "w")
file_data.file.seek(0)
data_file.writelines(file_data.file.readlines())
data_file = open( data.file_name, "wb" )
file_data.file.seek( 0 )
data_file.write( file_data.file.read() )
data_file.close()
data.state = data.states.OK
data.init_meta()
data.set_meta()
data.flush()
history.add_dataset( data)
history.add_dataset( data )
history.flush()
data.set_peek()
data.set_size()
+33 -18
View File
@@ -3,6 +3,18 @@
<command interpreter="python">GMAJ.py $out_file1 $maf_input $gmaj_file $filenames_file</command>
<inputs>
<param name="maf_input" type="data" format="maf" label="Alignment File" optional="False"/>
<param name="nowarn" type="drill_down" display="checkbox" hierarchy="recurse" multiple="true" label="Choose Warnings to suppress" separator=" ">
<options>
<option name="All" value="all" selected="True">
<option name="seqname_mismatch" value="seqname_mismatch"/>
<option name="bed_blocks" value="bed_blocks"/>
<option name="bed_thick" value="bed_thick"/>
<option name="bed_name" value="bed_name"/>
<option name="repeat_type_missing" value="repeat_type_missing"/>
<option name="bed_name_prefix" value="bed_name_prefix"/>
</option>
</options>
</param>
<repeat name="annotations" title="Annotations">
<param name="species" type="select" label="Species of Annotation" multiple="False">
<options>
@@ -10,11 +22,11 @@
</options>
</param>
<param name="chromosome" label="Chromosome" value="" type="text"/>
<param name="exons_file" type="data" format="bed" label="Exons File" optional="True"/>
<param name="highlights_file" type="data" format="bed" label="Highlights File" optional="True"/>
<param name="underlays_file" type="data" format="bed" label="Underlays File" optional="True"/>
<param name="repeats_file" type="data" format="bed" label="Repeats File" optional="True"/>
<param name="links_file" type="data" format="bed" label="Links File" optional="True"/>
<param name="exons_file" type="data" format="bed,gff" label="Exons File" optional="True"/>
<param name="highlights_file" type="data" format="bed,gff" label="Highlights File" optional="True"/>
<param name="underlays_file" type="data" format="bed,gff" label="Underlays File" optional="True"/>
<param name="repeats_file" type="data" format="bed,gff" label="Repeats File" optional="True"/>
<param name="links_file" type="data" format="bed,gff" label="Links File" optional="True"/>
<param name="offset" label="Offset" value="0" type="integer"/>
</repeat>
</inputs>
@@ -24,29 +36,32 @@
title = "Galaxy: $maf_input.name"
alignfile = input.maf
refseq = any
tabext = .bed
tabext = .bed .gff .gtf
#if $nowarn.value:
nowarn = $nowarn
#end if
#for $seq_count, $annotation in $enumerate( $annotations ):
seq ${seq_count}:
#if $annotation['chromosome']:
#if $annotation['chromosome'].value:
seqname = $annotation['species'].$annotation['chromosome']
#else:
seqname = $annotation['species']
#end if
#if $annotation['exons_file'].value:
exons = ${seq_count}.exons.bed
exons = ${seq_count}.exons.${annotation['exons_file'].extension}
#end if
#if $annotation['repeats_file'].value:
exons = ${seq_count}.repeats.bed
repeats = ${seq_count}.repeats.${annotation['repeats_file'].extension}
#end if
#if $annotation['links_file'].value:
exons = ${seq_count}.links.bed
links = ${seq_count}.links.${annotation['links_file'].extension}
#end if
#if $annotation['underlays_file'].value:
exons = ${seq_count}.underlays.bed
underlays = ${seq_count}.underlays.${annotation['underlays_file'].extension}
#end if
#if $annotation['highlights_file'].value:
exons = ${seq_count}.highlights.bed
highlights = ${seq_count}.highlights.${annotation['highlights_file'].extension}
#end if
offset = $annotation['offset']
@@ -55,19 +70,19 @@ offset = $annotation['offset']
<configfile name="filenames_file">
#for $seq_count, $annotation in $enumerate( $annotations ):
#if $annotation['exons_file'].value:
$annotation['exons_file'] = ${seq_count}.exons.bed
$annotation['exons_file'] = ${seq_count}.exons.${annotation['exons_file'].extension}
#end if
#if $annotation['repeats_file'].value:
$annotation['repeats_file'] = ${seq_count}.repeats.bed
$annotation['repeats_file'] = ${seq_count}.repeats.${annotation['repeats_file'].extension}
#end if
#if $annotation['links_file'].value:
$annotation['links_file'] = ${seq_count}.links.bed
$annotation['links_file'] = ${seq_count}.links.${annotation['links_file'].extension}
#end if
#if $annotation['underlays_file'].value:
$annotation['underlays_file'] = ${seq_count}.underlays.bed
$annotation['underlays_file'] = ${seq_count}.underlays.${annotation['underlays_file'].extension}
#end if
#if $annotation['highlights_file'].value:
$annotation['highlights_file'] = ${seq_count}.highlights.bed
$annotation['highlights_file'] = ${seq_count}.highlights.${annotation['highlights_file'].extension}
#end if
#end for
</configfile>
@@ -76,7 +91,7 @@ $annotation['highlights_file'] = ${seq_count}.highlights.bed
<data name="out_file1" format="gmaj.zip"/>
</outputs>
<help>
You can use this tool to view a set of MAF alignments. You may also include optional additional information about the primary organism in the BED format.
You can use this tool to view a set of MAF alignments. You may also include optional annotation data for one or more of the organisms.
For detailed information on GMAJ, click here_.