diff options
| author | Frederick Muriuki Muriithi <fredmanglis@gmail.com> | 2026-09-28 12:21:44 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi <fredmanglis@gmail.com> | 2026-09-28 12:21:44 -0500 |
| commit | 6b692edffe5c5c01692a4c58cd77956faf9d825b (patch) | |
| tree | acc896cab453bf63760ae2eeac14a42cc5a7e817 /scripts/genotypes | |
| parent | c30c0924eaa5ddbb3d7fecc4c238acd832d8dd3a (diff) | |
| download | gn-uploader-6b692edffe5c5c01692a4c58cd77956faf9d825b.tar.gz | |
BugFix: Check for equality rather than membership. Update keys.
Diffstat (limited to 'scripts/genotypes')
| -rw-r--r-- | scripts/genotypes/preprocess_csv_collect_info.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/scripts/genotypes/preprocess_csv_collect_info.py b/scripts/genotypes/preprocess_csv_collect_info.py index a6671ff..0f475d5 100644 --- a/scripts/genotypes/preprocess_csv_collect_info.py +++ b/scripts/genotypes/preprocess_csv_collect_info.py @@ -25,28 +25,28 @@ def filecontents(path: Path) -> Iterator[str]: def identify_columns( - fields: tuple[str, ...], + headers: tuple[str, ...], settings: dict[str, str] ) -> FieldsIdentity: """Identify columns using settings provided by user""" _id = {} - for field in fields: - if field.lower() in settings["markers"].lower(): - _id["marker_field"] = field + for header in headers: + if header.lower() == settings["markers"].lower(): + _id["marker"] = header continue - if field.lower() in settings["chromosome"].lower(): - _id["chromosome_field"] = field + if header.lower() == settings["chromosome"].lower(): + _id["chromosome"] = header continue - if field.lower() in settings["cm"].lower(): + if header.lower() == settings["cm"].lower(): # linkage map: genetic distance - _id["centimorgan_field"] = field + _id["genetic_distance"] = header continue - if field.lower() in settings["mb"].lower(): + if header.lower() == settings["mb"].lower(): # physical map: physical distance - _id["megabases_field"] = field + _id["physical_distance"] = header continue - _id["samples_list"] = _id.get("samples_list") + (field,) + _id["samples"] = _id.get("samples", tuple()) + (header,) return FieldsIdentity(**_id) |
