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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only these two projects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wasade Per Se Jin, those are the only two projects we anticipate processing fecal samples for in the near future. Sample observations will be associated with other projects on an as-needed/as-appropriate basis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, but the
sample_observations
table doesn't exist on production so there are no observations. And, it looks like there is no guarantee thatproject_id
is correctly associated to the sample (seemicrosetta-private-api/microsetta_private_api/db/patches/0141.sql
Lines 23 to 24 in 233e89c
project_barcode
table. That could lead to a scenario where there are two "truths"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't done a deploy since we added
sample_observations
.Are you referring to the fact that a barcode can belong to multiple projects, and could therefore be associated with zero, one, or two-plus projects for which we have associated sample observations? If so, we took the view that, if a barcode is associated with at least one project for which we have associated sample observations, those observations will be available to note at the time of scanning in the wet lab.
If that's not what you're referring to, then I'm unclear on the second point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But doesn't that mean there are no observations (i.e.,
SELECT observation_id FROM barcodes.sample_observations
is the empty set), therefore the patch isn't necessary?For multiple truths: our ground truth for barcode <-> project association is the
project_barcode
table, which relates a barcode to a project. Thesample_observation_project_associations
allows for associating anobservation_id
with aproject_id
without an enforced constraint that the implicitly associated barcode is associated to the project. Does that make sense?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch 141 inserts values into the
barcodes.sample_observations
table and associates them with project ID 1 via thebarcodes.sample_observation_project_associations
table. This patch (142 at the time I'm writing this) uses the same records inbarcodes.sample_observations
that patch 141 created and associates them with more project IDs.It makes sense in a technical sense but I'm unclear on why it's relevant to this patch. The
barcodes.sample_observation_project_associations
doesn't associate anything with barcodes, nor does it intend to. It makes a set of observations available on the Scan Barcode page when a barcode associated with one of those project is scanned. If the sample being scanned meets one of the observations, the wet lab tech will then select it as a means of recording notable aspects of a given sample so that, in the future, we can refine both wet lab SOPs and the online tools that are used to handle sample ingestion.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I see now, thanks!