Skip to content

Commit

Permalink
Merge branch 'release/0.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
abought committed Jul 13, 2020
2 parents cd5ac71 + 78ff2c3 commit e926ce9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.3.2', # Required
version='0.3.3', # Required

# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from zorp import parsers


##
# Sample preconfigured parsers that work with the data in these test suites
# These were defined at a time before optional columns were introduced, so in practice many of our tests have the
Expand Down
12 changes: 12 additions & 0 deletions tests/test_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,18 @@ def test_parse_marker_fails_for_invalid_format(self):
with pytest.raises(exceptions.LineParseException, match='marker format'):
parser_utils.parse_marker(val, test=False)

def test_parse_marker_handles_various_formats(self):
scenarios = [
["chr1:100_A/C", ("1", "100", "A", "C")],
["1:100:A:C", ("1", "100", "A", "C")],
["chr1:100", ("1", "100", None, None)],
["1-100-A-C", ("1", "100", "A", "C")],
["1-100-A-C_AVOCADO", ("1", "100", "A", "C")],
]
for input, expected in scenarios:
result = parser_utils.parse_marker(input)
assert result == expected, "Parsed {}".format(input)

def test_pval_to_log_sidesteps_python_underflow(self):
val = '1.93e-780'
res = parser_utils.parse_pval_to_log(val, is_neg_log=False)
Expand Down
2 changes: 1 addition & 1 deletion zorp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from distutils.version import LooseVersion

__version__ = '0.3.2'
__version__ = '0.3.3'
__version_info__ = tuple(LooseVersion(__version__).version)

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion zorp/parser_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
pass


REGEX_MARKER = re.compile(r'^(?:chr)?([a-zA-Z0-9]+?):(\d+)[_:]?(\w+)?[/:|]?([^_]+)?_?(.*)?')
REGEX_MARKER = re.compile(r'^(?:chr)?([a-zA-Z0-9]+?)[_:-](\d+)[_:|-]?(\w+)?[/_:|-]?([^_]+)?_?(.*)?')
REGEX_PVAL = re.compile(r'([\d.\-]+)([\sxeE]*)([0-9\-]*)')


Expand Down

0 comments on commit e926ce9

Please sign in to comment.