From e449cd9636119ba9eba253358d28d067ab89cb17 Mon Sep 17 00:00:00 2001 From: Sujay Patil Date: Tue, 11 Mar 2025 16:16:50 -0700 Subject: [PATCH] pass SP's and AP's to GoldStudyTranslator call in biosample stitcher job --- nmdc_runtime/site/repair/database_updater.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nmdc_runtime/site/repair/database_updater.py b/nmdc_runtime/site/repair/database_updater.py index 7ea7bc55..36a82732 100644 --- a/nmdc_runtime/site/repair/database_updater.py +++ b/nmdc_runtime/site/repair/database_updater.py @@ -199,8 +199,20 @@ def generate_biosample_set_from_gold_api_for_study(self) -> nmdc.Database: if gbs.get("biosampleGoldId") not in nmdc_gold_ids ] + # use the GOLD study id to fetch all sequencing project records associated with the study + gold_sequencing_projects_for_study = ( + self.gold_api_client.fetch_projects_by_study(gold_study_id) + ) + + # use the GOLD study id to fetch all analysis project records associated with the study + gold_analysis_projects_for_study = ( + self.gold_api_client.fetch_analysis_projects_by_study(gold_study_id) + ) + gold_study_translator = GoldStudyTranslator( biosamples=missing_gold_biosamples, + projects=gold_sequencing_projects_for_study, + analysis_projects=gold_analysis_projects_for_study, gold_nmdc_instrument_map_df=self.gold_nmdc_instrument_map_df, )