From 99698bd4189985c3d5f2bfcc5b6a36bfcffa4f76 Mon Sep 17 00:00:00 2001 From: Donald Campbell <125581724+donaldcampbelljr@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:47:01 -0500 Subject: [PATCH] add upload_pephub cli argument https://github.com/databio/bedboss/issues/31 --- bedboss/bedboss.py | 3 +++ bedboss/bedstat/bedstat.py | 1 - bedboss/cli.py | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/bedboss/bedboss.py b/bedboss/bedboss.py index faf0ea5..bc83dd6 100644 --- a/bedboss/bedboss.py +++ b/bedboss/bedboss.py @@ -223,6 +223,7 @@ def insert_pep( no_db_commit: bool = False, force_overwrite: bool = False, upload_s3: bool = False, + upload_pephub: bool = False, pm: pypiper.PipelineManager = None, *args, **kwargs, @@ -244,6 +245,7 @@ def insert_pep( :param bool no_db_commit: whether the JSON commit to the database should be skipped :param bool force_overwrite: whether to overwrite the existing record :param bool upload_s3: whether to upload to s3 + :param bool upload_pephub: whether to push bedfiles and metadata to pephub (default: False) :param pypiper.PipelineManager pm: pypiper object :return: None """ @@ -295,6 +297,7 @@ def insert_pep( force_overwrite=force_overwrite, skip_qdrant=skip_qdrant, upload_s3=upload_s3, + upload_pephub=upload_pephub, pm=pm, ) pep.samples[i].record_identifier = bed_id diff --git a/bedboss/bedstat/bedstat.py b/bedboss/bedstat/bedstat.py index 727c0b4..4e1e1f1 100755 --- a/bedboss/bedstat/bedstat.py +++ b/bedboss/bedstat/bedstat.py @@ -59,7 +59,6 @@ def load_to_pephub( """ if is_registry_path(pep_registry_path): - parsed_pep_list = parse_registry_path(pep_registry_path) # Combine data into a dict for sending to pephub diff --git a/bedboss/cli.py b/bedboss/cli.py index 2d161ef..116f57f 100644 --- a/bedboss/cli.py +++ b/bedboss/cli.py @@ -166,6 +166,11 @@ def build_argparser() -> ArgumentParser: action="store_true", help="whether to skip qdrant indexing", ) + sub_all.add_argument( + "--upload-pephub", + action="store_true", + help="upload to pephub", + ) # all-pep sub_all_pep.add_argument( @@ -245,6 +250,11 @@ def build_argparser() -> ArgumentParser: "Before uploading you have to set up all necessury env vars: " "AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_ENDPOINT_URL. [Default: False]", ) + sub_all_pep.add_argument( + "--upload-pephub", + action="store_true", + help="upload to pephub", + ) # bed_qc sub_qc.add_argument(