From 4eccd83d853e87e04a89a43e41e186ac4de4156e Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 15 Oct 2026 14:48:42 -0500 Subject: Bugfix: Previously comparing str to tuple. Split the line in order to compare with tuple of headers. --- scripts/genotypes/preprocess_csv_collect_info.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts/genotypes') diff --git a/scripts/genotypes/preprocess_csv_collect_info.py b/scripts/genotypes/preprocess_csv_collect_info.py index 2f687c4..c52ad15 100644 --- a/scripts/genotypes/preprocess_csv_collect_info.py +++ b/scripts/genotypes/preprocess_csv_collect_info.py @@ -175,12 +175,14 @@ def compute_statistics(filepath: Path, fileconfigs: dict) -> FileStats: or is_comment_line(line) or is_dot_geno_line(line))) basic_stats = os.stat(filepath) + line_splitter = lambda line: tuple( + field.strip() for field in line.split(fileconfigs["separator"])) + is_skippable_line = lambda line: (is_blank_line(line) or is_comment_line(line) or is_dot_geno_line(line) - or line == headers) - line_splitter = lambda line: tuple( - field.strip() for field in line.split(fileconfigs["separator"])) + or line_splitter(line) == headers) + lines = read_text_file(filepath) return (file_stats_multiprocessing(headers, is_skippable_line, line_splitter, lines) if (basic_stats.st_size/(1024*1024)) >= FILE_SIZE_THRESHOLD -- cgit 1.4.1