mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fixed a weakness in sniff where all whitespace on lines were stripped, in some cases eliminating desired blank columns.
This commit is contained in:
@@ -81,7 +81,7 @@ def get_headers(fname, sep, count=30):
|
||||
"""
|
||||
headers = []
|
||||
for idx, line in enumerate(file(fname)):
|
||||
line = line.strip()
|
||||
line = line.rstrip('\n\r')
|
||||
if idx == count:
|
||||
break
|
||||
headers.append( line.split(sep) )
|
||||
@@ -105,8 +105,11 @@ def is_column_based(fname, sep='\t'):
|
||||
False
|
||||
>>> is_column_based(fname, sep=' ')
|
||||
True
|
||||
>>> fname = get_test_fname('test_ensembl.tab')
|
||||
>>> is_column_based(fname)
|
||||
True
|
||||
"""
|
||||
headers = get_headers(fname, sep=sep)
|
||||
headers = get_headers(fname, sep=sep)
|
||||
|
||||
if not headers:
|
||||
return False
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Ensembl Gene ID Ensembl Transcript ID Chicken Ensembl Gene ID Orthology Type
|
||||
ENSOANG00000013952 ENSOANT00000021996 ENSGALG00000012404 ortholog_one2one
|
||||
ENSOANG00000013954 ENSOANT00000021998 ENSGALG00000012401 ortholog_one2one
|
||||
ENSOANG00000013954 ENSOANT00000021999 ENSGALG00000012401 ortholog_one2one
|
||||
ENSOANG00000013954 ENSOANT00000022000 ENSGALG00000012401 ortholog_one2one
|
||||
ENSOANG00000013955 ENSOANT00000022001
|
||||
ENSOANG00000013955 ENSOANT00000022002
|
||||
ENSOANG00000013956 ENSOANT00000022005 ENSGALG00000012400
|
||||
Reference in New Issue
Block a user