aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--r_qtl/r_qtl2.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/r_qtl/r_qtl2.py b/r_qtl/r_qtl2.py
index 4f0ab2a..96776b7 100644
--- a/r_qtl/r_qtl2.py
+++ b/r_qtl/r_qtl2.py
@@ -146,7 +146,8 @@ def make_process_data_geno(cdata) -> tuple[
Callable[[str, tuple[str, ...], tuple[str, ...]],
tuple[dict, ...]]]:
"""Build functions to process genotype data."""
- def replace_genotype_codes(val):
+ def replace_genotype_codes(val):#pylint: disable=[redefined-outer-name]
+ # The rewrite will probably make this obsolete.
return cdata["genotypes"].get(val, val)
def __non_transposed__(row: dict) -> dict:
@@ -313,3 +314,7 @@ def missing_value_codes_to_none(value: str,
If 'value' is a missing value code, return `None`, otherwise return 'value'.
"""
return value if value not in nastrings else None
+
+def replace_genotype_codes(value: str, genocodes: dict):
+ """Convert genotype codes into values specified in control file."""
+ return genocodes.get(value, value)