From 7816f90bbfd5775f31e762e033f41ea5d7438b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9r=C3=A9nice=20Batut?= Date: Tue, 9 Apr 2019 16:19:00 +0200 Subject: [PATCH] Relax the 1st line sniffing for mtx (not only real coordinate) --- lib/galaxy/datatypes/tabular.py | 4 +++- lib/galaxy/datatypes/test/3.mtx | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 lib/galaxy/datatypes/test/3.mtx diff --git a/lib/galaxy/datatypes/tabular.py b/lib/galaxy/datatypes/tabular.py index b7940d34f4b..1d04a03a4a6 100644 --- a/lib/galaxy/datatypes/tabular.py +++ b/lib/galaxy/datatypes/tabular.py @@ -1193,6 +1193,8 @@ class MatrixMarket(TabularData): True >>> MatrixMarket().sniff( get_test_fname( '2.mtx' ) ) True + >>> MatrixMarket().sniff( get_test_fname( '3.mtx' ) ) + True """ file_ext = "mtx" @@ -1200,7 +1202,7 @@ class MatrixMarket(TabularData): super(MatrixMarket, self).__init__(**kwd) def sniff_prefix(self, file_prefix): - return file_prefix.startswith('%%MatrixMarket matrix coordinate real general') + return file_prefix.startswith('%%MatrixMarket matrix coordinate') def set_meta(self, dataset, overwrite=True, skip=None, max_data_lines=5, **kwd): if dataset.has_data(): diff --git a/lib/galaxy/datatypes/test/3.mtx b/lib/galaxy/datatypes/test/3.mtx new file mode 100644 index 00000000000..cc785471635 --- /dev/null +++ b/lib/galaxy/datatypes/test/3.mtx @@ -0,0 +1,15 @@ +%%MatrixMarket matrix coordinate integer general +% +343 12 12 +201 1 1 +123 2 1 +283 3 1 +318 4 1 +175 5 1 +12 6 1 +132 7 1 +197 8 1 +222 9 1 +236 10 1 +317 11 1 +127 12 1