diff options
| author | Alexander_Kabui | 2025-01-23 13:57:28 +0300 |
|---|---|---|
| committer | BonfaceKilz | 2025-02-06 12:43:15 +0300 |
| commit | 0169bd8b4ffe5cb5676e2fe2e4f0f82cdd104047 (patch) | |
| tree | 4471c970c09bcc3719132807bcafa0a23672475c | |
| parent | bdab517514d980ac4f1e5b350e5d9289f32cceb4 (diff) | |
| download | genenetwork3-0169bd8b4ffe5cb5676e2fe2e4f0f82cdd104047.tar.gz | |
feat: Add utility function to create a file if it does not exist.
| -rw-r--r-- | gn3/computations/rqtl2.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gn3/computations/rqtl2.py b/gn3/computations/rqtl2.py index bccedc0..95d8225 100644 --- a/gn3/computations/rqtl2.py +++ b/gn3/computations/rqtl2.py @@ -66,3 +66,13 @@ def compose_rqtl2_cmd(rqtl_path, input_file, rscript_path = config.get("RSCRIPT", "Rscript") return f"{rscript_path} { rqtl_path } " + " ".join( [f"--{key} {val}" for key, val in params.items()]) + + +def create_file(file_path): + """Utility function to create file given a file_path""" + try: + with open(file_path, "x",encoding="utf-8") as _file_handler: + return True, "File created at" + except FileExistsError: + return False, "File Already Exists" + |
