Skip to content

Commit

Permalink
Merge pull request #3425 from AlexsLemonade/ark/3306-sample-developme…
Browse files Browse the repository at this point in the history
…ntal-stage

Add Sample::developmental_stage field support
  • Loading branch information
arkid15r authored Oct 23, 2023
2 parents 087618e + 40e34d6 commit e34095d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
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

0 comments on commit e34095d

Please sign in to comment.