Skip to content

Don't create nmdc:DataGeneration records for biosamples that already have them in repair job - #1405

Merged
sujaypatil96 merged 9 commits into
mainfrom
1402-update-generate_data_generation_set_records_from_gold_api_for_study-to-consider-existing-data_generation_set-records
Mar 30, 2026
Merged

sujaypatil96 merged 9 commits into
mainfrom
1402-update-generate_data_generation_set_records_from_gold_api_for_study-to-consider-existing-data_generation_set-records

Conversation

@sujaypatil96

@sujaypatil96 sujaypatil96 commented Mar 12, 2026 •

Copy link
Copy Markdown
Collaborator

This PR updates the generate_data_generation_set_records_from_gold_api_for_study() method in the database updater module such that it selectively makes data generation records only for those samples in a study that don't already have data generation records associated with them.

It also picks up on whether biosamples need to be associated with the data generation records (as has_input) or if we need to use processed samples (in case the biosamples have been through a pooling process).

sujaypatil96 and others added 2 commits March 12, 2026 10:33
…_filtering params

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n_set_records

Use /nmdcschema/linked_instances endpoint to check per-biosample for
existing DataGeneration records before creating new ones. This avoids
duplicate records and is more efficient than fetching all DataGeneration
records for the entire study, which can timeout for large studies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
`sequencingStrategy` (only keeping "Metagenome" or "Metatranscriptome") and associated
project `projectStatus`. When False, all biosamples are included regardless of sequencing
strategy or project status. Defaults to True.
"""

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to main logic being added in this PR. I just noticed that these params were missing documentation in the docstring so added them here.

@sujaypatil96 sujaypatil96 changed the title Skip existing DataGeneration records when generating from GOLD API Don't create nmdc:DataGeneration records for biosamples that already have them in repair job Mar 12, 2026
sujaypatil96 and others added 6 commits March 12, 2026 11:29
…data_generation_set_records_from_gold_api_for_study-to-consider-existing-data_generation_set-records
… _translate_biosample

These methods gained a required provenance_metadata parameter in a
recent update to GoldStudyTranslator. The DatabaseUpdater call sites
were not updated, causing a TypeError at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sujaypatil96
sujaypatil96 requested a review from aclum March 18, 2026 22:28
@sujaypatil96

Copy link
Copy Markdown
Collaborator Author

See #1402 (comment) for example output.

…on_for_processed_sample to RuntimeApiUserClient

These methods are needed by DatabaseUpdater.generate_data_generation_set_records_from_gold_api_for_study()
to look up existing Pooling and LibraryPreparation records via the /nmdcschema/linked_instances endpoint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sujaypatil96
sujaypatil96 merged commit 764178c into main Mar 30, 2026
2 checks passed
@sujaypatil96
sujaypatil96 deleted the 1402-update-generate_data_generation_set_records_from_gold_api_for_study-to-consider-existing-data_generation_set-records branch March 30, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update generate_data_generation_set_records_from_gold_api_for_study to consider existing data_generation_set records

2 participants