File size: 5,184 Bytes
0885ace
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import base64
from pathlib import Path

import streamlit as st

from src.ui_style import apply_global_style

st.set_page_config(page_title="Home", layout="wide")
apply_global_style()

logo_path = Path(__file__).resolve().parent / "icons" / "logo.png"
logo_data_uri = ""
if logo_path.exists():
    logo_data_uri = "data:image/png;base64," + base64.b64encode(logo_path.read_bytes()).decode("ascii")

st.markdown(
    """
<div style="margin: 0.15rem 0 0.4rem 0;">
  <span class="pp-badge">Home</span>
</div>
""",
    unsafe_allow_html=True,
)

st.markdown(
    f"""
<section class="pp-main-card">
  <div class="pp-main-grid">
    <div>
      <h1 class="pp-main-title">Polymer Discovery Platform</h1>
      <p class="pp-main-copy">
        A unified platform for polymer research that combines property prediction, molecular visualization, and objective-driven candidate discovery to support faster, data-backed screening and selection decisions.
      </p>
    </div>
    <div class="pp-main-logo">
      {"<img src='" + logo_data_uri + "' alt='Platform logo' />" if logo_data_uri else ""}
    </div>
  </div>
</section>
""",
    unsafe_allow_html=True,
)

stats = [
    ("25+", "Properties"),
    ("13K+", "Real Polymers"),
    ("1M", "Virtual Polymers"),
]
stats_html = "".join(
    [
        f"""
<div class="pp-kpi-item">
  <p class="pp-kpi-value">{value}</p>
  <p class="pp-kpi-label">{label}</p>
</div>
"""
        for value, label in stats
    ]
)
st.markdown(f'<section class="pp-kpi-strip">{stats_html}</section>', unsafe_allow_html=True)

st.divider()
st.markdown("### Platform Modules")
st.caption(
    "Use the modules below to probe, predict, visualize, discover, and ground polymer decisions with literature evidence."
)

cards = [
    (
        "Property Probe",
        "Input a single SMILES or polymer name and retrieve predicted or available values for one target property. "
        "Best for quick validation before larger screening.",
        "pages/1_Property_Probe.py",
    ),
    (
        "Batch Prediction",
        "Upload or paste many SMILES and run bulk property prediction in one job. "
        "Useful when you want ranked outputs and exportable tables for downstream analysis.",
        "pages/2_Batch_Prediction.py",
    ),
    (
        "Molecular View",
        "Render 2D and 3D molecular structures, inspect composition, and download visual assets "
        "or MOL files for documentation and simulation setup.",
        "pages/3_Molecular_View.py",
    ),
    (
        "Discovery (Manual)",
        "Set hard constraints, objectives, trust/selection weights, and diversity settings directly. "
        "Designed for controlled multi-objective exploration with transparent parameter tuning.",
        "pages/4_Discovery_(Manual).py",
    ),
    (
        "Discovery (AI)",
        "Describe target behavior in natural language and let the LLM build discovery settings. "
        "You can run directly or inspect/edit the generated JSON in advanced mode.",
        "pages/5_Discovery_(AI).py",
    ),
    (
        "Novel SMILES Generation",
        "Sample new polymer SMILES with the pretrained RNN and filter out molecules already present "
        "in local datasets (EXP/MD/DFT/GC/POLYINFO/PI1M).",
        "pages/6_Novel_SMILES_Generation.py",
    ),
    (
        "Literature Search",
        "Search polymer papers, stage evidence records, inspect OA/PDF availability, and review structured material-property evidence before promotion.",
        "pages/7_Literature_Search.py",
    ),
    (
        "Feedback",
        "Send bug reports, feature requests, and usage feedback.",
        "pages/8_Feedback.py",
    ),
]

for i, (title, desc, page_path) in enumerate(cards, start=1):
    c1, c2 = st.columns([5, 1.1], vertical_alignment="center")
    page_exists = (Path(__file__).resolve().parent / page_path).exists()
    with c1:
        st.markdown(
            f"""
<div class="pp-module-card">
  <p class="pp-module-title">{title}</p>
  <p class="pp-module-copy">{desc}</p>
</div>
""",
            unsafe_allow_html=True,
        )
    with c2:
        if st.button("Open", type="primary", key=f"home_go_{i}", disabled=not page_exists):
            st.switch_page(page_path)

st.divider()
st.markdown(
    """
<section class="pp-lab-card">
  <div class="pp-lab-head">
    <span class="pp-lab-kicker">Research Partner</span>
    <h3 class="pp-lab-title">Developed by MONSTER Lab</h3>
    <p class="pp-lab-subtitle">
      Molecular/Nano-Scale Transport &amp; Energy Research Laboratory | College of Engineering, University of Notre Dame
    </p>
  </div>
  <p class="pp-lab-copy">
    The MONSTER Lab studies the
    physics of energy and mass transport across molecular and nano-scales using theory, simulation,
    data-driven methods, and experiments. The team translates these insights into materials and
    systems for thermal management, energy efficiency, water desalination, high-sensitivity biosensing,
    and additive manufacturing.
  </p>
  <a class="pp-lab-link" href="https://monsterlab.nd.edu/" target="_blank" rel="noopener noreferrer">
    Visit MONSTER Lab Website
  </a>
</section>
""",
    unsafe_allow_html=True,
)