diff --git a/HISTORY.md b/HISTORY.md index b7e43cf..c423fe5 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,7 @@ +- 0.4.23a + +* fix empty stats file [#61](https://github.com/miRTop/mirtop/issues/61) by @leontienvdbent + - 0.4.22 * fix when reads map halfway on to the edge diff --git a/mirtop/gff/stats.py b/mirtop/gff/stats.py index e2d65ca..ad3e7fe 100644 --- a/mirtop/gff/stats.py +++ b/mirtop/gff/stats.py @@ -73,7 +73,7 @@ def _calc_stats(fn): cols = gff.columns attr = gff.attributes logger.debug("## STATS: attribute %s" % attr) - if ok.match(attr['Filter']): + if not ok.match(attr['Filter']): continue if "-".join([attr['UID'], attr['Variant'], attr['Name']]) in seen: continue diff --git a/setup.py b/setup.py index 6ca2a43..e7ad986 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os from setuptools import setup, find_packages -version = '0.4.22' +version = '0.4.23a' url = 'http://github.com/mirtop/mirtop' diff --git a/test/test_automated_analysis.py b/test/test_automated_analysis.py index 890ae75..7e38d4a 100644 --- a/test/test_automated_analysis.py +++ b/test/test_automated_analysis.py @@ -307,20 +307,10 @@ def test_srnaseq_stats(self): print("") print(" ".join(clcode)) subprocess.check_call(clcode) - - @attr(complete=True) - @attr(cmd_stats=True) - @attr(cmd=True) - def test_srnaseq_stats(self): - """Run stats analysis - """ - with make_workdir(): - clcode = ["mirtop", - "stats", - "../../data/examples/gff/correct_file.gff"] - print("") - print(" ".join(clcode)) - subprocess.check_call(clcode) + if not os.path.exists("test_out_mirs/mirtop_stats.txt"): + raise ValueError("File doesn't exist, something is wrong with stats cmd.") + if sum(1 for line in open('test_out_mirs/mirtop_stats.txt')) == 1: + raise ValueError("File is empty, something is wrong with stats cmd.") @attr(complete=True) @attr(cmd_merge=True)