|
|
|
@ -215,20 +215,20 @@ def test_infer_normalization_map(normalization_data_frame):
@@ -215,20 +215,20 @@ def test_infer_normalization_map(normalization_data_frame):
|
|
|
|
|
assert result == {"Cy3": 25, "Cy5": 50} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_normalize_exposure(normalization_data_frame): |
|
|
|
|
def test_normalize_channel(normalization_data_frame): |
|
|
|
|
from sensospot_data.columns import COLUMN_NORMALIZATION |
|
|
|
|
from sensospot_data.normalisation import ( |
|
|
|
|
reduce_overflow, |
|
|
|
|
_normalize_exposure, |
|
|
|
|
normalize_channel, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
reduced = reduce_overflow(normalization_data_frame, "Saturation", 1) |
|
|
|
|
result = _normalize_exposure(reduced["Cy5"], 100) |
|
|
|
|
result = normalize_channel(reduced["Cy5"], 50) |
|
|
|
|
|
|
|
|
|
sorted_results = result.sort_values( |
|
|
|
|
by=["Well.Row", "Well.Column", "Pos.Id"] |
|
|
|
|
) |
|
|
|
|
expected_values = [1, 4, 15, 1, 10, 10, 10, 10, 100, 100, 100, 100] |
|
|
|
|
expected_values = [2, 8, 30, 2, 20, 20, 20, 20, 200, 200, 200, 200] |
|
|
|
|
|
|
|
|
|
for normalized_col in COLUMN_NORMALIZATION.values(): |
|
|
|
|
list(sorted_results[normalized_col]) == expected_values |
|
|
|
|