diff options
| author | Alexander_Kabui | 2025-01-23 15:55:39 +0300 |
|---|---|---|
| committer | BonfaceKilz | 2025-02-06 12:43:15 +0300 |
| commit | 5ccdccc2243e781565d996e157e9d6405a70697b (patch) | |
| tree | f4bafb96deed901dc46b79421cbc70a3322be4b8 /gn3/computations/rqtl2.py | |
| parent | 0bdf80ee7d319869b0057f30712f69a312435815 (diff) | |
| download | genenetwork3-5ccdccc2243e781565d996e157e9d6405a70697b.tar.gz | |
refactor: Add file_path to output only if it is created.
Diffstat (limited to 'gn3/computations/rqtl2.py')
| -rw-r--r-- | gn3/computations/rqtl2.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gn3/computations/rqtl2.py b/gn3/computations/rqtl2.py index 17e77d6..c64ca08 100644 --- a/gn3/computations/rqtl2.py +++ b/gn3/computations/rqtl2.py @@ -21,7 +21,8 @@ def generate_rqtl2_files(data, workspace_dir): for file_name, data_key in file_to_name_map.items(): if data_key in data: file_path = write_to_csv(workspace_dir, f"{file_name}.csv", data[data_key]) - parsed_files[file_name] = file_path + if file_path: + parsed_files[file_name] = file_path return {**data, **parsed_files} @@ -31,7 +32,7 @@ def write_to_csv(work_dir, file_name, data:list[dict], if headers is not provided use the keys for first boject. """ if not data: - return + return "" if headers is None: headers = data[0].keys() file_path = os.path.join(work_dir, file_name) |
