Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sample::developmental_stage field support #3425

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/data_refinery_api/views/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class Meta:
"age",
"specimen_part",
"genetic_information",
"developmental_stage",
"disease",
"disease_stage",
"cell_line",
Expand Down Expand Up @@ -159,6 +160,7 @@ class SampleListView(generics.ListAPIView):
"age",
"specimen_part",
"genetic_information",
"developmental_stage",
"disease",
"disease_stage",
"cell_line",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.18 on 2023-10-17 22:53

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("data_refinery_common", "0073_rename_genotype_sample_genetic_information"),
]

operations = [
migrations.AddField(
model_name="sample",
name="developmental_stage",
field=models.CharField(blank=True, max_length=255),
),
]
2 changes: 2 additions & 0 deletions common/data_refinery_common/models/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def __str__(self):
age = models.DecimalField(max_length=255, blank=True, max_digits=8, decimal_places=3, null=True)
specimen_part = models.CharField(max_length=255, blank=True)
genetic_information = models.CharField(max_length=255, blank=True)
developmental_stage = models.CharField(max_length=255, blank=True)
disease = models.CharField(max_length=255, blank=True)
disease_stage = models.CharField(max_length=255, blank=True)
cell_line = models.CharField(max_length=255, blank=True)
Expand Down Expand Up @@ -126,6 +127,7 @@ def to_metadata_dict(self, computed_file=None):
metadata["refinebio_annotations"] = [
data for data in self.sampleannotation_set.all().values_list("data", flat=True)
]
metadata["refinebio_developmental_stage"] = self.developmental_stage

if computed_file and computed_file.result and computed_file.result.processor:
metadata["refinebio_processor_id"] = computed_file.result.processor.id
Expand Down
1 change: 1 addition & 0 deletions common/tests/models/test_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def test_to_metadata_dict(self):
"refinebio_annotations",
"refinebio_cell_line",
"refinebio_compound",
"refinebio_developmental_stage",
"refinebio_disease",
"refinebio_disease_stage",
"refinebio_genetic_information",
Expand Down
1 change: 1 addition & 0 deletions foreman/data_refinery_foreman/surveyor/harmony.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
`age`,
`specimen_part`,
`genetic_information`,
`developmental_stage`,
`disease`,
`disease_stage`,
`cell_line`,
Expand Down