Skip to content

Commit

Permalink
debugging CI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cmatKhan committed Jan 5, 2024
1 parent 11589a3 commit c9c3b15
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 4.2.8 on 2024-01-05 00:24

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("regulatory_data", "0009_alter_fileformat_fields"),
]

operations = [
migrations.AddField(
model_name="binding",
name="condition",
field=models.CharField(
choices=[
("unknown", "unknown"),
("YPD", "YPD"),
("SM", "SM"),
("RAPA", "RAPA"),
("H2O2Hi", "H2O2Hi"),
("H2O2Lo", "H2O2Lo"),
("Acid", "Acid"),
("Alpha", "Alpha"),
("BUT14", "BUT14"),
("BUT90", "BUT90"),
("Thi-", "Thi-"),
("GAL", "GAL"),
("HEAT", "HEAT"),
("Pi-", "Pi-"),
("RAFF", "RAFF"),
],
default="unknown",
help_text="If the condition is known, it is provided. Otherwise, the value is `unknown`",
max_length=20,
),
),
]
26 changes: 25 additions & 1 deletion yeastregulatorydb/regulatory_data/models/Binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@ class Binding(BaseModel, GzipFileUploadWithIdMixin):
Store some metadata and filepaths to binding data
"""

CONDITION_CHOICES = [
("unknown", "unknown"),
("YPD", "YPD"),
("SM", "SM"),
("RAPA", "RAPA"),
("H2O2Hi", "H2O2Hi"),
("H2O2Lo", "H2O2Lo"),
("Acid", "Acid"),
("Alpha", "Alpha"),
("BUT14", "BUT14"),
("BUT90", "BUT90"),
("Thi-", "Thi-"),
("GAL", "GAL"),
("HEAT", "HEAT"),
("Pi-", "Pi-"),
("RAFF", "RAFF"),
]

regulator = models.ForeignKey(
"Regulator", on_delete=models.CASCADE, help_text="Foreign key to the Regulator table"
)
Expand All @@ -35,7 +53,13 @@ class Binding(BaseModel, GzipFileUploadWithIdMixin):
strain = models.CharField(
max_length=20,
default="unknown",
help_text="If the strain identifier is known, it is provided. " "Otherwise, the value is `unknown`",
help_text="If the strain identifier is known, it is provided. Otherwise, the value is `unknown`",
)
condition = models.CharField(
max_length=20,
default="unknown",
choices=CONDITION_CHOICES,
help_text="If the condition is known, it is provided. Otherwise, the value is `unknown`",
)
file = models.FileField(
upload_to="temp", help_text="A file which stores data on regulator/DNA interaction", blank=True, null=True
Expand Down
14 changes: 10 additions & 4 deletions yeastregulatorydb/regulatory_data/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,18 @@ def test_rank_response_task(
request.user = user

# create the promoter set record
promotersetsig_path = test_data_dict["binding"]["chipexo"]["files"][1]
assert os.path.basename(promotersetsig_path) == "28366_yiming_promoter_sig.csv.gz"
promotersetsig_path = next(
file
for file in test_data_dict["binding"]["chipexo"]["files"]
if os.path.basename(file) == "28366_yiming_promoter_sig.csv.gz"
)
assert os.path.exists(promotersetsig_path), f"path: {promotersetsig_path}"

expression_path = test_data_dict["expression"]["mcisaac"]["files"][0]
assert os.path.basename(expression_path) == "hap5_15min_mcisaac_chr1.csv.gz"
expression_path = next(
file
for file in test_data_dict["expression"]["mcisaac"]["files"]
if os.path.basename(file) == "hap5_15min_mcisaac_chr1.csv.gz"
)
assert os.path.exists(expression_path), f"path: {expression_path}"

binding_record = BindingFactory.create(source=chipexo_datasource, regulator=regulator)
Expand Down

0 comments on commit c9c3b15

Please sign in to comment.