Skip to content

Commit

Permalink
Merge pull request #144 from ProteinsWebTeam/dev
Browse files Browse the repository at this point in the history
InterPro v100.0
  • Loading branch information
gustavo-salazar authored May 24, 2024
2 parents 15e9200 + 0bd0a61 commit 7c156f4
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ selenium==4.9.0
django-debug-toolbar~=3.2
ipdb==0.13.9
coveralls==3.3.1
tqdm==4.64.0
tqdm==4.66.3
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Django==3.2.24
djangorestframework==3.13.1
PyYAML==6.0
jsonfield2==4.0.0.post0
pymysql==1.0.2
pymysql==1.1.1
django-cors-headers~=3.10
gunicorn==20.1.0
gunicorn==22.0.0
django-redis==5.2.0
redis==4.4.4
requests~=2.27
23 changes: 23 additions & 0 deletions webfront/migrations/0031_strain_assembly_nullable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2.23 on 2024-05-14 20:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('webfront', '0030_num_proteins'),
]

operations = [
migrations.AlterField(
model_name='proteome',
name='assembly',
field=models.CharField(max_length=512, null=True),
),
migrations.AlterField(
model_name='proteome',
name='strain',
field=models.CharField(max_length=512, null=True),
),
]
18 changes: 18 additions & 0 deletions webfront/migrations/0032_entry_is_updated_llm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.23 on 2024-05-14 20:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('webfront', '0031_strain_assembly_nullable'),
]

operations = [
migrations.AddField(
model_name='entry',
name='is_updated_llm',
field=models.BooleanField(default=False),
),
]
5 changes: 3 additions & 2 deletions webfront/models/interpro_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Entry(models.Model):
set_info = JSONField(null=True)
is_llm = models.BooleanField(default=False)
is_reviewed_llm = models.BooleanField(default=False)
is_updated_llm = models.BooleanField(default=False)
representative_structure = JSONField(null=True)


