-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(streamline mutant delivery and upload) (#3916) (major)
# Description Add mutant upload api refactor delivery refactor concatenation
- Loading branch information
Showing
80 changed files
with
2,582 additions
and
941 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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 | ||
from cg.store.models import Analysis, Case | ||
|
||
|
||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from enum import Enum | ||
|
||
|
||
class DeliveryDestination(Enum): | ||
"""Enum for the DeliveryDestination | ||
BASE: Deliver to the base folder provided in the call | ||
CUSTOMER: Deliver to the customer folder on hasta | ||
FOHM: Deliver to the FOHM folder on hasta | ||
""" | ||
|
||
BASE = "base" | ||
CUSTOMER = "customer" | ||
FOHM = "fohm" | ||
|
||
|
||
class DeliveryStructure(Enum): | ||
"""Enum for the DeliveryStructure | ||
FLAT: Deliver the files in a flat structure, i.e. all files in the same folder | ||
NESTED: Deliver the files in a nested structure, i.e. files in folders for each sample/case | ||
""" | ||
|
||
FLAT: str = "flat" | ||
NESTED: str = "nested" |
Oops, something went wrong.