Skip to content

Commit

Permalink
fix empty stat file
Browse files Browse the repository at this point in the history
  • Loading branch information
lpantano committed Oct 10, 2019
1 parent 7faff01 commit a45cb68
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion mirtop/gff/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
18 changes: 4 additions & 14 deletions test/test_automated_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a45cb68

Please sign in to comment.