Expand Down Expand Up @@ -250,8 +251,8 @@ class Proteome(models.Model):
accession = models.CharField(max_length=20, primary_key=True)
name = models.CharField(max_length=512)
is_reference = models.BooleanField(default=False)
strain = models.CharField(max_length=512)
assembly = models.CharField(max_length=512)
strain = models.CharField(max_length=512, null=True)
assembly = models.CharField(max_length=512, null=True)
taxonomy = models.ForeignKey(
"Taxonomy", on_delete=models.SET_NULL, null=True, blank=True
)
Expand Down
1 change: 1 addition & 0 deletions webfront/serializers/interpro.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ def to_metadata_representation(instance, searcher, queryset_manager, counters=No
),
"is_llm": instance.is_llm,
"is_reviewed_llm": instance.is_reviewed_llm,
"is_updated_llm": instance.is_updated_llm,
"representative_structure": instance.representative_structure,
}
return obj
Expand Down
55 changes: 46 additions & 9 deletions webfront/tests/fixtures_entry.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@
}
],
"description": [
"The piwi domain [[cite:PUB00020128]] is a protein domain found in piwi proteins and a large number of related nucleic acid-binding proteins, especially those that bind and cleave RNA. The function of the domain is double stranded-RNA-guided hydrolysis of single stranded-RNA, as has been determined in the argonaute family of related proteins [[cite:PUB00018283]]."
{
"text": "The piwi domain [[cite:PUB00020128]] is a protein domain found in piwi proteins and a large number of related nucleic acid-binding proteins, especially those that bind and cleave RNA. The function of the domain is double stranded-RNA-guided hydrolysis of single stranded-RNA, as has been determined in the argonaute family of related proteins [[cite:PUB00018283]].",
"llm": true,
"checked": true
}
],
"wikipedia": {},
"literature": {
Expand Down Expand Up @@ -137,6 +141,7 @@
"interactions": null,
"is_llm": true,
"is_reviewed_llm": true,
"is_updated_llm": true,
"representative_structure": {
"accession": "1jm7",
"name": "the name of 1jm7"
Expand Down Expand Up @@ -231,7 +236,11 @@
}
],
"description": [
"The qiwi domain "
{
"text": "The qiwi domain",
"llm": false,
"checked": false
}
],
"wikipedia": {},
"literature": {},
Expand Down Expand Up @@ -301,7 +310,11 @@
"member_databases": null,
"integrated": "IPR003165",
"description": [
"This domain is found in the protein Piwi and its relatives. The function of this domain is the dsRNA guided hydrolysis of ssRNA. Determination of the crystal structure of Argonaute reveals that PIWI is an RNase H domain, and identifies Argonaute as Slicer, the enzyme that cleaves mRNA in the RNAi RISC complex [[cite:PUB00020128]]. In addition, Mg+2 dependence and production of 3'-OH and 5' phosphate products are shared characteristics of RNaseH and RISC. The PIWI domain core has a tertiary structure belonging to the RNase H family of enzymes. RNase H fold proteins all have a five-stranded mixed beta-sheet surrounded by helices. By analogy to RNase H enzymes which cleave single-stranded RNA guided by the DNA strand in an RNA/DNA hybrid, the PIWI domain can be inferred to cleave single-stranded RNA, for example mRNA, guided by double stranded siRNA."
{
"text": "This domain is found in the protein Piwi and its relatives. The function of this domain is the dsRNA guided hydrolysis of ssRNA. Determination of the crystal structure of Argonaute reveals that PIWI is an RNase H domain, and identifies Argonaute as Slicer, the enzyme that cleaves mRNA in the RNAi RISC complex [[cite:PUB00020128]]. In addition, Mg+2 dependence and production of 3'-OH and 5' phosphate products are shared characteristics of RNaseH and RISC. The PIWI domain core has a tertiary structure belonging to the RNase H family of enzymes. RNase H fold proteins all have a five-stranded mixed beta-sheet surrounded by helices. By analogy to RNase H enzymes which cleave single-stranded RNA guided by the DNA strand in an RNA/DNA hybrid, the PIWI domain can be inferred to cleave single-stranded RNA, for example mRNA, guided by double stranded siRNA.",
"llm": false,
"checked": false
}
],
"wikipedia": {"title": "Piwi"},
"literature": {
Expand Down Expand Up @@ -410,7 +423,11 @@
"member_databases": null,
"integrated": "IPR003165",
"description": [
"This domain is found in the protein Piwi and its relatives. The function of this domain is the dsRNA guided hydrolysis of ssRNA. Determination of the crystal structure of Argonaute reveals that PIWI is an RNase H domain, and identifies Argonaute as Slicer, the enzyme that cleaves mRNA in the RNAi RISC complex [[cite:PUB00020128]]. In addition, Mg+2 dependence and production of 3'-OH and 5' phosphate products are shared characteristics of RNaseH and RISC. The PIWI domain core has a tertiary structure belonging to the RNase H family of enzymes. RNase H fold proteins all have a five-stranded mixed beta-sheet surrounded by helices. By analogy to RNase H enzymes which cleave single-stranded RNA guided by the DNA strand in an RNA/DNA hybrid, the PIWI domain can be inferred to cleave single-stranded RNA, for example mRNA, guided by double stranded siRNA."
{
"text": "This domain is found in the protein Piwi and its relatives. The function of this domain is the dsRNA guided hydrolysis of ssRNA. Determination of the crystal structure of Argonaute reveals that PIWI is an RNase H domain, and identifies Argonaute as Slicer, the enzyme that cleaves mRNA in the RNAi RISC complex [[cite:PUB00020128]]. In addition, Mg+2 dependence and production of 3'-OH and 5' phosphate products are shared characteristics of RNaseH and RISC. The PIWI domain core has a tertiary structure belonging to the RNase H family of enzymes. RNase H fold proteins all have a five-stranded mixed beta-sheet surrounded by helices. By analogy to RNase H enzymes which cleave single-stranded RNA guided by the DNA strand in an RNA/DNA hybrid, the PIWI domain can be inferred to cleave single-stranded RNA, for example mRNA, guided by double stranded siRNA.",
"llm": false,
"checked": false
}
],
"wikipedia": {"title": "Piwi"},
"literature": {},
Expand Down Expand Up @@ -440,7 +457,11 @@
"member_databases": null,
"integrated": "IPR003165",
"description": [
"The Piwi box (or Sting domain) is an about 40 to 80 amino-acid conserved region, which was first identified in the C-terminal part of Drosophila Piwi and Sting proteins, and of related proteins from human, Caenorhabditis elegans, Arabidopsis thaliana, fission yeast and Dictyostelium discoideum."
{
"text": "The Piwi box (or Sting domain) is an about 40 to 80 amino-acid conserved region, which was first identified in the C-terminal part of Drosophila Piwi and Sting proteins, and of related proteins from human, Caenorhabditis elegans, Arabidopsis thaliana, fission yeast and Dictyostelium discoideum.",
"llm": false,
"checked": false
}
],
"wikipedia": {"title": "Piwi"},
"literature": {},
Expand Down Expand Up @@ -535,7 +556,11 @@
"member_databases": null,
"integrated": null,
"description": [
"The myelin sheath is a multi-layered membrane, unique to the nervous system, that functions as an insulator to greatly increase the velocity of axonal impulse conduction."
{
"text": "The myelin sheath is a multi-layered membrane, unique to the nervous system, that functions as an insulator to greatly increase the velocity of axonal impulse conduction.",
"llm": false,
"checked": false
}
],
"wikipedia": null,
"literature": {},
Expand Down Expand Up @@ -565,7 +590,11 @@
"member_databases": null,
"integrated": null,
"description": [
"Heat shock hsp20 proteins family profile."
{
"text": "Heat shock hsp20 proteins family profile.",
"llm": false,
"checked": false
}
],
"wikipedia": null,
"literature": {},
Expand Down Expand Up @@ -685,7 +714,11 @@
"member_databases": null,
"integrated": null,
"description": [
"two-component response regulator."
{
"text": "two-component response regulator.",
"llm": false,
"checked": false
}
],
"wikipedia": null,
"literature": {},
Expand Down Expand Up @@ -716,7 +749,11 @@
"member_databases": null,
"integrated": "PTHR43214",
"description": [
"nitrate/nitrite response regulator protein narl."
{
"text": "nitrate/nitrite response regulator protein narl.",
"llm": false,
"checked": false
}
],
"wikipedia": null,
"literature": {},
Expand Down
2 changes: 1 addition & 1 deletion webfront/tests/fixtures_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def get_fixtures(self):
+ " "
+ self.entries[e]["type"]
+ " "
+ (" ".join(self.entries[e]["description"])),
+ (" ".join(d["text"] for d in self.entries[e]["description"])),
"protein_acc": p,
"protein_db": self.proteins[p]["source_database"],
"protein_af_score": 0.5 if self.proteins[p]["in_alphafold"] else -1,
Expand Down
7 changes: 6 additions & 1 deletion webfront/tests/tests_entry_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def _check_llm_flags(obj):
self.assertIn("extra_fields", obj.keys())
self.assertIn("is_llm", obj["extra_fields"])
self.assertIn("is_reviewed_llm", obj["extra_fields"])
self.assertIn("is_updated_llm", obj["extra_fields"])
# the only entry in the fixtures with these values as true
is_llm = obj["metadata"]["accession"] == "IPR003165"
self.assertEqual(
Expand All @@ -62,9 +63,13 @@ def _check_llm_flags(obj):
obj["extra_fields"]["is_reviewed_llm"],
is_llm,
)
self.assertEqual(
obj["extra_fields"]["is_updated_llm"],
is_llm,
)

response = self.client.get(
"/api/entry/interpro?extra_fields=is_llm,is_reviewed_llm"
"/api/entry/interpro?extra_fields=is_llm,is_reviewed_llm,is_updated_llm"
)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self._check_is_list_of_objects_with_key(
Expand Down

0 comments on commit 7c156f4

Please sign in to comment.