about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/genotypes/preprocess_csv_collect_info.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/genotypes/preprocess_csv_collect_info.py b/scripts/genotypes/preprocess_csv_collect_info.py
index 6eb6cbc..06e7abd 100644
--- a/scripts/genotypes/preprocess_csv_collect_info.py
+++ b/scripts/genotypes/preprocess_csv_collect_info.py
@@ -69,10 +69,21 @@ def identify_columns(
 
 def process_transposed(
         line: tuple[str, ...],
-        na_strings: tuple[str, ...]
+        settings: dict,
 ) -> TransposedLineDetails:
     """Process a line in a transposed file."""
-    raise NotImplementedError("Please implement this!")
+    return TransposedLineDetails(
+        line_content=line,
+        geno_symbols=tuple(set(
+            line[1:] if line[0] not in (
+                settings["markers"],
+                settings["chromosome"],
+                settings["cm"],
+                settings["mb"])
+            else tuple())),
+        line_header=line[0],
+        errors=tuple(),
+        is_markers_line=line[0]==settings["markers"])
 
 
 def process_untransposed(
@@ -178,9 +189,7 @@ def file_statistics(filepath: Path, fileconfigs: dict) -> FileStats:
             continue# skip headers line
 
         if fileconfigs["transposed"]:
-            t_line_dets = process_transposed(
-                line,
-                na_strings=fileconfigs["na_strings"])
+            t_line_dets = process_transposed(line, fileconfigs)
             headers = headers + (t_line_dets.line_header,)
             genosymbols.update(t_line_dets.geno_symbols)
             _errors = _errors + tuple(t_line_dets.errors)