Skip to content

Commit

Permalink
limit maximum number of sequential plots to 256
Browse files Browse the repository at this point in the history
  • Loading branch information
aozalevsky committed Mar 20, 2024
1 parent ba527bd commit 847e41b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions ihm_validation/get_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
silence(MISSING_RENDERERS, True)
silence(EMPTY_LAYOUT, True)

MAXPLOTS = 256

class Plots(GetInputInformation):
def __init__(self, mmcif, imageDirName, driver):
Expand Down Expand Up @@ -118,14 +119,16 @@ def plot_quality_at_glance(self, molprobity_data: dict, exv_data: dict,

# if there isn't molprobity data, we plot exc vol data
elif exv_data:
model = exv_data['Models']
satisfaction = exv_data['Number of violations']
numplots = min(len(exv_data['Models']), MAXPLOTS)

model = exv_data['Models'][:numplots]
satisfaction = exv_data['Number of violations'][:numplots]
# make sure data is plot-able
try:
counts = [float(i) for i in satisfaction]
except (ValueError):
return
violations = exv_data['Excluded Volume Satisfaction (%)']
violations = exv_data['Excluded Volume Satisfaction (%)'][:numplots]
Scores = ['Model ' + str(i+1) for i, j in enumerate(model)]
legends = ['Model ' + str(i+1) + ': ' + str(int(j)) +
'('+str(violations[i])+' %)' for i, j in enumerate(counts)]
Expand Down
1 change: 1 addition & 0 deletions ihm_validation/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def run_entry_composition(self, Template_Dict: dict) -> dict:
Template_Dict['ChainL'] = self.input.get_composition()['Chain ID [auth]']
Template_Dict['ChainLMap'] = self.input.get_auth_label_map()
Template_Dict['number_of_fits'] = 0
Template_Dict['MAXPLOTS'] = get_plots.MAXPLOTS
return Template_Dict

def check_mmcif(self, Template_Dict: dict) -> None:
Expand Down
4 changes: 2 additions & 2 deletions templates/full_validation_pdf.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ <h3 align="center">
<a name='qual'><u>Overall quality</u></a> <a class='help1' style="background-color:#228B22;color:#000000;text-decoration:none font-size=16px" href="https://pdb-dev.wwpdb.org/validation_help.html#overview">?</a>
</h3>
<p align="justify">
<em>This validation report contains model quality assessments for all structures, data quality assessment for SAS datasets and fit to model assessments for SAS datasets. Data quality and fit to model assessments for other datasets and model uncertainty are under development.</em>
<em>This validation report contains model quality assessments for all structures, data quality assessment for SAS datasets and fit to model assessments for SAS datasets. Data quality and fit to model assessments for other datasets and model uncertainty are under development. Number of plots is limited to {{MAXPLOTS}}.</em>
</p>

<!-- Molprobity or excluded volume -->
Expand All @@ -233,7 +233,7 @@ <h5 align=center>
</h5>
{% endif %}

{% for i in range(NumModels) %}
{% for i in range([NumModels, MAXPLOTS] | min) %}
<div>
<img src={{ "../images/" ~ ID_w[0] ~ '_' ~ i ~ '_quality_at_glance_MQ.svg'}}>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h3 align="center">
<a class='help' title='help' style="background-color:#228B22;color:#000000;text-decoration:none font-size=16px" href="/validation_help.html#overview">?</a>
</h3>
<p align="justify">
<em>This validation report contains model quality assessments for all structures. For more detail for each assessment, use the dropdown menus at the top of this page.
<em>This validation report contains model quality assessments for all structures. For more detail for each assessment, use the dropdown menus at the top of this page. Number of plots is limited to {{MAXPLOTS}}.
</em>
</p>
{% if 'SAS DATA' in Data and sasdb_sascif|length > 0 %}
Expand Down

0 comments on commit 847e41b

Please sign in to comment.