Add a prototype of Sample::developmental_stage backfill script#3461
Draft
arkid15r wants to merge 1 commit into
Draft
Add a prototype of Sample::developmental_stage backfill script#3461arkid15r wants to merge 1 commit into
arkid15r wants to merge 1 commit into
Conversation
davidsmejia
reviewed
Jan 30, 2024
Contributor
davidsmejia
left a comment
There was a problem hiding this comment.
Looking good, a couple comments about approach.
Looking forward, I think that we will want to update the _apply_harmonized_metadata_to_sample to specifically handle updates vs new samples. This depends on what the science team says is appropriate.
|
|
||
| # Auxiliary field for tracking latest metadata update time. | ||
| # Originally added to support Sample::developmental_stage values backfilling. | ||
| last_refreshed = models.DateTimeField(auto_now=True, null=True) |
Contributor
There was a problem hiding this comment.
- We will probably want
last_refreshedon Experiment as well, since a sample could belong to more than one experiment. - We probably want to add
last_refresh_failureas a timestamp on both as well to help with re-running
| logger.info(f"Refreshing metadata for a sample {sample.accession_code}") | ||
| try: | ||
| _, sample_metadata = SraSurveyor.gather_all_metadata(sample.accession_code) | ||
| SraSurveyor._apply_harmonized_metadata_to_sample(sample_metadata) |
Contributor
There was a problem hiding this comment.
This takes sample as the first argument
Contributor
There was a problem hiding this comment.
One more consideration here is that after updating the sample we will want to update the cached values on experiment.
ie:
refinebio/foreman/data_refinery_foreman/surveyor/external_source.py
Lines 207 to 211 in 07d3759
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Number
#3438
Purpose/Implementation Notes
This is a draft/prototype of a Foreman command to use for
Sample::developmental_stagebackfill process. The code is untested and supports SRA source DB only.Types of changes
What types of changes does your code introduce?
Checklist