Skip to content

Commit

Permalink
Specify which methods have correction vs none
Browse files Browse the repository at this point in the history
  • Loading branch information
mwlkhoo committed Nov 25, 2024
1 parent d3ae7d1 commit 690ba3a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ class_counts = np.array([
200, # misc
])

# Get parasitemia only
# Compute parasitemia without correction
parasitemia = corrector.calc_parasitemia(class_counts)

# Get parasitemia and 95% confidence bounds as parasites/uL
# Get corrected parasitemia and 95% confidence bounds as parasites/uL
parasitemia, conf_bounds = corrector.get_res_from_counts(class_counts, units_ul_out=True)

# Get parasitemia and 95% confidence bounds as percentage
# Get corrected parasitemia and 95% confidence bounds as percentage
parasitemia, conf_bounds = corrector.get_res_from_counts(class_counts, units_ul_out=False)
```

Expand Down
6 changes: 4 additions & 2 deletions stats_utils/compensator.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def _reformat_7x1_to_2x1(self, counts: npt.NDArray) -> npt.NDArray:

def calc_parasitemia(self, counts: npt.NDArray) -> float:
"""
Wrapper for base class method _calc_parasitemia()
Wrapper for base class method _calc_parasitemia(), computes parasitemia
without compensation
Reformats 7x1 array into required 2x1 array before computing statistics
Expand All @@ -176,7 +177,8 @@ def get_res_from_counts(
self, raw_counts: npt.NDArray, units_ul_out: bool = False
) -> Tuple[float, float]:
"""
Wrapper for base class method _get_res_from_counts()
Wrapper for base class method _get_res_from_counts(), returns compensated
parasitemia and corresponding 95% confidence bounds
Reformats 7x1 array into required 2x1 array before computing statistics
Expand Down
6 changes: 4 additions & 2 deletions stats_utils/deskewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def __init__(self, model_name: str):

def calc_parasitemia(self, counts: npt.NDArray) -> float:
"""
Wrapper for base class method _calc_parasitemia()
Wrapper for base class method _calc_parasitemia(), computes parasitemia
without deskewing
Input(s)
- counts:
Expand All @@ -83,7 +84,8 @@ def get_res_from_counts(
self, raw_counts: npt.NDArray, units_ul_out: bool = False
) -> Tuple[float, float]:
"""
Wrapper for base class method _get_res_from_counts()
Wrapper for base class method _get_res_from_counts(), returns deskewed
parasitemia and corresponding 95% confidence bounds
Input(s)
- counts:
Expand Down

0 comments on commit 690ba3a

Please sign in to comment.