Hi, 

for some strange gff files i get the following error:

Traceback (most recent call last):
  File
"/media/data/web/galaxy-central/lib/galaxy/jobs/runners/local.py", line
149, in run_job
    job_wrapper.finish( stdout, stderr, exit_code )
  File "/media/data/web/galaxy-central/lib/galaxy/jobs/__init__.py",
line 373, in finish
    dataset.datatype.set_meta( dataset, overwrite = False ) #call
datatype.set_meta directly for the initial set_meta call during dataset
creation
  File
"/media/data/web/galaxy-central/lib/galaxy/datatypes/interval.py", line
829, in set_meta
    if valid_start and valid_end and start < end and strand in
self.valid_gff3_strand and phase in self.valid_gff3_phase:
UnboundLocalError: local variable 'start' referenced before assignment


start and end are not defined when elems[3] and elems[4] are '.'
Attached is a patch that should fix it.

Cheers,
Bjoern

diff -r 9207ba35fa0c lib/galaxy/datatypes/interval.py
--- a/lib/galaxy/datatypes/interval.py	Sun Sep 09 18:24:51 2012 -0400
+++ b/lib/galaxy/datatypes/interval.py	Wed Sep 26 23:52:02 2012 +0200
@@ -808,22 +808,25 @@
         for i, line in enumerate( file ( dataset.file_name ) ):
             line = line.rstrip('\r\n')
             if line and not line.startswith( '#' ):
                 elems = line.split( '\t' )
                 valid_start = False
                 valid_end = False
                 if len( elems ) == 9:
                     try:
                         start = int( elems[3] )
-                        valid_start = True                                    
+                        valid_start = True
                     except:
                         if elems[3] == '.':
-                            valid_start = True                                        
+                            valid_start = True
+                            start = 0
                     try:
                         end = int( elems[4] )
                         valid_end = True
                     except:
                         if elems[4] == '.':
                             valid_end = True
+                            end = 0
                     strand = elems[6]
                     phase = elems[7]
                     if valid_start and valid_end and start < end and strand in self.valid_gff3_strand and phase in self.valid_gff3_phase:
___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/

Reply via email to