Skip to content

Commit

Permalink
Rename Sample::genotype to Sample::genetic_information
Browse files Browse the repository at this point in the history
  • Loading branch information
arkid15r committed Oct 12, 2023
1 parent 760fdc3 commit 12a351d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
6 changes: 3 additions & 3 deletions api/data_refinery_api/views/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Meta:
"sex",
"age",
"specimen_part",
"genotype",
"genetic_information",
"disease",
"disease_stage",
"cell_line",
Expand Down Expand Up @@ -158,7 +158,7 @@ class SampleListView(generics.ListAPIView):
"sex",
"age",
"specimen_part",
"genotype",
"genetic_information",
"disease",
"disease_stage",
"cell_line",
Expand Down Expand Up @@ -217,7 +217,7 @@ def get_queryset(self):
| Q(sex__icontains=filter_by)
| Q(age__icontains=filter_by)
| Q(specimen_part__icontains=filter_by)
| Q(genotype__icontains=filter_by)
| Q(__icontains=filter_by)
| Q(disease__icontains=filter_by)
| Q(disease_stage__icontains=filter_by)
| Q(cell_line__icontains=filter_by)
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-12 16:07

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("data_refinery_common", "0072_auto_20220927_2235"),
]

operations = [
migrations.RenameField(
model_name="sample",
old_name="genotype",
new_name="genetic_information",
),
]
2 changes: 1 addition & 1 deletion common/data_refinery_common/models/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def get_sample_metadata_fields(self):
"sex",
"age",
"specimen_part",
"genotype",
"genetic_information",
"disease",
"disease_stage",
"cell_line",
Expand Down
4 changes: 2 additions & 2 deletions common/data_refinery_common/models/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __str__(self):
sex = models.CharField(max_length=255, blank=True)
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)
genotype = models.CharField(max_length=255, blank=True)
genetic_information = 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 @@ -112,7 +112,7 @@ def to_metadata_dict(self, computed_file=None):
metadata["refinebio_sex"] = self.sex
metadata["refinebio_age"] = self.age or ""
metadata["refinebio_specimen_part"] = self.specimen_part
metadata["refinebio_genetic_information"] = self.genotype
metadata["refinebio_genetic_information"] = self.genetic_information
metadata["refinebio_disease"] = self.disease
metadata["refinebio_disease_stage"] = self.disease_stage
metadata["refinebio_cell_line"] = self.cell_line
Expand Down
8 changes: 4 additions & 4 deletions foreman/data_refinery_foreman/surveyor/harmony.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
`sex`,
`age`,
`specimen_part`,
`genotype`,
`genetic_information`,
`disease`,
`disease_stage`,
`cell_line`,
Expand Down Expand Up @@ -626,7 +626,7 @@ def __init__(self):
]
self.specimen_part_fields = create_variants(specimen_part_fields)

genotype_fields = [
genetic_information_fields = [
"strain/background",
"strain",
"strain or line",
Expand All @@ -639,7 +639,7 @@ def __init__(self):
"cultivar",
"strain/genotype",
]
self.genotype_fields = create_variants(genotype_fields)
self.genetic_information_fields = create_variants(genetic_information_fields)

disease_fields = [
"disease",
Expand Down Expand Up @@ -797,7 +797,7 @@ def harmonize_sample(self, sample_metadata: Dict, title_field: str = None) -> Di
"sex_fields",
"age_fields",
"specimen_part_fields",
"genotype_fields",
"genetic_information_fields",
"disease_fields",
"disease_stage_fields",
"cell_line_fields",
Expand Down
1 change: 1 addition & 0 deletions scripts/make_migrations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ script_directory="$(
)"
cd "$script_directory" || exit

./prepare_image.sh -i base -s common
./prepare_image.sh -i migrations -s common

. ./common.sh
Expand Down

0 comments on commit 12a351d

Please sign in to comment.