mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Bug fix in subtract_query1, made CustomTrack.sniff() more restrictive.
This commit is contained in:
@@ -714,23 +714,16 @@ class CustomTrack ( Tabular ):
|
||||
for hdr in headers:
|
||||
if first_line:
|
||||
try:
|
||||
if hdr[0].startswith('track'):
|
||||
first_line = False
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
return False
|
||||
if hdr[0].startswith('track') and hdr[0].find('color') > -1 and hdr[0].find('visibility') > -1: first_line = False
|
||||
else: return False
|
||||
except: return False
|
||||
else:
|
||||
try:
|
||||
if not (hdr[0] == '' or hdr[0].startswith( '#' )):
|
||||
if len(hdr) < 3:
|
||||
return False
|
||||
try:
|
||||
map( int, [hdr[1], hdr[2]] )
|
||||
except:
|
||||
return False
|
||||
except:
|
||||
return False
|
||||
if hdr[0] and not hdr[0].startswith( '#' ):
|
||||
if len( hdr ) < 3: return False
|
||||
try: map( int, [hdr[1], hdr[2]] )
|
||||
except: return False
|
||||
except: return False
|
||||
return True
|
||||
|
||||
class GBrowseTrack ( Tabular ):
|
||||
|
||||
@@ -18,12 +18,16 @@ def get_lines(fname, begin_col='', end_col=''):
|
||||
i = 0
|
||||
for i, line in enumerate(file(fname)):
|
||||
line = line.rstrip('\r\n')
|
||||
if line != '' and not line.startswith('#'):
|
||||
if line and not line.startswith('#'):
|
||||
if begin_col and end_col:
|
||||
"""Both begin_col and end_col must be integers at this point."""
|
||||
line = line.split('\t')
|
||||
line = '\t'.join([line[j] for j in range(begin_col-1, end_col)])
|
||||
lines.add( line )
|
||||
try:
|
||||
line = line.split('\t')
|
||||
line = '\t'.join([line[j] for j in range(begin_col-1, end_col)])
|
||||
lines.add( line )
|
||||
except: pass
|
||||
else:
|
||||
lines.add( line )
|
||||
if i: return (i+1, lines)
|
||||
else: return (i, lines)
|
||||
|
||||
@@ -89,7 +93,7 @@ def main():
|
||||
info_msg += 'Restricted to columns c' + str(begin_col) + ' thru c' + str(end_col) + '. '
|
||||
|
||||
if diff1 > 0:
|
||||
info_msg += 'Eliminated %d duplicate/blank/comment lines from first query.' %diff1
|
||||
info_msg += 'Eliminated %d duplicate/blank/comment/invalid lines from first query.' %diff1
|
||||
|
||||
print info_msg
|
||||
|
||||
|
||||
Reference in New Issue
Block a user