aboutsummaryrefslogtreecommitdiff
path: root/scripts/rqtl2/install_genotypes.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-10-24 15:57:27 -0500
committerFrederick Muriuki Muriithi2024-10-24 15:58:13 -0500
commit6fb2834489888937842d761cbbc7c2992a4f5a0d (patch)
treea2d4d76c563a9bf1a057016daa880c65a833631e /scripts/rqtl2/install_genotypes.py
parenta52401e7191850c4a6542da1af5f2b2769312871 (diff)
downloadgn-uploader-6fb2834489888937842d761cbbc7c2992a4f5a0d.tar.gz
Parse entire namespace object rather than individual values.
Diffstat (limited to 'scripts/rqtl2/install_genotypes.py')
-rw-r--r--scripts/rqtl2/install_genotypes.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/rqtl2/install_genotypes.py b/scripts/rqtl2/install_genotypes.py
index abc3f07..20a19da 100644
--- a/scripts/rqtl2/install_genotypes.py
+++ b/scripts/rqtl2/install_genotypes.py
@@ -1,7 +1,7 @@
"""Load genotypes from R/qtl2 bundle into the database."""
import sys
+import argparse
import traceback
-from pathlib import Path
from zipfile import ZipFile
from functools import reduce
from typing import Iterator, Optional
@@ -187,13 +187,12 @@ def cross_reference_genotypes(
def install_genotypes(#pylint: disable=[too-many-arguments, too-many-locals]
dbconn: mdb.Connection,
- speciesid: int,
- populationid: int,
- datasetid: int,
- rqtl2bundle: Path,
+ args: argparse.Namespace,
logger: Logger = getLogger(__name__)
) -> int:
"""Load any existing genotypes into the database."""
+ (speciesid, populationid, datasetid, rqtl2bundle) = (
+ args.speciesid, args.populationid, args.datasetid, args.rqtl2bundle)
count = 0
with ZipFile(str(rqtl2bundle.absolute()), "r") as zfile:
try: