Skip to content

Commit

Permalink
add(FOHM and GSAID to upload API) (#4028)
Browse files Browse the repository at this point in the history
# Description

Adds GSAID and FOHM upload to mutantuploadapi
  • Loading branch information
ChrOertlin authored Dec 17, 2024
1 parent a495451 commit 9054b1b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cg/meta/upload/fohm/fohm.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,13 @@ def parse_and_write_pangolin_report(self) -> list[FohmPangolinReport]:
self.create_pangolin_report(sars_cov_pangolin_reports)
return sars_cov_pangolin_reports

def aggregate_delivery(self, cases: list[str]) -> None:
"""Aggregate and hardlink reports."""
self.set_cases_to_aggregate(cases)
def aggregate_delivery(self, case_ids: list[str]) -> None:
"""
Aggregate and hardlink reports.
args:
case_ids: The internal ids for cases to aggregate.
"""
self.set_cases_to_aggregate(case_ids)
self.create_daily_delivery_folders()
sars_cov_complementary_reports: list[FohmComplementaryReport] = (
self.parse_and_write_complementary_report()
Expand Down
8 changes: 8 additions & 0 deletions cg/meta/upload/mutant/mutant.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from click import Context

from cg.meta.upload.fohm.fohm import FOHMUploadAPI
from cg.meta.upload.gisaid import GisaidAPI
from cg.meta.upload.upload_api import UploadAPI
from cg.meta.workflow.mutant import MutantAnalysisAPI
from cg.models.cg_config import CGConfig
Expand All @@ -10,10 +12,16 @@ class MutantUploadAPI(UploadAPI):

def __init__(self, config: CGConfig):
self.analysis_api: MutantAnalysisAPI = MutantAnalysisAPI(config)
self.fohm_api = FOHMUploadAPI(config)
self.gsaid_api = GisaidAPI(config)

super().__init__(config=config, analysis_api=self.analysis_api)

def upload(self, ctx: Context, case: Case, restart: bool) -> None:
latest_analysis: Analysis = case.analyses[0]
self.update_upload_started_at(latest_analysis)
self.upload_files_to_customer_inbox(case)
self.gsaid_api.upload(case.internal_id)
self.fohm_api.aggregate_delivery(case_ids=[case.internal_id])
self.fohm_api.sync_files_sftp()
self.update_uploaded_at(latest_analysis)

0 comments on commit 9054b1b

Please sign in to comment.