Skip to content

Commit

Permalink
eliminate redundant duplicating IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
aozalevsky committed May 28, 2024
1 parent 5f0bb76 commit 07d9af1
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 56 deletions.
24 changes: 3 additions & 21 deletions ihm_validation/mmcif_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,9 @@ def get_databases(self):
return dbs

def get_id(self):
""" get id from model name, eg: PDBDEV_00XX will be PDBDEV00XX"""
# if self.system.id == 'model':
# id = self.get_id_from_entry()
# else:
# id = self.system.id.split('_')[0] + self.system.id.split('_')[1]
return self.get_id_from_entry()

def get_id_from_entry(self) -> str:
""" get id name from entry for cif files
deprecated """
sf = open(self.mmcif_file, 'r', encoding='latin1')
for ind, ln in enumerate(sf.readlines()):
line = ln.strip().split(' ')
if '_entry.id' in line[0]:
entry_init = line[-1]
try:
entry = entry_init.split('_')[0] + \
entry_init.split('_')[1]
except:
entry = entry_init.strip()
return entry
"""Return _entry.id; Requires compliant CIF file"""
entry_id = self.system.id
return entry_id

def get_pdb_id(self) -> str:
"""Check database2 table for PDB ID"""
Expand Down
7 changes: 0 additions & 7 deletions ihm_validation/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ def run_entry_composition(self, Template_Dict: dict) -> dict:
utility.dict_to_JSlist_rows(RB, flex))
entry_id = self.input.get_id()
Template_Dict['ID'] = entry_id
Template_Dict['ID_w'] = entry_id.split()
Template_Dict['ID_T'] = entry_id[0:6]+'_' + \
entry_id[6:]
Template_Dict['ID_MP'] = [str(entry_id[0:6]+'_' +
entry_id[6:])]
Template_Dict['ID_R'] = (
entry_id[0:6]+'_'+entry_id[6:]).split()
Template_Dict['PDB_ID'] = self.input.get_pdb_id()
Template_Dict['PDBDEV_ID'] = self.input.get_pdb_dev_id()
Template_Dict['ranked_id_list'] = self.input.get_ranked_id_list()
Expand Down
14 changes: 7 additions & 7 deletions templates/data_quality.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ <h5 class= ex2 align= center>
<!-- plots -->
<div class=row>
<!-- log I(q) vs q plot -->
{{ insert_sas_plot(ID_w[0], sasdb_code_html[i], "intensities") }}
{{ insert_sas_plot(ID, sasdb_code_html[i], "intensities") }}
<!-- log I(q) vs log q plot -->
{{ insert_sas_plot(ID_w[0], sasdb_code_html[i], "intensities_log") }}
{{ insert_sas_plot(ID, sasdb_code_html[i], "intensities_log") }}
</div>
</div>
</div>
Expand Down Expand Up @@ -112,9 +112,9 @@ <h5 class= ex2 align= center>
<!-- plots -->
<div class=row>
<!-- Porod-Debye plot -->
{{ insert_sas_plot(ID_w[0], sasdb_code_html[i], "porod") }}
{{ insert_sas_plot(ID, sasdb_code_html[i], "porod") }}
<!-- Dimensionless Kratky plot -->
{{ insert_sas_plot(ID_w[0], sasdb_code_html[i], "Kratky") }}
{{ insert_sas_plot(ID, sasdb_code_html[i], "Kratky") }}
</div>
{% endfor %}
</div>
Expand Down Expand Up @@ -142,9 +142,9 @@ <h5 align= center>
<!-- main plots -->
<div class=row>
<!-- Pair distance distribution function -->
{{ insert_sas_plot(ID_w[0], sasdb_code_html[i], "pddf") }}
{{ insert_sas_plot(ID, sasdb_code_html[i], "pddf") }}
<!-- P(r) extrapolated fit -->
{{ insert_sas_plot(ID_w[0], sasdb_code_html[i], "pddf_int") }}
{{ insert_sas_plot(ID, sasdb_code_html[i], "pddf_int") }}
</div>
{% endfor %}
</div>
Expand Down Expand Up @@ -183,7 +183,7 @@ <h5 class= ex2 align= center><u><a name=firstG> Guinier analysis </a></u><a clas
<!-- Guinier plot -->
<div class=row>
{% for i in range(sasdb_code_html|length) %}
{{ insert_sas_plot(ID_w[0], sasdb_code_html[i], "guinier") }}
{{ insert_sas_plot(ID, sasdb_code_html[i], "guinier") }}
{% endfor %}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/formodeling.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h5 class= ex2 align= center>
{% for i in range(sasdb_code_html|length) %}
{% for j in range(sasdb_code_fits[i]) %}
{% set k = j + 1 %}
{{ insert_sas_plot(ID_w[0], sasdb_code_html[i], j|int ~ 'fit1') }}
{{ insert_sas_plot(ID, sasdb_code_html[i], j|int ~ 'fit1') }}
{% endfor %}
{% endfor %}
</div>
Expand Down
26 changes: 13 additions & 13 deletions templates/full_validation_pdf.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ <h5 align=center>

{% for i in range([NumModels, MAXPLOTS] | min) %}
<div>
<img src={{ "../images/" ~ ID_w[0] ~ '_' ~ i ~ '_quality_at_glance_MQ.svg'}}>
<img src={{ "../images/" ~ ID ~ '_' ~ i ~ '_quality_at_glance_MQ.svg'}}>
</div>
{% endfor %}
{% elif disclaimer == 1 %}
Expand All @@ -255,7 +255,7 @@ <h5 align=center>
<div class="col-lg-12">
<div class="card-header" style="background-color: #FFFFFF ;">
<div class="box text-center container-fluid no-padding" align="center">
<img src={{"../images/" ~ ID_w[0] ~ "quality_at_glance_DQ.svg"}}>
<img src={{"../images/" ~ ID ~ "quality_at_glance_DQ.svg"}}>
</div>
</div>
</div>
Expand All @@ -271,7 +271,7 @@ <h5 align=center>
<div class="col-lg-12">
<div class="card-header" style="background-color: #FFFFFF ;">
<div class="box text-center container-fluid no-padding" align="center">
<img src={{"../images/" ~ ID_w[0] ~ "quality_at_glance_FQ.svg"}}>
<img src={{"../images/" ~ ID ~ "quality_at_glance_FQ.svg"}}>
</div>
</div>
</div>
Expand Down Expand Up @@ -442,12 +442,12 @@ <h5 align=center>
<div class=row>
<div class=col-lg-12>
<div class=box text-center container-fluid no-padding align=center>
<img src=../images/{{ ID_w[0] ~ sasdb_code_html[i] }}intensities.svg>
<img src=../images/{{ ID ~ sasdb_code_html[i] }}intensities.svg>
</div>
</div>
<div class=col-lg-12>
<div class=box text-center container-fluid no-padding align=center>
<img src=../images/{{ ID_w[0] ~ sasdb_code_html[i] }}intensities_log.svg>
<img src=../images/{{ ID ~ sasdb_code_html[i] }}intensities_log.svg>
</div>
</div>
</div>
Expand Down Expand Up @@ -481,12 +481,12 @@ <h5 align=center>
<div class=row>
<div class=col-xs-6>
<div class=box text-center container-fluid no-padding align=center>
<img src=../images/{{ ID_w[0] ~ sasdb_code_html[i] }}porod.svg>
<img src=../images/{{ ID ~ sasdb_code_html[i] }}porod.svg>
</div>
</div>
<div class=col-xs-6>
<div class=box text-center container-fluid no-padding align=center style=height:60vh >
<img src=../images/{{ ID_w[0] ~ sasdb_code_html[i] }}Kratky.svg>
<img src=../images/{{ ID ~ sasdb_code_html[i] }}Kratky.svg>
</div>
</div>
</div>
Expand All @@ -509,12 +509,12 @@ <h5 align=center>
<div class=row>
<div class=col-xs-6>
<div class=box text-center container-fluid no-padding align=center>
<img src=../images/{{ ID_w[0] ~ sasdb_code_html[i] }}pddf.svg>
<img src=../images/{{ ID ~ sasdb_code_html[i] }}pddf.svg>
</div>
</div>
<div class=col-xs-6>
<div class=box text-center container-fluid no-padding align=center>
<img src=../images/{{ ID_w[0] ~ sasdb_code_html[i] }}pddf_int.svg>
<img src=../images/{{ ID ~ sasdb_code_html[i] }}pddf_int.svg>
</div>
</div>
</div>
Expand All @@ -538,7 +538,7 @@ <h5 align= center>
<div class=row>
<div class=col-lg-12>
<div class=box text-center container-fluid no-padding align=center>
<img src=../images/{{ ID_w[0] ~ sasdb_code_html[i] }}guinier.svg>
<img src=../images/{{ ID ~ sasdb_code_html[i] }}guinier.svg>
</div>
</div>
</div>
Expand Down Expand Up @@ -602,7 +602,7 @@ <h5 align=center>
</h5>

{% if molp_b|length > 1 %}
<i>There are {{ bond }} bond outliers in this entry. A summary is provided below, and a detailed list of outliers can be found <a href=https://pdb-dev.wwpdb.org/Validation/{{ ID_MP[0] }}/htmls/bond_outliers.html>here</a>.</i>
<i>There are {{ bond }} bond outliers in this entry. A summary is provided below, and a detailed list of outliers can be found <a href=https://pdb-dev.wwpdb.org/Validation/{{ ID }}/htmls/bond_outliers.html>here</a>.</i>
{{ write_table(molp_b) }}
{% else %}
<i> Bond length outliers can not be evaluated for this model</i>
Expand All @@ -613,7 +613,7 @@ <h5 align=center>
<u><a name='geometry2'>Standard geometry: angle outliers</a></u><a class='help1' title='help' style='background-color:#228B22;color:#000000;text-decoration:none font-size=12px' href='https://pdb-dev.wwpdb.org/validation_help.html#molprobity'>?</a></h5>

{% if molp_a|length > 1 %}
<i>There are {{ angle }} angle outliers in this entry. A summary is provided below, and a detailed list of outliers can be found <a href=https://pdb-dev.wwpdb.org/Validation/{{ ID_MP[0] }}/htmls/angle_outliers.html>here</a>.</i>
<i>There are {{ angle }} angle outliers in this entry. A summary is provided below, and a detailed list of outliers can be found <a href=https://pdb-dev.wwpdb.org/Validation/{{ ID }}/htmls/angle_outliers.html>here</a>.</i>
{{ write_table(molp_a) }}
{% else %}
<i>Bond angle outliers do not exist or can not be evaluated for this model</i>
Expand Down Expand Up @@ -728,7 +728,7 @@ <h5 align=center>
<div class=row>
<div class=col-lg-12>
<div class=box text-center container-fluid no-padding align=center>
<img src=../images/{{ ID_w[0] ~ sasdb_code_html[i] ~ j|int }}fit1.svg>
<img src=../images/{{ ID ~ sasdb_code_html[i] ~ j|int }}fit1.svg>
</div>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<div class="col-lg-4">
<div class="card-header" style="background-color: #FFFFFF; border-color:#003366; height: 29rem;">
<h3 align=center>
<a href=/entry.html?{{ID_R[0]}}>
{{ID_R[0]}}
<a href=/entry.html?{{ ID }}>
{{ ID }}
</a>
</h3>
<div class="box text-center no-padding float-left" style="text-align: center" >
Expand All @@ -26,7 +26,7 @@ <h5 align="center" style="text-align: center";>Download Summary Table</h5>
</a>
</div>
<div class="box text-center container-fluid no-padding">
<img src=/images/{{ID_R[0]}}_resize_1.png class=image-fluid alt=Model Image style=width:300px align=center>
<img src=/images/{{ ID }}_resize_1.png class=image-fluid alt=Model Image style=width:300px align=center>
</div>
</div>
<!-- end card header -->
Expand Down Expand Up @@ -144,20 +144,20 @@ <h3 align="center">
<div id="home" class="tab-pane active">
<div class="box text-center container-fluid no-padding" align='center'>
{% if not disclaimer %}
<iframe src=../images/{{ID_w[0]}}quality_at_glance_MQ.html frameborder=0 scrolling=yes width=90% align=center text-align: center style="position:relative; min-height:470px; max-height:2048px;">
<iframe src=../images/{{ ID }}quality_at_glance_MQ.html frameborder=0 scrolling=yes width=90% align=center text-align: center style="position:relative; min-height:470px; max-height:2048px;">
</iframe>
{% endif %}
</div>
</div>
<div id="menu1" class="tab-pane fade">
<div class="box text-center container-fluid no-padding" align='center'>
<iframe src=../images/{{ID_w[0]}}quality_at_glance_DQ.html frameborder=0 scrolling=yes width=90% height=500vh align=center text-align: center style=position:relative>
<iframe src=../images/{{ ID }}quality_at_glance_DQ.html frameborder=0 scrolling=yes width=90% height=500vh align=center text-align: center style=position:relative>
</iframe>
</div>
</div>
<div id="menu2" class="tab-pane fade">
<div class="box text-center container-fluid no-padding" align='center'>
<iframe src=../images/{{ID_w[0]}}quality_at_glance_FQ.html frameborder=0 scrolling=yes width=90% align=center text-align: center style="position:relative; min-height:470px; max-height:2048px;">
<iframe src=../images/{{ ID }}quality_at_glance_FQ.html frameborder=0 scrolling=yes width=90% align=center text-align: center style="position:relative; min-height:470px; max-height:2048px;">
</iframe>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/validation_report_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="dropdown">
<a class="navbar-brand" href="main.html">
<h5>
Validation Report for {{ID_T}}
Validation Report for {{ ID }}
</h5>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
Expand Down

0 comments on commit 07d9af1

Please sign in to comment.