diff --git a/lib/galaxy/config/sample/datatypes_conf.xml.sample b/lib/galaxy/config/sample/datatypes_conf.xml.sample
index 6ab652435950..f0f96237e80b 100644
--- a/lib/galaxy/config/sample/datatypes_conf.xml.sample
+++ b/lib/galaxy/config/sample/datatypes_conf.xml.sample
@@ -32,7 +32,7 @@
-
+
diff --git a/lib/galaxy/datatypes/sequence.py b/lib/galaxy/datatypes/sequence.py
index 4e4982bb07a4..3aae50344d3e 100644
--- a/lib/galaxy/datatypes/sequence.py
+++ b/lib/galaxy/datatypes/sequence.py
@@ -1205,10 +1205,13 @@ def sniff_prefix(self, file_prefix: FilePrefix) -> bool:
>>> fname = get_test_fname( 'alignment.lav' )
>>> Axt().sniff( fname )
False
+ >>> fname = get_test_fname( '2.chain' )
+ >>> Axt().sniff( fname )
+ False
"""
headers = get_headers(file_prefix, None, count=4, comment_designator="#")
if not (
- len(headers) == 4
+ len(headers) >= 3
and len(headers[0]) == 9
and headers[0][0].isdigit()
and headers[0][2].isdigit()
@@ -1219,9 +1222,11 @@ def sniff_prefix(self, file_prefix: FilePrefix) -> bool:
and headers[0][8].isdigit()
and len(headers[1]) == 1
and len(headers[2]) == 1
- and headers[3] == []
):
return False
+ # the optional fourth non-comment line has to be empty
+ if len(headers) == 4 and not headers[3] == []:
+ return False
else:
return True
diff --git a/lib/galaxy/datatypes/test/2.chain b/lib/galaxy/datatypes/test/2.chain
new file mode 100644
index 000000000000..822a4ff7b052
--- /dev/null
+++ b/lib/galaxy/datatypes/test/2.chain
@@ -0,0 +1,10 @@
+##matrix=axtChain 16 91,-114,-31,-123,-114,100,-125,-31,-31,-125,100,-114,-123,-31,-114,91
+##gapPenalties=axtChain O=400 E=30
+chain 67224 chr22 50818468 + 26560645 26561468 chr19 61431566 - 54838449 54839272 1
+823
+
+chain 48985 chr22 50818468 + 26560497 26561116 chr19 61431566 + 29160089 29160708 2
+619
+
+chain 46902 chr22 50818468 + 19792341 19793000 chr19 61431566 + 59180700 59181359 3
+659