Added viz hint if PES is part of reaction

This commit is contained in:
Tim Lorsbach
2026-06-19 09:32:34 +02:00
parent 297c87f4d9
commit 831496992c
6 changed files with 16 additions and 14 deletions

View File

@ -118,6 +118,9 @@ def fetch_pes(request, pes_url) -> dict:
from epauth.views import get_access_token_from_request from epauth.views import get_access_token_from_request
token = get_access_token_from_request(request) token = get_access_token_from_request(request)
if token is None:
token = pes_url.split('/')[-1] == 'dummy'
if token: if token:
for k, v in s.PES_API_MAPPING.items(): for k, v in s.PES_API_MAPPING.items():
if pes_url.startswith(k): if pes_url.startswith(k):

View File

@ -28,17 +28,6 @@ services:
image: git.envipath.com/envipath/biotransformer3:1.0 image: git.envipath.com/envipath/biotransformer3:1.0
container_name: epbiotransformer3 container_name: epbiotransformer3
# web:
# image: envipath/envipy-bayer:1.0
# container_name: epdjango
# ports:
# - "127.0.0.1:8000:8000"
# env_file:
# - .env
# command: gunicorn envipath.wsgi:application --bind 0.0.0.0:8000 --workers 3
# volumes:
# - ep_bayer_data:/opt/enviPy/
celery_worker: celery_worker:
image: git.envipath.com/envipath/envipy-bayer:1.0 image: git.envipath.com/envipath/envipy-bayer:1.0
container_name: epcelery container_name: epcelery

View File

@ -576,6 +576,10 @@ class ReactionIdentifierMixin(ExternalIdentifierMixin):
def get_uniprot_identifiers(self): def get_uniprot_identifiers(self):
return self.get_external_identifier("UniProt") return self.get_external_identifier("UniProt")
def contains_pes(self):
from bayer.models import PESStructure
return any([isinstance(o, PESStructure) for o in self.educts.all()]) or any(
[isinstance(o, PESStructure) for o in self.products.all()])
############## ##############
# EP Objects # # EP Objects #

View File

@ -82,6 +82,9 @@
<div class="collapse-content"> <div class="collapse-content">
<div class="flex justify-center">{{ edge.edge_label.as_svg|safe }}</div> <div class="flex justify-center">{{ edge.edge_label.as_svg|safe }}</div>
</div> </div>
{% if edge.edge_label.contains_pes %}
<span class='alert alert-info alert-soft'>The reaction contains a partially elucidated structure!</br>For visualization the representative structure is used. The pathway itself will show the actual partially elucidated structure.</span>
{% endif %}
</div> </div>
<!-- Reaction Description --> <!-- Reaction Description -->
@ -92,7 +95,7 @@
<div class="flex flex-wrap items-center justify-center gap-4"> <div class="flex flex-wrap items-center justify-center gap-4">
{% for educt in edge.start_nodes.all %} {% for educt in edge.start_nodes.all %}
<a href="{{ educt.url }}" class="btn btn-outline btn-sm" <a href="{{ educt.url }}" class="btn btn-outline btn-sm"
>{{ educt.name }}</a >{{ educt.get_name }}</a
> >
{% endfor %} {% endfor %}
<svg <svg
@ -112,7 +115,7 @@
</svg> </svg>
{% for product in edge.end_nodes.all %} {% for product in edge.end_nodes.all %}
<a href="{{ product.url }}" class="btn btn-outline btn-sm" <a href="{{ product.url }}" class="btn btn-outline btn-sm"
>{{ product.name }}</a >{{ product.get_name }}</a
> >
{% endfor %} {% endfor %}
</div> </div>

View File

@ -79,6 +79,9 @@
<div class="collapse-content"> <div class="collapse-content">
<div class="flex justify-center">{{ reaction.as_svg|safe }}</div> <div class="flex justify-center">{{ reaction.as_svg|safe }}</div>
</div> </div>
{% if reaction.contains_pes %}
<span class='alert alert-info alert-soft'>The reaction contains a partially elucidated structure!</br>For visualization the representative structure is used. The pathway itself will show the actual partially elucidated structure.</span>
{% endif %}
</div> </div>
<!-- Reaction Description --> <!-- Reaction Description -->

2
uv.lock generated
View File

@ -894,7 +894,7 @@ provides-extras = ["ms-login", "dev", "pepper-plugin"]
[[package]] [[package]]
name = "envipy-additional-information" name = "envipy-additional-information"
version = "0.4.2" version = "0.4.2"
source = { git = "ssh://git@git.envipath.com/enviPath/enviPy-additional-information.git?branch=develop#f2f251e0214f016760348730c45e56183d961201" } source = { git = "ssh://git@git.envipath.com/enviPath/enviPy-additional-information.git?branch=develop#ad825570480bbe2f1a35c04923fede756c450751" }
dependencies = [ dependencies = [
{ name = "pydantic" }, { name = "pydantic" },
] ]