diff --git a/nmdc_runtime/site/translation/submission_portal_translator.py b/nmdc_runtime/site/translation/submission_portal_translator.py index f6ee81a5..f53109d1 100644 --- a/nmdc_runtime/site/translation/submission_portal_translator.py +++ b/nmdc_runtime/site/translation/submission_portal_translator.py @@ -191,6 +191,20 @@ def _get_gold_study_identifiers( return [self._ensure_curie(gold_study_id, default_prefix="gold")] + def _get_jgi_study_identifiers( + self, metadata_submission: JSON_OBJECT + ) -> Union[List[str], None]: + """Construct a JGI proposal CURIE from the multiomics from data + + :param metadata_submission: submission portal entry + :return: JGI proposal CURIE + """ + jgi_study_id = get_in(["multiOmicsForm", "JGIStudyId"], metadata_submission) + if not jgi_study_id: + return None + + return [self._ensure_curie(jgi_study_id, default_prefix="jgi.proposal")] + def _get_quantity_value( self, raw_value: Optional[str], unit: Optional[str] = None ) -> Union[nmdc.QuantityValue, None]: @@ -410,9 +424,6 @@ def _translate_study( :return: nmdc:Study object """ return nmdc.Study( - alternative_identifiers=self._get_from( - metadata_submission, ["multiOmicsForm", "JGIStudyId"] - ), alternative_names=self._get_from( metadata_submission, ["multiOmicsForm", "alternativeNames"] ), @@ -436,6 +447,9 @@ def _translate_study( insdc_bioproject_identifiers=self._get_from( metadata_submission, ["multiOmicsForm", "NCBIBioProjectId"] ), + jgi_portal_study_identifiers=self._get_jgi_study_identifiers( + metadata_submission + ), name=self._get_from(metadata_submission, ["studyForm", "studyName"]), notes=self._get_from(metadata_submission, ["studyForm", "notes"]), principal_investigator=self._get_pi(metadata_submission), diff --git a/tests/test_data/test_submission_portal_translator_data.yaml b/tests/test_data/test_submission_portal_translator_data.yaml index ca8d0ef5..71c5331a 100644 --- a/tests/test_data/test_submission_portal_translator_data.yaml +++ b/tests/test_data/test_submission_portal_translator_data.yaml @@ -83,8 +83,8 @@ input: multiOmicsForm: alternativeNames: [] studyNumber: '' - GOLDStudyId: '' - JGIStudyId: '' + GOLDStudyId: 'Gs0123456' + JGIStudyId: '123456' NCBIBioProjectId: '' omicsProcessingTypes: - mg @@ -991,6 +991,10 @@ output: - Principal Investigator - Funding acquisition type: nmdc:CreditAssociation + gold_study_identifiers: + - gold:Gs0123456 + jgi_portal_study_identifiers: + - jgi.proposal:123456 --- input: metadata_submission: