Commit 4c19f646 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

factorize row construction of cavities and sub cavities

parent ded0cb6d
{% load customtags %}
{% load humanize %}
<tr XXXid="cavity_{{ cavity.id }}"
{%if near_cavity %}
class="collapse out collapseme{{ chaincount }}_{{ cavcount }}"
style="background-color:rgb({{ score|get_color }})"
{%else%}
class="table-light"
{%endif%}>
<th class="zui-sticky-col text-nowrap">
{%if not near_cavity %}
<i class="far fa-plus-square" style="cursor: pointer;" data-toggle="collapse" data-target=".collapseme{{ chaincount }}_{{ cavcount }}"
onclick="loadNearCavityRows($('.asnyc-construction[data-cavity-id={{ cavity.id }}]:not(loading)'));"></i>
{%endif%}
<a {%if score %} title="{{ score|floatformat:3|intcomma }}" {%endif%}
target="_blank"
rel="noopener noreferrer"
href="{% url 'cavities' %}?pdbsearch={{ cavity.chain.pdb.code }}">{{ cavity.chain.pdb.code }}</a>
/
<span class="dropdown">
<div class="dropbtn" data-toggle="dropdown" title="uniprot: {{ cavity.chain.protein.uniprot_id }}">
{{ cavity.chain.pdb_chain_id }} | {{ cavity.chain.protein.short_name }}
</div>
<div class="dropdown-content">
<a target="_blank" rel="noopener noreferrer" href="{% url 'cavities' %}?uniprotid={{ cavity.chain.protein.uniprot_id }}">Query UniprotID in pockets</a>
<a target="_blank" rel="noopener noreferrer" href="{% url 'compound_list' %}?uniprot_id={{ cavity.chain.protein.uniprot_id }}">Query UniprotID as iPPI-DB target</a>
</div>
</span>
/
<span class="dropdown">
<div class="dropbtn" data-toggle="dropdown">
{{ cavity.cavity_number }}
</div>
<div class="dropdown-content">
<a target="_blank" rel="noopener noreferrer" href="{% url 'networks' %}?search={{ cavity|build_name }}"> Query pocket in pocketome</a>
</div>
</span>
::
{% if cavity.partner.ligand %}
<span class="dropdown">
<div class="dropbtn" data-toggle="dropdown" title="smiles: {{ cavity.partner.ligand.canonical_smile }}">
{{ cavity.partner.ligand.pdb_ligand_id }}_{{ cavity.partner.ligand.supplementary_id }}
</div>
<div class="dropdown-content">
<a target="_blank" rel="noopener noreferrer" href="{% url 'cavities' %}?ligandcode={{ cavity.partner.ligand.pdb_ligand_id }}">Query ligand ID in pockets</a>
<a target="_blank" rel="noopener noreferrer" href="{% url 'compound_list' %}?similar_to=ECFP4:{{ cavity.partner.ligand.canonical_smile|urlencode }}">Query SMILES in iPPI-DB compounds</a>
</div>
</span>
{% else %}
<span class="dropdown">
<div class="dropbtn" data-toggle="dropdown" title="uniprot: {{ cavity.partner.chain.protein.uniprot_id }}">
{{ cavity.partner.chain.pdb_chain_id }} | {{ cavity.partner.chain.protein.short_name }}
</div>
<div class="dropdown-content">
<a target="_blank" rel="noopener noreferrer" href="{% url 'cavities' %}?uniprotid={{ cavity.partner.chain.protein.uniprot_id }}">Query UniprotID in pockets</a>
<a target="_blank" rel="noopener noreferrer" href="{% url 'compound_list' %}?uniprot_id={{ cavity.partner.chain.protein.uniprot_id }}">Query UniprotID as iPPI-DB target</a>
</div>
</span>
{% endif %}
</th>
<td>{% if cavity.partner.ligand %}PL{% else %}HD{% endif %}</td>
<td>{{ cavity.volume|floatformat:0 }}</td>
<td>{{ cavity.npr1|floatformat:2 }}</td>
<td>{{ cavity.npr2|floatformat:2 }}</td>
<td>{{ cavity.asphericity|floatformat:2 }}</td>
<td>{{ cavity.eccentricity|floatformat:2 }}</td>
<td>{{ cavity.rgyr|floatformat:2 }}</td>
<td>{{ cavity.spherocityindex|floatformat:2 }}</td>
<td>{{ cavity.ca|floatformat:1 }}</td>
<td>{{ cavity.cz|floatformat:1 }}</td>
<td>{{ cavity.n|floatformat:1 }}</td>
<td>{{ cavity.o|floatformat:1 }}</td>
<td>{{ cavity.og|floatformat:1 }}</td>
<td>{{ cavity.nz|floatformat:1 }}</td>
<td>{{ cavity.od1|floatformat:1 }}</td>
<td>{{ cavity.du|floatformat:1 }}</td>
<td>{{ cavity.t40|floatformat:1 }}</td>
<td>{{ cavity.t40_50|floatformat:1 }}</td>
<td>{{ cavity.t50_60|floatformat:1 }}</td>
<td>{{ cavity.t60_70|floatformat:1 }}</td>
<td>{{ cavity.t70_80|floatformat:1 }}</td>
<td>{{ cavity.t80_90|floatformat:1 }}</td>
<td>{{ cavity.t90_100|floatformat:1 }}</td>
<td>{{ cavity.t100_110|floatformat:1 }}</td>
<td>{{ cavity.t110_120|floatformat:1 }}</td>
<td>{{ cavity.t120|floatformat:1 }}</td>
</tr>
\ No newline at end of file
{% load customtags %}
{% for distance in object.near_cavities %}
{% with distance.distance|get_zscore:avg_std as score %}
{% if object == distance.cavity1 %}
{% include "targetcentric_cavity_row.html" with chaincount=chaincount cavcount=cavcount cavity=distance.cavity2 score=score near_cavity=True %}
{% elif object == distance.cavity2 %}
{% include "targetcentric_cavity_row.html" with chaincount=chaincount cavcount=cavcount cavity=distance.cavity1 score=score near_cavity=True %}
{% endif %}
{%endwith%}
{% endfor %}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment