mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix for dataset_metadata_in_file validator: all locally cached data files that are columnar must have columns separated by tabs characters, not white space. I've eliminated the 'split' param from the validator as it was causing problems. Extract genomic DNA tool should now finally work correctly.
This commit is contained in:
@@ -235,18 +235,17 @@ class MetadataInFileColumnValidator( Validator ):
|
||||
metadata_name = metadata_name.strip()
|
||||
metadata_column = int( elem.get( "metadata_column", 0 ) )
|
||||
message = elem.get( "message", "Value for metadata %s was not found in %s." % ( metadata_name, filename ) )
|
||||
split = elem.get( "split", None )
|
||||
line_startswith = elem.get( "line_startswith", None )
|
||||
if line_startswith:
|
||||
line_startswith = line_startswith.strip()
|
||||
return cls( filename, metadata_name, metadata_column, message, split, line_startswith )
|
||||
def __init__( self, filename, metadata_name, metadata_column, message="Value for metadata not found.", split=None, line_startswith=None ):
|
||||
return cls( filename, metadata_name, metadata_column, message, line_startswith )
|
||||
def __init__( self, filename, metadata_name, metadata_column, message="Value for metadata not found.", line_startswith=None ):
|
||||
self.metadata_name = metadata_name
|
||||
self.message = message
|
||||
self.valid_values = []
|
||||
for line in open( filename ):
|
||||
if line_startswith is None or line.startswith( line_startswith ):
|
||||
fields = line.split( split )
|
||||
fields = line.split( '\t' )
|
||||
if metadata_column < len( fields ):
|
||||
self.valid_values.append( fields[metadata_column] )
|
||||
def validate( self, value, history = None ):
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<inputs>
|
||||
<param format="interval" name="input" type="data" label="Fetch sequences corresponding to Query">
|
||||
<validator type="unspecified_build" />
|
||||
<validator type="dataset_metadata_in_file" filename="alignseq.loc" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." split="\t" line_startswith="seq" />
|
||||
<validator type="dataset_metadata_in_file" filename="alignseq.loc" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." line_startswith="seq" />
|
||||
</param>
|
||||
<param name="out_format" type="select" label="Output data type">
|
||||
<option value="fasta">FASTA</option>
|
||||
|
||||
Reference in New Issue
Block a user