forked from enviPath/enviPy
Compare commits
3 Commits
297c87f4d9
...
c4067cb11e
| Author | SHA1 | Date | |
|---|---|---|---|
| c4067cb11e | |||
| a2761dcaaf | |||
| 831496992c |
@ -118,6 +118,9 @@ def fetch_pes(request, pes_url) -> dict:
|
||||
from epauth.views import get_access_token_from_request
|
||||
token = get_access_token_from_request(request)
|
||||
|
||||
if token is None:
|
||||
token = pes_url.split('/')[-1] == 'dummy'
|
||||
|
||||
if token:
|
||||
for k, v in s.PES_API_MAPPING.items():
|
||||
if pes_url.startswith(k):
|
||||
|
||||
@ -28,17 +28,6 @@ services:
|
||||
image: git.envipath.com/envipath/biotransformer3:1.0
|
||||
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:
|
||||
image: git.envipath.com/envipath/envipy-bayer:1.0
|
||||
container_name: epcelery
|
||||
|
||||
@ -576,6 +576,10 @@ class ReactionIdentifierMixin(ExternalIdentifierMixin):
|
||||
def get_uniprot_identifiers(self):
|
||||
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 #
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
x-data="{
|
||||
isSubmitting: false,
|
||||
reactionImageUrl: '',
|
||||
pes: false,
|
||||
|
||||
reset() {
|
||||
this.isSubmitting = false;
|
||||
@ -15,20 +16,30 @@
|
||||
const substratesSelect = document.getElementById('add_pathway_edge_substrates');
|
||||
const productsSelect = document.getElementById('add_pathway_edge_products');
|
||||
|
||||
const pesLinks = [];
|
||||
|
||||
const substrates = [];
|
||||
for (const option of substratesSelect.selectedOptions) {
|
||||
substrates.push(option.dataset.smiles);
|
||||
if (option.dataset.pes === 'true') {
|
||||
pesLinks.push(option.dataset.pes);
|
||||
}
|
||||
}
|
||||
|
||||
const products = [];
|
||||
for (const option of productsSelect.selectedOptions) {
|
||||
products.push(option.dataset.smiles);
|
||||
if (option.dataset.pes === 'true') {
|
||||
pesLinks.push(option.dataset.pes);
|
||||
}
|
||||
}
|
||||
|
||||
if (substrates.length > 0 && products.length > 0) {
|
||||
const reaction = substrates.join('.') + '>>' + products.join('.');
|
||||
this.reactionImageUrl = '{% url "depict" %}?smirks=' + encodeURIComponent(reaction);
|
||||
this.pes = pesLinks.length > 0;
|
||||
} else {
|
||||
this.pes = false;
|
||||
this.reactionImageUrl = '';
|
||||
}
|
||||
},
|
||||
@ -106,6 +117,7 @@
|
||||
{% for n in pathway.nodes %}
|
||||
<option
|
||||
data-smiles="{{ n.default_node_label.smiles }}"
|
||||
data-pes="{% if n.default_node_label.pes_link %}true{% else %}false{% endif %}"
|
||||
value="{{ n.url }}"
|
||||
>
|
||||
{{ n.default_node_label.name|safe }}
|
||||
@ -132,6 +144,7 @@
|
||||
{% for n in pathway.nodes %}
|
||||
<option
|
||||
data-smiles="{{ n.default_node_label.smiles }}"
|
||||
data-pes="{% if n.default_node_label.pes_link %}true{% else %}false{% endif %}"
|
||||
value="{{ n.url }}"
|
||||
>
|
||||
{{ n.default_node_label.name|safe }}
|
||||
@ -144,6 +157,9 @@
|
||||
|
||||
<div class="mb-3" x-show="reactionImageUrl" x-cloak>
|
||||
<img :src="reactionImageUrl" class="w-full" alt="Reaction preview" />
|
||||
<div x-show="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>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -82,6 +82,9 @@
|
||||
<div class="collapse-content">
|
||||
<div class="flex justify-center">{{ edge.edge_label.as_svg|safe }}</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>
|
||||
|
||||
<!-- Reaction Description -->
|
||||
@ -92,7 +95,7 @@
|
||||
<div class="flex flex-wrap items-center justify-center gap-4">
|
||||
{% for educt in edge.start_nodes.all %}
|
||||
<a href="{{ educt.url }}" class="btn btn-outline btn-sm"
|
||||
>{{ educt.name }}</a
|
||||
>{{ educt.get_name }}</a
|
||||
>
|
||||
{% endfor %}
|
||||
<svg
|
||||
@ -112,7 +115,7 @@
|
||||
</svg>
|
||||
{% for product in edge.end_nodes.all %}
|
||||
<a href="{{ product.url }}" class="btn btn-outline btn-sm"
|
||||
>{{ product.name }}</a
|
||||
>{{ product.get_name }}</a
|
||||
>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
@ -56,7 +56,7 @@
|
||||
<ul class="menu bg-base-200 rounded-box">
|
||||
{% for um in group.user_member.all %}
|
||||
<li>
|
||||
<a href="{% if not user.is_superuser %}{{ um.url }}{% else %}{{ "#" }}{% endif %}" class="hover:bg-base-300"
|
||||
<a href="{% if user.is_superuser %}{{ um.url }}{% else %}{{ "#" }}{% endif %}" class="hover:bg-base-300"
|
||||
>{{ um.username }}
|
||||
{% if not um.is_active %}<i>(inactive)</i>{% endif %}</a
|
||||
>
|
||||
|
||||
@ -79,6 +79,9 @@
|
||||
<div class="collapse-content">
|
||||
<div class="flex justify-center">{{ reaction.as_svg|safe }}</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>
|
||||
|
||||
<!-- Reaction Description -->
|
||||
|
||||
2
uv.lock
generated
2
uv.lock
generated
@ -894,7 +894,7 @@ provides-extras = ["ms-login", "dev", "pepper-plugin"]
|
||||
[[package]]
|
||||
name = "envipy-additional-information"
|
||||
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 = [
|
||||
{ name = "pydantic" },
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user