Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)

Expand Down
2 changes: 1 addition & 1 deletion isocor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions isocor/mscorrectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -671,3 +671,4 @@ def compute_correction_matrix(self):
else:
correction_matrix = self._correctionmatrix_combination()
return correction_matrix

7 changes: 7 additions & 0 deletions isocor/tests/test_correction_process_HighRes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.]",
Expand Down
6 changes: 6 additions & 0 deletions isocor/tests/test_correction_process_LowRes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down