diff --git a/lib/galaxy/datatypes/mothur.py b/lib/galaxy/datatypes/mothur.py index d1e016a729c..c13b7d2adc9 100644 --- a/lib/galaxy/datatypes/mothur.py +++ b/lib/galaxy/datatypes/mothur.py @@ -605,15 +605,21 @@ class Frequency(Tabular): >>> fname = get_test_fname( 'mothur_datatypetest_false.mothur.freq' ) >>> Frequency().sniff( fname ) False + + # Expression count matrix (EdgeR wrapper) + >>> fname = get_test_fname( 'mothur_datatypetest_false_2.mothur.freq' ) + >>> Frequency().sniff( fname ) + False """ headers = iter_headers(filename, sep='\t') count = 0 for line in headers: if not line[0].startswith('@'): + # first line should be # if count == 0: - # first line should be # - if not line[0].startswith('#') and len(line) == 1: + if not line[0].startswith('#') or len(line) != 1: return False + else: # all other lines should be if len(line) != 2: @@ -621,9 +627,13 @@ class Frequency(Tabular): try: int(line[0]) float(line[1]) + + if line[1].find('.') == -1: + return False except Exception: return False count += 1 + if count > 1: return True diff --git a/lib/galaxy/datatypes/test/mothur_datatypetest_false_2.mothur.freq b/lib/galaxy/datatypes/test/mothur_datatypetest_false_2.mothur.freq new file mode 100644 index 00000000000..74d16507e3a --- /dev/null +++ b/lib/galaxy/datatypes/test/mothur_datatypetest_false_2.mothur.freq @@ -0,0 +1,7 @@ +GeneID Mut1 +11287 1463 +11298 1345 +11302 5 +11303 1574 +11304 361 +11305 1762