From 829e1c3ecfe368f0df411790f5642a3a29a0046c Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 26 Jun 2025 08:46:29 -0500 Subject: Pass in the field separator, and comment char while reading file Pass in the field separator character to split the fields correctly. Also pass in the comment character to safely ignore any comment lines. --- scripts/load_phenotypes_to_db.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/load_phenotypes_to_db.py b/scripts/load_phenotypes_to_db.py index 8f49e10..9a2971f 100644 --- a/scripts/load_phenotypes_to_db.py +++ b/scripts/load_phenotypes_to_db.py @@ -73,7 +73,10 @@ def save_phenotypes( (dict(zip(_headers, __replace_na_strings__(line, control_data["na.strings"]))) for filecontent - in (rqtl2.read_csv_file(path) for path in phenofiles) + in (rqtl2.read_csv_file(path, + separator=control_data["sep"], + comment_char=control_data["comment.char"]) + for path in phenofiles) for idx, line in enumerate(filecontent) if idx != 0)) -- cgit v1.2.3