Documentation

Structure Prediction Reports

Turn Melo-1 structure prediction results into an interactive report for offline viewing and sharing, with 3D structures, sample comparisons, and confidence metrics.

Documentation contents

Create an interactive report from Melo-1 structure prediction results to view 3D structures, compare sample scores and confidence, and export results in your browser. Each report is a single HTML file that can be opened offline and shared.

Prepare the report template and complete result ZIP, then follow the steps below.

Download the template

This template accepts complete Melo-1 structure prediction result ZIP files. For an entire screening batch, use the virtual screening report template.

You can also download the template from the command line:

curl --fail --location \
  'https://www.atomelody.com/templates/atomelody-structure-prediction-report-template.html' \
  --output atomelody-structure-prediction-report-template.html

Generate the report

  1. Follow the Structure Prediction Guide to obtain task results. Download the complete ZIP from output_url and save it as <task-id>-output.zip. Query the task again if the URL has expired.
  2. Download the template above and place it in the same directory as the result ZIP.
  3. Run the Python example below to generate <task-id>-report.html. To include the model, task name, and input, also prepare the task details.
  4. Open the generated HTML in a browser and verify the structure and confidence displays before sharing.

Sharing a report also shares its results and any task information you included. Do not embed API Keys or temporary download URLs.

Report data slot

Use these conventions when writing your own generator. With the Python example below, no manual template editing is needed.

The template has exactly one empty data slot:

<script id="reportData" type="application/json">null</script>

Keep the script tag and replace null with a JSON object. The minimum data has a single field:

{"archiveBase64":"BASE64_OF_COMPLETE_ZIP"}

The following fields are optional; omit any you do not need:

FieldPurposeWhen omitted
taskIdTask ID; use the value returned by the query endpointTask ID is hidden
taskNameTask name displayed as the report headingUses the task name in the ZIP
modelModel name displayed at the topModel name is hidden
inputOriginal task input JSON object, collapsed by default and expandable in the reportInput section is hidden
archiveNameZIP export filename, without directoriesUses <taskId>-output.zip, or output.zip if no valid task ID is provided
generatedAtReport generation time in ISO 8601 formatGeneration time is hidden

For a custom generator, encode the complete ZIP as standard Base64 without line breaks and serialize the report data with a JSON tool. Before inserting JSON into HTML, replace every < with \u003c. Leave the rest of the template unchanged. The Python example already handles this.

Include task input

To display the model, task name, and input, query details for the same task, save the response as task-details.json, and change task_details_path below to Path("task-details.json"). Task details are optional.

The script reads model and input, and maps task_name to the report's taskName. A custom generator may also use saved original request parameters; make sure they belong to the same task as the results.

Task input is collapsed by default. Expand the task input section to inspect it. Collapsing it does not remove the data; shared reports still contain it.

Python example

Requires Python 3.9 or later, with no third-party packages. Place the template and <task-id>-output.zip in the current directory, update task_id, then run:

python3 - <<'PY'
import base64
import json
from pathlib import Path
import re
import zipfile

task_id = "tk-example"  # Replace with the actual task ID.
if not re.fullmatch(r"[a-zA-Z0-9][a-zA-Z0-9_-]{0,159}", task_id):
    raise ValueError("Provide a valid task ID")

template = Path("atomelody-structure-prediction-report-template.html")
archive = Path(f"{task_id}-output.zip")
output = Path(f"{task_id}-report.html")
html = template.read_text(encoding="utf-8")
slot = '<script id="reportData" type="application/json">null</script>'
if html.count(slot) != 1 or 'data-viewer-mode="report"' not in html:
    raise ValueError("Use a report template with an empty data slot")
if archive.stat().st_size > 200 * 1024 * 1024:
    raise ValueError("The result ZIP must not exceed 200 MiB")
with zipfile.ZipFile(archive) as z:
    if sum(item.file_size for item in z.infolist()) > 800 * 1024 * 1024:
        raise ValueError("Total uncompressed size must not exceed 800 MiB")

report = {
    "taskId": task_id,
    "archiveBase64": base64.b64encode(archive.read_bytes()).decode("ascii"),
}
# Optional: report["taskName"] = "My structure prediction task"
# Optional: use Path("task-details.json") to include the same task's model, name, and input.
task_details_path = None
if task_details_path is not None:
    details = json.loads(task_details_path.read_text(encoding="utf-8"))
    if not isinstance(details, dict):
        raise ValueError("Task details must be a JSON object")
    details = details.get("data", details)
    if not isinstance(details, dict):
        raise ValueError("Task details data must be a JSON object")
    # The API uses snake_case; report data uses camelCase.
    for key, report_key in (("model", "model"), ("task_name", "taskName"), ("input", "input")):
        if key in details:
            expected = dict if key == "input" else str
            if not isinstance(details[key], expected):
                raise ValueError(f"Incorrect type for task details field {key}")
            report[report_key] = details[key]
payload = json.dumps(report, ensure_ascii=True).replace("<", "\\u003c")
filled = '<script id="reportData" type="application/json">' + payload + '</script>'
with output.open("x", encoding="utf-8") as file:
    file.write(html.replace(slot, filled))
print(f"Report generated: {output.resolve()}")
PY

The script does not overwrite existing reports. To regenerate, change the output filename or move the old file. Python is not required to view the report.

Open and check

Double-click the HTML file to open it offline. The 3D viewer requires WebGL support. Before sharing, verify that:

  • You can switch structure samples and view 3D structures and confidence metrics.
  • Included task information is correct and the input section expands.
  • You can export the result ZIP and current structure as CIF.

Use the complete downloaded result ZIP, retaining its structure and confidence files. A CIF file alone or a reduced archive containing only the best structure is not supported by this template.

The result ZIP must be at most 200 MiB, with a total uncompressed size of at most 800 MiB. Larger reports take longer to load and need more browser memory. Confidence metrics support assessment and do not replace experimental validation.

The report can temporarily open another result ZIP using its open-results button. This does not save the new results; generate a new report for that task before sharing.