Skip to content

Commit 3b28bed

Browse files
remove blank divs in the report is the metrics aren't there
1 parent 77af3e3 commit 3b28bed

3 files changed

Lines changed: 10 additions & 173 deletions

File tree

assets/report_template.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@
378378
<!-- Plots -->
379379
<div class="bg-gray-200 p-12 xl:p-16">
380380
<!-- Top row: Sequence Coverage (full width) -->
381+
<!-- BEGIN_MSA_SECTION -->
381382
<div id="seq_coverage_container" class="flex justify-center mb-12 xl:mb-16">
382383
<div class="max-w-[720px] xl:max-w-[900px] 2xl:max-w-[1100px] w-full">
383384
<div class="text-3xl xl:text-4xl font-bold tracking-tight mb-4 xl:mb-6 text-center">
@@ -388,6 +389,7 @@
388389
</div>
389390
</div>
390391
</div>
392+
<!-- END_MSA_SECTION -->
391393

392394
<!-- Bottom row: pLDDT and PAE side by side -->
393395
<div class="flex flex-col xl:flex-row justify-center items-start gap-12 xl:gap-16 2xl:gap-20">
@@ -400,6 +402,7 @@
400402
</div>
401403
</div>
402404

405+
<!-- BEGIN_PAE_SECTION -->
403406
<div class="flex-1 max-w-[720px] xl:max-w-[850px] 2xl:max-w-[1000px]">
404407
<div class="text-3xl xl:text-4xl font-bold tracking-tight mb-4 xl:mb-6 text-center">
405408
Residue-pair alignment error - PAE
@@ -408,6 +411,7 @@
408411
<div id="pae_placeholder"></div>
409412
</div>
410413
</div>
414+
<!-- END_PAE_SECTION -->
411415
</div>
412416
</div>
413417

bin/generate_report.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import json
1212
import argparse
1313
import os
14+
import re
1415
from pathlib import Path
1516

1617
prog_name_mapping = {
@@ -94,9 +95,11 @@ def generate_report(name, out_dir, structures, num_structs_limit=5, msa_files=No
9495
config=PLOTLY_CONFIG,
9596
)
9697

97-
# Replace placeholder divs with plot HTML
98+
# Replace or remove optional sections
9899
if seq_cov_html:
99100
html = html.replace('<div id="seq_cov_placeholder"></div>', seq_cov_html, 1)
101+
else:
102+
html = re.sub(r'<!-- BEGIN_MSA_SECTION -->.*?<!-- END_MSA_SECTION -->', '', html, flags=re.DOTALL)
100103

101104
# Generate the pLDDT plot and convert to HTML
102105
plddt_fig = generate_plddt_plot(parsed_structures)
@@ -116,6 +119,8 @@ def generate_report(name, out_dir, structures, num_structs_limit=5, msa_files=No
116119
config=PLOTLY_CONFIG,
117120
)
118121
html = html.replace('<div id="pae_placeholder"></div>', pae_html, 1)
122+
else:
123+
html = re.sub(r'<!-- BEGIN_PAE_SECTION -->.*?<!-- END_PAE_SECTION -->', '', html, flags=re.DOTALL)
119124

120125
if write_htmls:
121126
with open(f"{out_dir}/{name}_coverage_pLDDT.html", "w") as out_file:

modules/local/generate_report/generate_report.py

Lines changed: 0 additions & 172 deletions
This file was deleted.

0 commit comments

Comments
 (0)