Skip to content

Commit

Permalink
Add Sample::developmental_stage field support
Browse files Browse the repository at this point in the history
  • Loading branch information
arkid15r committed Oct 17, 2023
1 parent 517b276 commit 37dc9f0
Show file tree
Hide file tree
Showing 3 changed files with 22 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

0 comments on commit 37dc9f0

Please sign in to comment.