diff --git a/README.md b/README.md index 356899a..ebe3f67 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ [![PyPI version](https://badge.fury.io/py/IsoCor.svg)](https://badge.fury.io/py/IsoCor) [![PyPI pyversions](https://img.shields.io/pypi/pyversions/isocor.svg)](https://pypi.python.org/pypi/isocor/) -[![Build Status](https://travis-ci.com/MetaSys-LISBP/IsoCor.svg?branch=master)](https://travis-ci.com/MetaSys-LISBP/IsoCor) [![Documentation Status](https://readthedocs.org/projects/isocor/badge/?version=latest)](http://isocor.readthedocs.io/?badge=latest) +[![install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/isocor/README.html) + [![IsoCor graphical user interface](https://raw.githubusercontent.com/MetaSys-LISBP/IsoCor/master/doc/_static/isocor_GUI.png)](https://isocor.readthedocs.io/en/latest/) diff --git a/isocor/__init__.py b/isocor/__init__.py index 11afbb1..233ca47 100644 --- a/isocor/__init__.py +++ b/isocor/__init__.py @@ -5,7 +5,7 @@ """ # Version number MUST be maintained here (x.y.z format) -__version__ = '2.2.2' +__version__ = '2.2.3' from isocor.mscorrectors import MetaboliteCorrectorFactory from isocor.mscorrectors import LowResMetaboliteCorrector, HighResMetaboliteCorrector diff --git a/isocor/mscorrectors.py b/isocor/mscorrectors.py index 5db947b..906215a 100644 --- a/isocor/mscorrectors.py +++ b/isocor/mscorrectors.py @@ -240,13 +240,13 @@ def _correct_with_bfgs(self, measurement): enrichment = math.fsum( p*i for i, p in enumerate(isotopologue_fraction))/self.formula[self._tracer_el] else: - isotopologue_fraction = [np.NaN for p in corrected_area] - enrichment = np.NaN + isotopologue_fraction = [np.nan for p in corrected_area] + enrichment = np.nan sum_m = math.fsum(measurement) if sum_m != 0: residuum = [v/sum_m for v in resi] else: - residuum = [np.NaN for v in resi] + residuum = [np.nan for v in resi] return corrected_area, isotopologue_fraction, residuum, enrichment def get_mass_distribution_vector(self): @@ -671,3 +671,4 @@ def compute_correction_matrix(self): else: correction_matrix = self._correctionmatrix_combination() return correction_matrix + diff --git a/isocor/tests/test_correction_process_HighRes.py b/isocor/tests/test_correction_process_HighRes.py index b368cfd..3c090da 100644 --- a/isocor/tests/test_correction_process_HighRes.py +++ b/isocor/tests/test_correction_process_HighRes.py @@ -14,6 +14,13 @@ @pytest.mark.parametrize("data", [{"formula": "C2H2", + "resolution_at_400": 1e3, + "tracer": "13C", + "v_expected": "[np.nan, np.nan, np.nan]", + "v_measured": "[0, 0, 0]", + "correct_NA_tracer": False, + "tracer_purity": [0.0, 1.0]}, + {"formula": "C2H2", "resolution_at_400": 1e3, "tracer": "13C", "v_expected": "[1., 0., 0.]", diff --git a/isocor/tests/test_correction_process_LowRes.py b/isocor/tests/test_correction_process_LowRes.py index 4eaebc0..dcee789 100644 --- a/isocor/tests/test_correction_process_LowRes.py +++ b/isocor/tests/test_correction_process_LowRes.py @@ -13,6 +13,12 @@ # Tests the entire correction process at low resolution # (here pXY represents natural abundance of isotope X of element Y) @pytest.mark.parametrize("data", [{"formula": "C2H2", + "tracer": "13C", + "v_expected": "[np.nan, np.nan, np.nan]", + "v_measured": "[0, 0, 0]", + "correct_NA_tracer": False, + "tracer_purity": [0.0, 1.0]}, + {"formula": "C2H2", "tracer": "13C", "v_expected": "[1., 0., 0.]", "v_measured": "[p1H * p1H, p1H * p2H * 2, p2H * p2H]",