diff options
| author | Frederick Muriuki Muriithi <fredmanglis@gmail.com> | 2026-10-15 14:48:42 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi <fredmanglis@gmail.com> | 2026-10-15 14:48:42 -0500 |
| commit | 4eccd83d853e87e04a89a43e41e186ac4de4156e (patch) | |
| tree | 5e51f24548ee2486dfa2acde07fc6e85b43a26e1 /scripts | |
| parent | ef45d22628bd06c0282bd586206bc3494773f132 (diff) | |
| download | gn-uploader-4eccd83d853e87e04a89a43e41e186ac4de4156e.tar.gz | |
Bugfix: Previously comparing str to tuple.
Split the line in order to compare with tuple of headers.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/genotypes/preprocess_csv_collect_info.py | 8 |
1 files changed, 5 insertions, 3 deletions
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 |
