mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Avoid exception if no match
This fixes the sniffing unit test, the datatype framework would just continue anyway.
This commit is contained in:
@@ -697,9 +697,11 @@ class BaseFastq(Sequence):
|
||||
headers = get_headers(file_prefix, sep='\n', count=4)
|
||||
if len(headers) == 4 and headers[0][0] and headers[0][0][0] == "@" and headers[2][0] and headers[2][0][0] == "+" and headers[1][0]:
|
||||
# Check the sequence line, make sure it contains only G/C/A/T/N
|
||||
start, end = cls.bases_regexp.match(headers[1][0]).span()
|
||||
if (end - start) == len(headers[1][0]):
|
||||
return True
|
||||
match = cls.bases_regexp.match(headers[1][0])
|
||||
if match:
|
||||
start, end = match.span()
|
||||
if (end - start) == len(headers[1][0]):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user