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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>EPIC-AMP</title>
|
| 7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
| 8 |
+
<link rel="icon" type="image/png" href="favicon.png">
|
| 9 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
|
| 10 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.23/jspdf.plugin.autotable.min.js"></script>
|
| 11 |
+
|
| 12 |
+
<style>
|
| 13 |
+
:root {
|
| 14 |
+
--primary-color: #004d40; /* Dark Teal */
|
| 15 |
+
--secondary-color: #00897b; /* Teal */
|
| 16 |
+
--success-color: #4caf50; /* Green */
|
| 17 |
+
--warning-color: #ff9800; /* Orange */
|
| 18 |
+
--info-color: #2196f3; /* Blue */
|
| 19 |
+
--background-color: #f0f4c3; /* Light Lime */
|
| 20 |
+
--text-color: #333; /* Dark Gray */
|
| 21 |
+
--container-bg-color: #ffffff; /* White */
|
| 22 |
+
--border-color: #bdbdbd; /* Light Gray */
|
| 23 |
+
--button-hover-bg: #00695c; /* Darker Teal */
|
| 24 |
+
--clear-button-bg: #f44336; /* Red */
|
| 25 |
+
--clear-button-hover-bg: #d32f2f; /* Darker Red */
|
| 26 |
+
--analyze-button-bg: #00897b; /* Teal */
|
| 27 |
+
--analyze-button-hover-bg: #00695c; /* Darker Teal */
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
/* Optional Dark Mode */
|
| 31 |
+
.dark-mode {
|
| 32 |
+
--primary-color: #b2dfdb; /* Light Teal */
|
| 33 |
+
--secondary-color: #4db6ac; /* Medium Teal */
|
| 34 |
+
--success-color: #81c784; /* Light Green */
|
| 35 |
+
--warning-color: #ffcc80; /* Light Orange */
|
| 36 |
+
--info-color: #90caf9; /* Light Blue */
|
| 37 |
+
--background-color: #212121; /* Dark Gray */
|
| 38 |
+
--text-color: #eee; /* Light Gray */
|
| 39 |
+
--container-bg-color: #424242;/* Darker Gray */
|
| 40 |
+
--border-color: #616161; /* Medium Gray */
|
| 41 |
+
--button-hover-bg: #004d40; /* Dark Teal */
|
| 42 |
+
--clear-button-bg: #e57373; /* Light Red */
|
| 43 |
+
--clear-button-hover-bg: #f44336; /* Red */
|
| 44 |
+
--analyze-button-bg: #4db6ac; /* Medium Teal */
|
| 45 |
+
--analyze-button-hover-bg: #009688; /* Teal */
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
body {
|
| 49 |
+
font-family: 'Arial', sans-serif;
|
| 50 |
+
line-height: 1.6;
|
| 51 |
+
margin: 0;
|
| 52 |
+
padding: 20px;
|
| 53 |
+
min-height: 100vh;
|
| 54 |
+
display: flex;
|
| 55 |
+
flex-direction: column;
|
| 56 |
+
align-items: center;
|
| 57 |
+
background-color: var(--background-color);
|
| 58 |
+
color: var(--text-color);
|
| 59 |
+
transition: background-color 0.3s ease, color 0.3s ease;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.container {
|
| 63 |
+
max-width: 800px;
|
| 64 |
+
width: 100%;
|
| 65 |
+
padding: 2rem;
|
| 66 |
+
background: var(--container-bg-color);
|
| 67 |
+
border-radius: 10px;
|
| 68 |
+
box-shadow: 0 2px 15px rgba(0,0,0,0.1);
|
| 69 |
+
text-align: center;
|
| 70 |
+
transition: background-color 0.3s ease;
|
| 71 |
+
display: flex;
|
| 72 |
+
flex-direction: column;
|
| 73 |
+
margin-bottom: 20px;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.input-group {
|
| 77 |
+
margin-bottom: 1.5rem;
|
| 78 |
+
position: relative;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
#sequence {
|
| 82 |
+
width: 100%;
|
| 83 |
+
height: 150px;
|
| 84 |
+
padding: 1rem;
|
| 85 |
+
border: 2px solid var(--border-color);
|
| 86 |
+
border-radius: 8px;
|
| 87 |
+
font-family: monospace;
|
| 88 |
+
font-size: 1rem;
|
| 89 |
+
resize: vertical;
|
| 90 |
+
transition: border-color 0.3s ease, background-color 0.3s ease;
|
| 91 |
+
background-color: var(--container-bg-color);
|
| 92 |
+
color: var(--text-color);
|
| 93 |
+
box-sizing: border-box;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
#file-input {
|
| 97 |
+
margin-bottom: 1rem;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
#sequence:focus {
|
| 101 |
+
outline: none;
|
| 102 |
+
border-color: var(--secondary-color);
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
button {
|
| 106 |
+
color: white;
|
| 107 |
+
border: none;
|
| 108 |
+
padding: 0.8rem 2rem;
|
| 109 |
+
border-radius: 5px;
|
| 110 |
+
cursor: pointer;
|
| 111 |
+
font-size: 1rem;
|
| 112 |
+
transition: transform 0.2s ease, background-color 0.3s ease;
|
| 113 |
+
/* margin-top: 1rem; Removed individual margin-top for buttons */
|
| 114 |
+
}
|
| 115 |
+
.button-group button{
|
| 116 |
+
margin: 0 0.2rem;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
button:hover {
|
| 120 |
+
transform: translateY(-1px);
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
#clear-btn {
|
| 124 |
+
background-color: var(--clear-button-bg);
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
#clear-btn:hover {
|
| 128 |
+
background-color: var(--clear-button-hover-bg);
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
#predict-btn {
|
| 132 |
+
background-color: var(--analyze-button-bg);
|
| 133 |
+
min-width: 230px; /* To accommodate count-up text better */
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
#predict-btn:hover {
|
| 137 |
+
background-color: var(--analyze-button-hover-bg);
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
.character-count {
|
| 142 |
+
text-align: right;
|
| 143 |
+
color: var(--text-color);
|
| 144 |
+
font-size: 0.9rem;
|
| 145 |
+
margin-top: 0.5rem;
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
.error-message {
|
| 150 |
+
color: var(--warning-color);
|
| 151 |
+
text-align: center;
|
| 152 |
+
margin-top: 1rem;
|
| 153 |
+
display: none;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
|
| 157 |
+
.result {
|
| 158 |
+
margin-top: 1.5rem;
|
| 159 |
+
font-size: 1.2rem;
|
| 160 |
+
font-weight: bold;
|
| 161 |
+
color: var(--primary-color);
|
| 162 |
+
text-align: center;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
.info-icon {
|
| 166 |
+
position: absolute;
|
| 167 |
+
top: 1rem;
|
| 168 |
+
right: 1rem;
|
| 169 |
+
font-size: 1.2rem;
|
| 170 |
+
color: var(--info-color);
|
| 171 |
+
cursor: pointer;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
.tooltip {
|
| 175 |
+
position: absolute;
|
| 176 |
+
top: 100%;
|
| 177 |
+
right: 0;
|
| 178 |
+
background-color: rgba(0, 0, 0, 0.8);
|
| 179 |
+
color: white;
|
| 180 |
+
padding: 0.5rem;
|
| 181 |
+
border-radius: 5px;
|
| 182 |
+
display: none;
|
| 183 |
+
z-index: 10;
|
| 184 |
+
width: 250px;
|
| 185 |
+
text-align: left;
|
| 186 |
+
font-size: 0.9rem;
|
| 187 |
+
line-height: 1.4;
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
.info-icon:hover + .tooltip,
|
| 191 |
+
.tooltip:hover {
|
| 192 |
+
display: block;
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
@keyframes fadeIn {
|
| 196 |
+
from { opacity: 0; transform: translateY(-10px); }
|
| 197 |
+
to { opacity: 1; transform: translateY(0); }
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
.result.show {
|
| 201 |
+
animation: fadeIn 0.5s ease forwards;
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
.tabs {
|
| 205 |
+
display: flex;
|
| 206 |
+
justify-content: center;
|
| 207 |
+
margin-bottom: 1rem;
|
| 208 |
+
border-bottom: 2px solid var(--border-color);
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
.tab {
|
| 212 |
+
padding: 0.5rem 1rem;
|
| 213 |
+
margin: 0 0.5rem;
|
| 214 |
+
cursor: pointer;
|
| 215 |
+
border: 2px solid transparent;
|
| 216 |
+
border-radius: 5px 5px 0 0;
|
| 217 |
+
background-color: transparent;
|
| 218 |
+
color: var(--text-color);
|
| 219 |
+
transition: border-color 0.3s ease, background-color 0.3s ease;
|
| 220 |
+
display: flex;
|
| 221 |
+
align-items: center;
|
| 222 |
+
gap: 0.5rem;
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
.tab.active {
|
| 226 |
+
border-color: var(--primary-color);
|
| 227 |
+
background-color: var(--primary-color);
|
| 228 |
+
color: white;
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
.tab-content {
|
| 232 |
+
display: none;
|
| 233 |
+
padding: 1rem;
|
| 234 |
+
text-align: left;
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
.tab-content.active {
|
| 238 |
+
display: block;
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
.metrics-table {
|
| 242 |
+
width: 100%;
|
| 243 |
+
border-collapse: collapse;
|
| 244 |
+
margin-top: 1rem;
|
| 245 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
.metrics-table th, .metrics-table td {
|
| 250 |
+
padding: 0.5rem;
|
| 251 |
+
border: 1px solid var(--border-color);
|
| 252 |
+
text-align: center;
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
.metrics-table th {
|
| 256 |
+
background-color: var(--primary-color);
|
| 257 |
+
color: white;
|
| 258 |
+
font-weight: bold;
|
| 259 |
+
text-transform: uppercase;
|
| 260 |
+
letter-spacing: 0.05em;
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
.metrics-table td {
|
| 264 |
+
padding: 0.8rem 0.5rem;
|
| 265 |
+
}
|
| 266 |
+
.metrics-table tr:nth-child(even) {
|
| 267 |
+
background-color: #f9f9f9;
|
| 268 |
+
}
|
| 269 |
+
.dark-mode .metrics-table tr:nth-child(even) {
|
| 270 |
+
background-color: #555;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
.logos-container {
|
| 274 |
+
display: flex;
|
| 275 |
+
justify-content: center;
|
| 276 |
+
align-items: center;
|
| 277 |
+
margin-bottom: 1rem;
|
| 278 |
+
width: 100%;
|
| 279 |
+
}
|
| 280 |
+
.logos-container img {
|
| 281 |
+
|
| 282 |
+
transform: scale(1.083);
|
| 283 |
+
max-width: 100%;
|
| 284 |
+
height: auto;
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
footer {
|
| 288 |
+
width: 100%;
|
| 289 |
+
padding: 20px;
|
| 290 |
+
background-color: var(--container-bg-color);
|
| 291 |
+
border-top: 1px solid var(--border-color);
|
| 292 |
+
font-size: 0.9rem;
|
| 293 |
+
color: var(--text-color);
|
| 294 |
+
text-align: center;
|
| 295 |
+
box-sizing: border-box;
|
| 296 |
+
position: relative;
|
| 297 |
+
left: 0;
|
| 298 |
+
right: 0;
|
| 299 |
+
margin: 0;
|
| 300 |
+
width: 100vw;
|
| 301 |
+
margin-left: calc(-100vw / 2 + 50%);
|
| 302 |
+
margin-right: calc(-100vw / 2 + 50%);
|
| 303 |
+
white-space: normal;
|
| 304 |
+
overflow-wrap: break-word;
|
| 305 |
+
}
|
| 306 |
+
footer p, footer address {
|
| 307 |
+
margin: 0.5rem 0;
|
| 308 |
+
white-space: normal;
|
| 309 |
+
overflow-wrap: break-word;
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
|
| 313 |
+
.button-group-wrapper { /* New wrapper for buttons and the time info */
|
| 314 |
+
display: flex;
|
| 315 |
+
flex-direction: column;
|
| 316 |
+
align-items: center;
|
| 317 |
+
width: 100%;
|
| 318 |
+
margin-top: 1rem; /* Spacing for the wrapper itself */
|
| 319 |
+
}
|
| 320 |
+
#processing-time-info {
|
| 321 |
+
font-size: 0.9em;
|
| 322 |
+
color: var(--text-color);
|
| 323 |
+
margin-bottom: 0.75rem; /* Space between this info and the buttons */
|
| 324 |
+
}
|
| 325 |
+
.dark-mode #processing-time-info {
|
| 326 |
+
color: var(--text-color); /* Ensure dark mode text color is applied */
|
| 327 |
+
}
|
| 328 |
+
.button-group {
|
| 329 |
+
display: flex;
|
| 330 |
+
justify-content: center;
|
| 331 |
+
align-items: center;
|
| 332 |
+
width: 100%;
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
#download-link {
|
| 336 |
+
color: var(--secondary-color);
|
| 337 |
+
text-decoration: none;
|
| 338 |
+
font-weight: bold;
|
| 339 |
+
display: block;
|
| 340 |
+
margin: 10px auto;
|
| 341 |
+
text-align: center;
|
| 342 |
+
}
|
| 343 |
+
#download-link:hover{
|
| 344 |
+
text-decoration: underline;
|
| 345 |
+
}
|
| 346 |
+
.tab-content h2 {
|
| 347 |
+
color: var(--primary-color);
|
| 348 |
+
margin-bottom: 0.5rem;
|
| 349 |
+
border-bottom: 2px solid var(--secondary-color);
|
| 350 |
+
padding-bottom: 0.25rem;
|
| 351 |
+
display: inline-block;
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
.tab-content h3 {
|
| 355 |
+
color: var(--secondary-color);
|
| 356 |
+
margin-top: 1.5rem;
|
| 357 |
+
margin-bottom: 0.5rem;
|
| 358 |
+
}
|
| 359 |
+
.tab-content ul {
|
| 360 |
+
list-style: disc;
|
| 361 |
+
margin-left: 20px;
|
| 362 |
+
padding-left: 0;
|
| 363 |
+
}
|
| 364 |
+
|
| 365 |
+
.tab-content li {
|
| 366 |
+
margin-bottom: 0.25rem;
|
| 367 |
+
}
|
| 368 |
+
.tab-content p {
|
| 369 |
+
margin-bottom: 1rem;
|
| 370 |
+
line-height: 1.7;
|
| 371 |
+
}
|
| 372 |
+
|
| 373 |
+
#shap-plot-container {
|
| 374 |
+
width: 100%;
|
| 375 |
+
min-height: 300px;
|
| 376 |
+
border: 1px solid var(--border-color);
|
| 377 |
+
border-radius: 5px;
|
| 378 |
+
margin-top: 1rem;
|
| 379 |
+
display: flex;
|
| 380 |
+
justify-content: center;
|
| 381 |
+
align-items: center;
|
| 382 |
+
overflow-x: auto;
|
| 383 |
+
}
|
| 384 |
+
#shap-plot-container img{
|
| 385 |
+
max-width: 100%;
|
| 386 |
+
height: auto;
|
| 387 |
+
display: block;
|
| 388 |
+
}
|
| 389 |
+
|
| 390 |
+
.results-display-group {
|
| 391 |
+
display: grid;
|
| 392 |
+
grid-template-columns: 1fr 1fr;
|
| 393 |
+
gap: 1rem;
|
| 394 |
+
margin-top: 2rem;
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
.result-box {
|
| 398 |
+
border: 1px solid var(--border-color);
|
| 399 |
+
border-radius: 8px;
|
| 400 |
+
background-color: var(--container-bg-color);
|
| 401 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
|
| 402 |
+
overflow: hidden;
|
| 403 |
+
color: var(--text-color);
|
| 404 |
+
}
|
| 405 |
+
|
| 406 |
+
.dark-mode .result-box {
|
| 407 |
+
background-color: #424242;
|
| 408 |
+
border-color: #616161;
|
| 409 |
+
}
|
| 410 |
+
|
| 411 |
+
|
| 412 |
+
.result-header {
|
| 413 |
+
background-color: var(--primary-color);
|
| 414 |
+
color: white;
|
| 415 |
+
padding: 0.7rem 1rem;
|
| 416 |
+
font-weight: bold;
|
| 417 |
+
font-size: 1.1rem;
|
| 418 |
+
display: flex;
|
| 419 |
+
align-items: center;
|
| 420 |
+
gap: 0.8rem;
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
.result-content {
|
| 424 |
+
padding: 1rem;
|
| 425 |
+
min-height: 50px;
|
| 426 |
+
display: flex;
|
| 427 |
+
flex-direction: column;
|
| 428 |
+
justify-content: center;
|
| 429 |
+
text-align: left;
|
| 430 |
+
}
|
| 431 |
+
.result-content p.info-message {
|
| 432 |
+
text-align: center;
|
| 433 |
+
margin-bottom: 0;
|
| 434 |
+
margin-top: 0;
|
| 435 |
+
}
|
| 436 |
+
.result-content ul {
|
| 437 |
+
margin: 0.5rem 0 0 1.5rem;
|
| 438 |
+
padding: 0;
|
| 439 |
+
list-style: disc;
|
| 440 |
+
}
|
| 441 |
+
.result-content ul li {
|
| 442 |
+
margin-bottom: 0.25rem;
|
| 443 |
+
}
|
| 444 |
+
.result-content h4 {
|
| 445 |
+
color: var(--secondary-color);
|
| 446 |
+
margin-top: 0.5rem;
|
| 447 |
+
margin-bottom: 0.5rem;
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
.scrollable-content {
|
| 451 |
+
max-height: 400px;
|
| 452 |
+
overflow-y: auto;
|
| 453 |
+
padding: 1rem;
|
| 454 |
+
border: 1px solid var(--border-color);
|
| 455 |
+
border-radius: 8px;
|
| 456 |
+
margin-top: 1rem;
|
| 457 |
+
background-color: var(--background-color);
|
| 458 |
+
}
|
| 459 |
+
.dark-mode .scrollable-content {
|
| 460 |
+
background-color: #333;
|
| 461 |
+
border-color: #616161;
|
| 462 |
+
}
|
| 463 |
+
.scrollable-content h4 {
|
| 464 |
+
color: var(--secondary-color);
|
| 465 |
+
margin-top: 1rem;
|
| 466 |
+
margin-bottom: 0.5rem;
|
| 467 |
+
}
|
| 468 |
+
|
| 469 |
+
|
| 470 |
+
.mic-checkbox-group {
|
| 471 |
+
margin-top: 1.5rem;
|
| 472 |
+
padding: 1rem;
|
| 473 |
+
border: 1px solid var(--border-color);
|
| 474 |
+
border-radius: 8px;
|
| 475 |
+
background-color: var(--container-bg-color);
|
| 476 |
+
box-shadow: 0 1px 5px rgba(0,0,0,0.05);
|
| 477 |
+
display: flex;
|
| 478 |
+
flex-wrap: wrap;
|
| 479 |
+
justify-content: center;
|
| 480 |
+
gap: 15px;
|
| 481 |
+
margin-bottom: 1.5rem;
|
| 482 |
+
}
|
| 483 |
+
|
| 484 |
+
.dark-mode .mic-checkbox-group {
|
| 485 |
+
background-color: #424242;
|
| 486 |
+
border-color: #616161;
|
| 487 |
+
}
|
| 488 |
+
|
| 489 |
+
.mic-checkbox-container {
|
| 490 |
+
display: flex;
|
| 491 |
+
align-items: center;
|
| 492 |
+
cursor: pointer;
|
| 493 |
+
font-size: 1rem;
|
| 494 |
+
color: var(--text-color);
|
| 495 |
+
user-select: none;
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
.mic-checkbox-container input[type="checkbox"] {
|
| 499 |
+
appearance: none;
|
| 500 |
+
-webkit-appearance: none;
|
| 501 |
+
width: 20px;
|
| 502 |
+
height: 20px;
|
| 503 |
+
border: 2px solid var(--primary-color);
|
| 504 |
+
border-radius: 4px;
|
| 505 |
+
margin-right: 8px;
|
| 506 |
+
cursor: pointer;
|
| 507 |
+
position: relative;
|
| 508 |
+
outline: none;
|
| 509 |
+
transition: all 0.2s ease-in-out;
|
| 510 |
+
}
|
| 511 |
+
|
| 512 |
+
.mic-checkbox-container input[type="checkbox"]:checked {
|
| 513 |
+
background-color: var(--primary-color);
|
| 514 |
+
border-color: var(--primary-color);
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
.mic-checkbox-container input[type="checkbox"]:checked::before {
|
| 518 |
+
content: '\2713';
|
| 519 |
+
display: block;
|
| 520 |
+
position: absolute;
|
| 521 |
+
top: 50%;
|
| 522 |
+
left: 50%;
|
| 523 |
+
transform: translate(-50%, -50%);
|
| 524 |
+
font-size: 14px;
|
| 525 |
+
color: white;
|
| 526 |
+
}
|
| 527 |
+
|
| 528 |
+
.mic-checkbox-container .mic-label {
|
| 529 |
+
margin-left: 5px;
|
| 530 |
+
font-weight: normal;
|
| 531 |
+
}
|
| 532 |
+
|
| 533 |
+
/* REMOVED: #user-email-input-group, #user-email, #email-status HTML elements */
|
| 534 |
+
/* Email elements are commented out in the HTML for clarity if you don't need them */
|
| 535 |
+
/* If you re-add them, ensure they are enabled in JS too. */
|
| 536 |
+
/* Keeping the original CSS styles in case you re-enable them later */
|
| 537 |
+
#user-email-input-group {
|
| 538 |
+
margin-top: 1.5rem;
|
| 539 |
+
margin-bottom: 1rem;
|
| 540 |
+
}
|
| 541 |
+
#user-email {
|
| 542 |
+
width: 100%;
|
| 543 |
+
padding: 0.7rem;
|
| 544 |
+
border: 1px solid var(--border-color);
|
| 545 |
+
border-radius: 5px;
|
| 546 |
+
box-sizing: border-box;
|
| 547 |
+
font-size: 1rem;
|
| 548 |
+
color: var(--text-color);
|
| 549 |
+
background-color: var(--container-bg-color);
|
| 550 |
+
}
|
| 551 |
+
#user-email:focus {
|
| 552 |
+
outline: none;
|
| 553 |
+
border-color: var(--secondary-color);
|
| 554 |
+
}
|
| 555 |
+
#email-status {
|
| 556 |
+
text-align: left;
|
| 557 |
+
font-size: 0.9rem;
|
| 558 |
+
margin-top: 0.3rem;
|
| 559 |
+
min-height: 1.2em;
|
| 560 |
+
}
|
| 561 |
+
/* End of email-related CSS */
|
| 562 |
+
|
| 563 |
+
|
| 564 |
+
@media (max-width: 768px) {
|
| 565 |
+
body {
|
| 566 |
+
padding: 10px;
|
| 567 |
+
}
|
| 568 |
+
.results-display-group {
|
| 569 |
+
grid-template-columns: 1fr;
|
| 570 |
+
}
|
| 571 |
+
footer {
|
| 572 |
+
padding-left: 10px;
|
| 573 |
+
padding-right: 10px;
|
| 574 |
+
margin-left: calc(-50vw + 50%);
|
| 575 |
+
margin-right: calc(-50vw / 2 + 50%);
|
| 576 |
+
}
|
| 577 |
+
}
|
| 578 |
+
|
| 579 |
+
.team-member-list {
|
| 580 |
+
list-style: none;
|
| 581 |
+
padding: 0;
|
| 582 |
+
display: flex;
|
| 583 |
+
flex-direction: column;
|
| 584 |
+
align-items: flex-start;
|
| 585 |
+
gap: 15px;
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
.team-member-list li {
|
| 589 |
+
display: flex;
|
| 590 |
+
align-items: center;
|
| 591 |
+
gap: 15px;
|
| 592 |
+
font-size: 1.1rem;
|
| 593 |
+
color: var(--text-color);
|
| 594 |
+
background-color: var(--background-color);
|
| 595 |
+
padding: 10px 15px;
|
| 596 |
+
border-radius: 8px;
|
| 597 |
+
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
|
| 598 |
+
width: 100%;
|
| 599 |
+
box-sizing: border-box;
|
| 600 |
+
}
|
| 601 |
+
|
| 602 |
+
.dark-mode .team-member-list li {
|
| 603 |
+
background-color: #333;
|
| 604 |
+
box-shadow: 0 1px 3px rgba(255,255,255,0.08);
|
| 605 |
+
}
|
| 606 |
+
|
| 607 |
+
.team-member-list img {
|
| 608 |
+
width: 60px;
|
| 609 |
+
height: 60px;
|
| 610 |
+
border-radius: 50%;
|
| 611 |
+
object-fit: cover;
|
| 612 |
+
border: 2px solid var(--secondary-color);
|
| 613 |
+
flex-shrink: 0;
|
| 614 |
+
}
|
| 615 |
+
</style>
|
| 616 |
+
|
| 617 |
+
</head>
|
| 618 |
+
<body>
|
| 619 |
+
|
| 620 |
+
<div class="container">
|
| 621 |
+
<div class="logos-container">
|
| 622 |
+
<img src="image2.png" alt="Tool Logo">
|
| 623 |
+
</div>
|
| 624 |
+
|
| 625 |
+
<div class="tabs">
|
| 626 |
+
<div class="tab active" data-tab="prediction">
|
| 627 |
+
<i class="fas fa-search"></i> Prediction
|
| 628 |
+
</div>
|
| 629 |
+
<div class="tab" data-tab="model">
|
| 630 |
+
<i class="fas fa-chart-line"></i> Models' Metrics & Sample run
|
| 631 |
+
</div>
|
| 632 |
+
<div class="tab" data-tab="about">
|
| 633 |
+
<i class="fas fa-info-circle"></i> About
|
| 634 |
+
</div>
|
| 635 |
+
<div class="tab" data-tab="usage">
|
| 636 |
+
<i class="fas fa-book"></i> Usage Guide
|
| 637 |
+
</div>
|
| 638 |
+
</div>
|
| 639 |
+
|
| 640 |
+
<div class="tab-content active" id="prediction">
|
| 641 |
+
<h2>AMP & MIC Predictor</h2>
|
| 642 |
+
<p>Enter an amino acid sequence (between 10 and 100 valid amino acids) or upload a FASTA file to predict AMP class and MIC values.</p>
|
| 643 |
+
<div class="input-group">
|
| 644 |
+
<input type="file" id="file-input" accept=".fasta,.fa,.fna">
|
| 645 |
+
<textarea id="sequence" placeholder="Enter amino acid sequence (10-100 Valid AAs) or upload a FASTA file..." maxlength="100"></textarea>
|
| 646 |
+
<div class="character-count">
|
| 647 |
+
<span id="char-count">0</span>/100
|
| 648 |
+
</div>
|
| 649 |
+
<i class="info-icon" id="info-icon">ⓘ</i>
|
| 650 |
+
<div class="tooltip">
|
| 651 |
+
Enter the amino acid sequence you want to classify or upload a FASTA file. The sequence must be between 10 and 100 characters long and contain only standard amino acid characters (ACDEFGHIKLMNPQRSTVWY).
|
| 652 |
+
</div>
|
| 653 |
+
</div>
|
| 654 |
+
|
| 655 |
+
<h3 style="margin-top: 0rem; margin-bottom: 0.5rem;">Select Bacteria for MIC Prediction</h3>
|
| 656 |
+
<p style="margin-top: 0; margin-bottom: 1rem;">Choose one or more bacteria for which you'd like to predict the Minimum Inhibitory Concentration (MIC) of the peptide. MIC prediction is only performed if the sequence is classified as an Antimicrobial Peptide (AMP).</p>
|
| 657 |
+
|
| 658 |
+
<div class="mic-checkbox-group">
|
| 659 |
+
<label class="mic-checkbox-container">
|
| 660 |
+
<input type="checkbox" id="mic-ecoli" value="e_coli" disabled>
|
| 661 |
+
<span class="mic-label">E.coli</span>
|
| 662 |
+
</label>
|
| 663 |
+
<label class="mic-checkbox-container">
|
| 664 |
+
<input type="checkbox" id="mic-paeruginosa" value="p_aeruginosa" disabled>
|
| 665 |
+
<span class="mic-label">P. aeruginosa</span>
|
| 666 |
+
</label>
|
| 667 |
+
<label class="mic-checkbox-container">
|
| 668 |
+
<input type="checkbox" id="mic-saureus" value="s_aureus" disabled>
|
| 669 |
+
<span class="mic-label">S. aureus</span>
|
| 670 |
+
</label>
|
| 671 |
+
<label class="mic-checkbox-container">
|
| 672 |
+
<input type="checkbox" id="mic-kpneumoniae" value="k_pneumoniae" disabled>
|
| 673 |
+
<span class="mic-label">K. pneumoniae</span>
|
| 674 |
+
</label>
|
| 675 |
+
</div>
|
| 676 |
+
|
| 677 |
+
<!-- REMOVED HTML FOR EMAIL INPUT SECTION -->
|
| 678 |
+
<!-- <div class="input-group" id="user-email-input-group" style="margin-top: 1.5rem; margin-bottom: 1rem;">
|
| 679 |
+
<label for="user-email" style="display:block; text-align:left; margin-bottom:0.5rem; font-weight:bold;">Please enter your Email Address for detailed results:<span style="color:red;">*</span></label>
|
| 680 |
+
<input type="email" id="user-email" placeholder="Enter your email to receive the PDF report" required>
|
| 681 |
+
<div id="email-error" class="error-message" style="text-align:left; font-size:0.9rem; margin-top:0.3rem; display:none;"></div>
|
| 682 |
+
<div id="email-status" style="text-align:left; font-size:0.9rem; margin-top:0.3rem; min-height: 1.2em;"></div>
|
| 683 |
+
</div> -->
|
| 684 |
+
|
| 685 |
+
<!-- Wrapper for estimated time and buttons -->
|
| 686 |
+
<div class="button-group-wrapper">
|
| 687 |
+
<div id="processing-time-info">Estimated processing time: around 30 seconds.</div>
|
| 688 |
+
<div class="button-group">
|
| 689 |
+
<button onclick="clearInput()" id="clear-btn">Clear Input</button>
|
| 690 |
+
<button onclick="classifySequenceDebounced()" id="predict-btn">Submit</button>
|
| 691 |
+
</div>
|
| 692 |
+
</div>
|
| 693 |
+
|
| 694 |
+
<div class="error-message" id="error"></div>
|
| 695 |
+
|
| 696 |
+
<div class="results-display-group">
|
| 697 |
+
<div class="result-box">
|
| 698 |
+
<div class="result-header"><i class="fas fa-file-alt"></i>Classification</div>
|
| 699 |
+
<div class="result-content" id="amp-classification-output">
|
| 700 |
+
<p class="info-message">The prediction will appear here.</p>
|
| 701 |
+
</div>
|
| 702 |
+
</div>
|
| 703 |
+
|
| 704 |
+
<div class="result-box">
|
| 705 |
+
<div class="result-header"><i class="fas fa-info-circle"></i> Additional Details</div>
|
| 706 |
+
<div class="result-content" id="additional-details-output">
|
| 707 |
+
<p class="info-message">The detailed report will appear here.</p>
|
| 708 |
+
<a id="download-link" style="display: none;">Download Detailed Report (PDF)</a>
|
| 709 |
+
</div>
|
| 710 |
+
</div>
|
| 711 |
+
</div>
|
| 712 |
+
</div>
|
| 713 |
+
|
| 714 |
+
<div class="tab-content" id="model">
|
| 715 |
+
<h2>Classifier Metrics</h2>
|
| 716 |
+
<p>The following table presents the performance metrics of our antimicrobial peptide classification model. These metrics were obtained on a held-out test set, separate from the training data.</p>
|
| 717 |
+
<table class="metrics-table">
|
| 718 |
+
<thead>
|
| 719 |
+
<tr>
|
| 720 |
+
<th>Metric</th>
|
| 721 |
+
<th>Value</th>
|
| 722 |
+
<th>Description</th>
|
| 723 |
+
</tr>
|
| 724 |
+
</thead>
|
| 725 |
+
<tbody>
|
| 726 |
+
<tr>
|
| 727 |
+
<td>Accuracy</td>
|
| 728 |
+
<td>0.963</td>
|
| 729 |
+
<td>The overall correctness of the model, representing the proportion of correctly classified sequences (both AMP and Non-AMP).</td>
|
| 730 |
+
</tr>
|
| 731 |
+
<tr>
|
| 732 |
+
<td>Precision</td>
|
| 733 |
+
<td>0.964</td>
|
| 734 |
+
<td>Out of all sequences predicted as AMPs, the proportion that are truly AMPs. A high precision indicates fewer false positives.</td>
|
| 735 |
+
</tr>
|
| 736 |
+
<tr>
|
| 737 |
+
<td>Recall</td>
|
| 738 |
+
<td>0.963</td>
|
| 739 |
+
<td>Out of all actual AMP sequences, the proportion that the model correctly identifies. A high recall indicates fewer false negatives.</td>
|
| 740 |
+
</tr>
|
| 741 |
+
<tr>
|
| 742 |
+
<td>F1-Score</td>
|
| 743 |
+
<td>0.963</td>
|
| 744 |
+
<td>The harmonic mean of precision and recall, providing a balanced measure of the model's performance.</td>
|
| 745 |
+
</tr>
|
| 746 |
+
<tr>
|
| 747 |
+
<td>Validation Accuracy</td>
|
| 748 |
+
<td>0.968</td>
|
| 749 |
+
<td>The accuracy of the model on a separate validation dataset, used during model development to tune hyperparameters.</td>
|
| 750 |
+
</tr>
|
| 751 |
+
</tbody>
|
| 752 |
+
</table>
|
| 753 |
+
|
| 754 |
+
<h2 style="margin-top: 2rem;">Regressor Metrics (MIC Prediction Models)</h2>
|
| 755 |
+
<p>The Minimum Inhibitory Concentration (MIC) prediction is handled by separate regressor models. Their performance metrics for each bacterium are detailed below:</p>
|
| 756 |
+
|
| 757 |
+
<table class="metrics-table">
|
| 758 |
+
<thead>
|
| 759 |
+
<tr>
|
| 760 |
+
<th>Bacterium</th>
|
| 761 |
+
<th>MSE (log)</th>
|
| 762 |
+
<th>MSE</th>
|
| 763 |
+
<th>R2</th>
|
| 764 |
+
<th>MAE</th>
|
| 765 |
+
<th>Pearson</th>
|
| 766 |
+
<th>Kendall</th>
|
| 767 |
+
</tr>
|
| 768 |
+
</thead>
|
| 769 |
+
<tbody>
|
| 770 |
+
<tr>
|
| 771 |
+
<td>E.coli</td>
|
| 772 |
+
<td>0.0481</td>
|
| 773 |
+
<td>0.4864</td>
|
| 774 |
+
<td>0.7023</td>
|
| 775 |
+
<td>0.1375</td>
|
| 776 |
+
<td>0.8394</td>
|
| 777 |
+
<td>0.6725</td>
|
| 778 |
+
</tr>
|
| 779 |
+
<tr>
|
| 780 |
+
<td>P. aeruginosa</td>
|
| 781 |
+
<td>0.0517</td>
|
| 782 |
+
<td>0.5227</td>
|
| 783 |
+
<td>0.6864</td>
|
| 784 |
+
<td>0.1233</td>
|
| 785 |
+
<td>0.8311</td>
|
| 786 |
+
<td>0.6922</td>
|
| 787 |
+
</tr>
|
| 788 |
+
<tr>
|
| 789 |
+
<td>S.aureus</td>
|
| 790 |
+
<td>0.0517</td>
|
| 791 |
+
<td>0.4988</td>
|
| 792 |
+
<td>0.6828</td>
|
| 793 |
+
<td>0.1472</td>
|
| 794 |
+
<td>0.8278</td>
|
| 795 |
+
<td>0.6536</td>
|
| 796 |
+
</tr>
|
| 797 |
+
<tr>
|
| 798 |
+
<td>K. pneumoniae</td>
|
| 799 |
+
<td>0.0538</td>
|
| 800 |
+
<td>0.4292</td>
|
| 801 |
+
<td>0.7416</td>
|
| 802 |
+
<td>0.1479</td>
|
| 803 |
+
<td>0.8693</td>
|
| 804 |
+
<td>0.7194</td>
|
| 805 |
+
</tr>
|
| 806 |
+
</tbody>
|
| 807 |
+
</table>
|
| 808 |
+
|
| 809 |
+
<h2 style="margin-top: 2rem;">Model Interpretability</h2>
|
| 810 |
+
<p>To understand how our model makes predictions, we use SHAP (SHapley Additive exPlanations) values globally and LIME (Local Interpretable Model-agnostic Explanations) locally. SHAP values help assess the overall contribution of each feature to model predictions across the dataset, while LIME explains the features influencing a single, specific prediction.</p>
|
| 811 |
+
|
| 812 |
+
<h3>Global SHAP Plot</h3>
|
| 813 |
+
<p>The SHAP plot below visualizes the features that most significantly influence the model's predictions *on average across all data*. Positive SHAP values generally contribute to the sequence being classified as AMP, while negative values contribute to Non-AMP classification.</p>
|
| 814 |
+
|
| 815 |
+
<div id="shap-plot-container">
|
| 816 |
+
<img src="shap.png" alt="SHAP Plot" >
|
| 817 |
+
</div>
|
| 818 |
+
|
| 819 |
+
<h3>Interpretation of Global SHAP Plot</h3>
|
| 820 |
+
<div class="scrollable-content">
|
| 821 |
+
<p>Based on the SHAP plot, the model's predictions for Antimicrobial Peptides (AMPs) are influenced by a combination of sequence-based, structural, and biophysical features. Here’s a breakdown of the key features and their biological implications:</p>
|
| 822 |
+
<h4>A. Sequence-Based Features</h4>
|
| 823 |
+
<h5>APAAC13 & APAAC5 (Amphiphilic Pseudo-Amino Acid Composition)</h5>
|
| 824 |
+
<ul>
|
| 825 |
+
<li><strong>Description:</strong> These features encode hydrophobicity, charge, and side-chain properties, reflecting the amphiphilic nature of the peptide.</li>
|
| 826 |
+
<li><strong>Interpretation:</b> Higher APAAC values have a positive SHAP impact, indicating they are predictive of AMP activity. This suggests that the model values amphiphilic sequences, which are crucial for disrupting bacterial membranes.</li>
|
| 827 |
+
</ul>
|
| 828 |
+
<h5>Amino Acid Composition (M, C)</h5>
|
| 829 |
+
<ul>
|
| 830 |
+
<li><strong>M (Methionine):</strong>
|
| 831 |
+
<ul>
|
| 832 |
+
<li><strong>Description:</strong> Methionine is often associated with structural stability in peptides.</li>
|
| 833 |
+
<li><strong>Interpretation:</strong> The plot suggests Methionine content has a positive influence, possibly contributing to the stability of AMP candidates.</li>
|
| 834 |
+
</ul>
|
| 835 |
+
</li>
|
| 836 |
+
<li><strong>C (Cysteine):</strong>
|
| 837 |
+
<ul>
|
| 838 |
+
<li><strong>Description:</strong> Cysteine is known for forming disulfide bonds, which can stabilize AMP structures like defensins.</li>
|
| 839 |
+
<li><strong>Interpretation:</strong> High cysteine content appears to have a positive SHAP impact. This could be because disulfide-stabilized AMPs often exhibit enhanced antimicrobial action.</li>
|
| 840 |
+
</ul>
|
| 841 |
+
</li>
|
| 842 |
+
</ul>
|
| 843 |
+
<h4>B. Structural and Biophysical Features</h4>
|
| 844 |
+
<ul>
|
| 845 |
+
<li><strong>HydrophobicityD3001:</strong>
|
| 846 |
+
<ul>
|
| 847 |
+
<li><strong>Description:</strong> Represents the overall hydrophobicity of the peptide sequence.</li>
|
| 848 |
+
<li><strong>Interpretation:</strong> Hydrophobicity is shown to be a critical feature. More hydrophobic peptides are strongly favored for AMP classification, aligning with the understanding that hydrophobicity is essential for membrane insertion and disruption.</li>
|
| 849 |
+
</ul>
|
| 850 |
+
</li>
|
| 851 |
+
<li><strong>PolarityD1001:</strong>
|
| 852 |
+
<ul>
|
| 853 |
+
<li><strong>Description:</b> Measures the polarity of the peptide sequence.</li>
|
| 854 |
+
<li><strong>Interpretation:</strong> The model considers polarity, likely in balance with hydrophobicity. An optimal AMP efficacy is often linked to having both hydrophobic and polar residues to facilitate membrane interaction and solubility.</li>
|
| 855 |
+
</ul>
|
| 856 |
+
</li>
|
| 857 |
+
<li><strong>Solvent Accessibility (SolventAccessibilityD3001):</strong>
|
| 858 |
+
<ul>
|
| 859 |
+
<li><strong>Description:</strong> Reflects how exposed the residues are to the solvent (water).</li>
|
| 860 |
+
<li><strong>Interpretation:</strong> Solvent-accessible residues positively contribute to AMP prediction. This might indicate that exposed residues facilitate interaction with bacterial membranes or the surrounding environment.</li>
|
| 861 |
+
</ul>
|
| 862 |
+
</li>
|
| 863 |
+
<li><strong>Charge (ChargeD2001):</strong>
|
| 864 |
+
<ul>
|
| 865 |
+
<li><strong>Description:</b> Represents the net charge of the peptide.</li>
|
| 866 |
+
<li><strong>Interpretation:</strong> Charge is a significant positive predictor. Most AMPs are cationic, enabling them to interact with negatively charged bacterial membranes. Higher charge, as indicated by positive SHAP values, typically enhances antimicrobial potency.</li>
|
| 867 |
+
</ul>
|
| 868 |
+
</li>
|
| 869 |
+
<li><strong>PolarizabilityD3001 & NormalizedVDWVD3001:</b>
|
| 870 |
+
<ul>
|
| 871 |
+
<li><strong>Description:</b> These features relate to electronic distribution (Polarizability) and steric effects (NormalizedVDWVD) of the peptide.</li>
|
| 872 |
+
<li><strong>Interpretation:</strong> These properties impact membrane penetration and peptide-membrane interactions. Their positive SHAP values suggest they are important for AMP activity, possibly by influencing how the peptide inserts into and destabilizes membranes.</li>
|
| 873 |
+
</ul>
|
| 874 |
+
</li>
|
| 875 |
+
</ul>
|
| 876 |
+
<h4>C. Geary Autocorrelation Features</h4>
|
| 877 |
+
<p>Geary autocorrelation descriptors reflect spatial properties of peptides, encoding information about the adhesion and distribution of physicochemical properties along the sequence.</p>
|
| 878 |
+
<ul>
|
| 879 |
+
<li><strong>GearyAuto_Hydrophobicity30:</strong>
|
| 880 |
+
<ul>
|
| 881 |
+
<li><strong>Description:</strong> Encodes the clustering of hydrophobic residues within a spatial lag of 30.</li>
|
| 882 |
+
<li><strong>Interpretation:</b> Higher values of hydrophobicity autocorrelation are positively associated with AMP prediction. This likely reflects the importance of hydrophobic clustering in forming amphipathic structures, such as α-helices, which are common and effective in AMPs.</li>
|
| 883 |
+
</ul>
|
| 884 |
+
</li>
|
| 885 |
+
<li><strong>GearyAuto_Steric30 & GearyAuto_Steric29:</strong>
|
| 886 |
+
<ul>
|
| 887 |
+
<li><strong>Description:</strong> Reflect peptide backbone flexibility and steric properties at spatial lags of 30 and 29.</li>
|
| 888 |
+
<li><strong>Interpretation:</strong> These features have a positive SHAP impact, suggesting that a certain degree of peptide backbone flexibility may be beneficial for AMP action. Flexibility could enhance the peptide's ability to interact with and adapt to diverse bacterial membrane structures.</li>
|
| 889 |
+
</ul>
|
| 890 |
+
</li>
|
| 891 |
+
<li><strong>GearyAuto_ResidueASA30:</strong>
|
| 892 |
+
<ul>
|
| 893 |
+
<li><strong>Description:</strong> Indicates the autocorrelation of accessible surface area of residues at a spatial lag of 30.</li>
|
| 894 |
+
<li><strong>Interpretation:</b> Higher autocorrelation of residue accessible surface area is favored. This could mean that a consistent pattern of residue exposure, possibly with higher exposure of charged or polar residues, improves bacterial targeting or membrane interaction.</li>
|
| 895 |
+
</ul>
|
| 896 |
+
</li>
|
| 897 |
+
</ul>
|
| 898 |
+
</div>
|
| 899 |
+
|
| 900 |
+
<h3>Sample Run</h3>
|
| 901 |
+
<p>You can test the model with various sequences to understand its behavior. Here are a few examples:</p>
|
| 902 |
+
<ul>
|
| 903 |
+
<li><strong>Test 1:</strong> Long Sequence of 99 AAs (P-AMP) - MEKAALIFIGLLLFSTCTQILAQSCNNDSDCTNLKCATKNIKCEQNKCQCLDERYIRA
|
| 904 |
+
ISLNTRSPRCNVQSCIDHCKAIGEVIYVCFTYHCYCRKPPM</li>
|
| 905 |
+
<li><strong>Test 2:</strong> Long Sequence of 99 AAs (Non-AMP) - MKSLLPLAILAALAVAALCYESHESMESYEVSPFTTRRNANTFISPQQRWHAK
|
| 906 |
+
AQERVRELNKPAQEINREACDDYKLCERYALIYGYNAAYNRYFRQR</li>
|
| 907 |
+
<li><strong>Test 3:</strong> Short Sequence of 51 AAs (P-AMP) - SLQGGAPNFPQPSQQNGGWQVSPDLGRDDKGNTRGQIEIQNKGKDHDFNAG</li>
|
| 908 |
+
<li><strong>Test 4:</b> Short Sequence of 50 AAs (Non-AMP) - MKPLKQKVSITLDEDVIKNLKTLAEECDRSLSQYINLILKEHLKNLDQQ</li>
|
| 909 |
+
<li><strong>Test 5:</strong> Invalid Characters (eg. X) -
|
| 910 |
+
MEKAALIFIGLLLFSTCTQILAQSC(XX).</li>
|
| 911 |
+
</ul>
|
| 912 |
+
</div>
|
| 913 |
+
|
| 914 |
+
<div class="tab-content" id="about">
|
| 915 |
+
<h2>About This Tool</h2>
|
| 916 |
+
<p>This web application provides a user-friendly interface for classifying amino acid sequences as either Antimicrobial Peptides (AMPs) or Non-Antimicrobial Peptides (Non-AMPs). AMPs are crucial components of the innate immune system, offering defense against a wide range of pathogens.</p>
|
| 917 |
+
<h3>Model Selection Criteria</h3>
|
| 918 |
+
<p>To identify the most effective model, our team rigorously evaluated over 225 combinations of feature extraction and selection methods across four different machine learning models for each target organism. The evaluation included both classification and regression tasks, with a focus on predicting antimicrobial activity and estimating minimum inhibitory concentration (MIC) values. The final model was selected based on the following criteria:</p>
|
| 919 |
+
<ul>
|
| 920 |
+
<li><strong>High Accuracy, F1-score, and Validation Accuracy:</strong> The model achieved excellent performance metrics on a held-out test set, demonstrating its ability to generalize to unseen data.</li>
|
| 921 |
+
<li><strong>Robustness to Sequence Length Variations:</b> The model performs consistently well on sequences of varying lengths, within the specified range (10-100 amino acids).</li>
|
| 922 |
+
<li><strong>Generalization Ability:</strong> The model was trained and evaluated on diverse datasets to ensure its ability to classify a broad range of AMP sequences.</li>
|
| 923 |
+
<li><strong>Robust regression capability:</b> Assessed using Mean Squared Error (MSE), R-squared (R²), Pearson correlation, and Kendall’s tau, the model demonstrated strong agreement between predicted and true MIC values.</li>
|
| 924 |
+
</ul>
|
| 925 |
+
<h3>Intended Use</h3>
|
| 926 |
+
<p>This tool is intended for research and educational purposes. It can be a valuable resource for researchers studying antimicrobial peptides and developing new therapeutic strategies. However, it is not a replacement for laboratory-based experimental validation.</p>
|
| 927 |
+
<h3>Our Team</h3>
|
| 928 |
+
<ul class="team-member-list">
|
| 929 |
+
<li><img src="team-member-1.jpg" alt="Ali Magdi"> Ali Magdi - Computational Biologist</li>
|
| 930 |
+
<li><img src="team-member-2.jpg" alt="Ahmed Amr"> Ahmed Amr - Computational Biologist</li>
|
| 931 |
+
<li><img src="team-member-3.jpg" alt="Omar Loay"> Omar Loay - Molecular Biologist</li>
|
| 932 |
+
<li><img src="team-member-4.jpg" alt="Prof. Eman Badr"> Prof. Eman Badr - Full Professor and Director of BCBU</li>
|
| 933 |
+
</ul>
|
| 934 |
+
<h3>Acknowledgements</h3>
|
| 935 |
+
<p>We extend our gratitude to the following organizations for their support:</p>
|
| 936 |
+
<ul>
|
| 937 |
+
<li>Bioinformatics and Computational Biology Unit at Zewail City.</li>
|
| 938 |
+
<li>The Centre for Genomics at Zewail City.</li>
|
| 939 |
+
</ul>
|
| 940 |
+
<h3>Contact</h3>
|
| 941 |
+
<p>For questions, inquiries, or feedback, please reach out to us at: <a href="mailto:epicamp.sup@gmail.com">epicamp.sup@gmail.com</a></p>
|
| 942 |
+
</div>
|
| 943 |
+
|
| 944 |
+
<div class="tab-content" id="usage">
|
| 945 |
+
<h2>Usage Guide</h2>
|
| 946 |
+
<p>Follow these steps to use the AMP Classifier:</p>
|
| 947 |
+
<h3>Step 1: Prepare Your Sequence</h3>
|
| 948 |
+
<ul>
|
| 949 |
+
<li>You can either enter the amino acid sequence directly or upload a FASTA file.</li>
|
| 950 |
+
<li>Ensure your sequence contains only standard amino acid characters (ACDEFGHIKLMNPQRSTVWY).</li>
|
| 951 |
+
<li>The sequence length must be between 10 and 100 amino acids.</li>
|
| 952 |
+
</ul>
|
| 953 |
+
<h3>Step 2: Input the Sequence</h3>
|
| 954 |
+
<ul>
|
| 955 |
+
<li><strong>Direct Input:</strong> Type or paste your sequence into the text area provided.</li>
|
| 956 |
+
<li><strong>FASTA File Upload:</b> Click the "Choose File" button and select your .fasta, .fa, or .fna file.</li>
|
| 957 |
+
<li>The character count will update as you type or upload a sequence.</li>
|
| 958 |
+
<!-- REMOVED: Email input instruction -->
|
| 959 |
+
</ul>
|
| 960 |
+
<h3>Step 3: Analyze the Sequence</h3>
|
| 961 |
+
<ul>
|
| 962 |
+
<li>Click the "Submit" button.</li>
|
| 963 |
+
<li>A message indicating the estimated processing time will be visible above the buttons, and the button itself will show elapsed time.</li>
|
| 964 |
+
</ul>
|
| 965 |
+
<h3>Step 4: View the Results</h3>
|
| 966 |
+
<ul>
|
| 967 |
+
<li>Once the analysis is complete, the prediction (AMP or Non-AMP) will be displayed in the "AMP Classification" box.</li>
|
| 968 |
+
<li>A link to "Download Detailed Report (PDF)" will appear in the "Additional Details" box if the report was generated successfully.</li>
|
| 969 |
+
<!-- REMOVED: Email sending notification -->
|
| 970 |
+
</ul>
|
| 971 |
+
<h3>Step 5: Clear the Input</h3>
|
| 972 |
+
<ul>
|
| 973 |
+
<li>To analyze another sequence, click the "Clear Input" button. This will reset the input fields and results.</li>
|
| 974 |
+
</ul>
|
| 975 |
+
<h3>Troubleshooting</h3>
|
| 976 |
+
<ul>
|
| 977 |
+
<li><strong>Invalid Characters:</b> If you see an error message about invalid characters, double-check that your sequence contains only standard amino acid characters.</li>
|
| 978 |
+
<li><strong>Sequence Length:</strong> Ensure your sequence is between 10 and 100 characters long.</li>
|
| 979 |
+
<li><strong>Invalid FASTA Format:</strong> If you encounter an error with a FASTA file, make sure the file is correctly formatted.</li>
|
| 980 |
+
<!-- REMOVED: Email troubleshooting -->
|
| 981 |
+
</ul>
|
| 982 |
+
</div>
|
| 983 |
+
</div>
|
| 984 |
+
|
| 985 |
+
<footer>
|
| 986 |
+
<p>© 2025, Bioinformatics and Computational biology Unit, BCBU</p>
|
| 987 |
+
<address>
|
| 988 |
+
Bioinformatics and Computational biology Unit at Zewail City,<br>
|
| 989 |
+
Ahmed Zewail Street, October Gardens, Giza,<br>
|
| 990 |
+
Egypt
|
| 991 |
+
</address>
|
| 992 |
+
</footer>
|
| 993 |
+
|
| 994 |
+
<script>
|
| 995 |
+
// ***** START: IMPORTANT CONFIGURATION - YOU MUST EDIT THESE *****
|
| 996 |
+
// This frontend will be hosted on Hugging Face Spaces, allowing direct access
|
| 997 |
+
// to the Gradio backend on Hugging Face Spaces without CORS issues.
|
| 998 |
+
// The email functionality has been removed as per your request to focus on prediction.
|
| 999 |
+
const GRADIO_HF_SPACE_RAW_URL = "https://huggingface.co/spaces/nonzeroexit/AMP-Classifier";
|
| 1000 |
+
|
| 1001 |
+
// This is the direct URL to the Hugging Face Gradio Space.
|
| 1002 |
+
const GRADIO_PREDICTION_TARGET_URL = GRADIO_HF_SPACE_RAW_URL;
|
| 1003 |
+
|
| 1004 |
+
// Email-related constants are removed since the functionality is gone.
|
| 1005 |
+
// ***** END: IMPORTANT CONFIGURATION *****
|
| 1006 |
+
|
| 1007 |
+
|
| 1008 |
+
const sequenceInput = document.getElementById('sequence');
|
| 1009 |
+
const charCount = document.getElementById('char-count');
|
| 1010 |
+
const errorDiv = document.getElementById('error');
|
| 1011 |
+
const predictBtn = document.getElementById('predict-btn');
|
| 1012 |
+
const fileInput = document.getElementById('file-input');
|
| 1013 |
+
const downloadLink = document.getElementById('download-link');
|
| 1014 |
+
const ampClassificationOutput = document.getElementById('amp-classification-output');
|
| 1015 |
+
const additionalDetailsOutput = document.getElementById('additional-details-output');
|
| 1016 |
+
const micCheckboxes = document.querySelectorAll('.mic-checkbox-group input[type="checkbox"]');
|
| 1017 |
+
const tabs = document.querySelectorAll('.tab');
|
| 1018 |
+
const tabContents = document.querySelectorAll('.tab-content');
|
| 1019 |
+
|
| 1020 |
+
// Email-related HTML elements are removed, so these JavaScript variables are no longer needed
|
| 1021 |
+
// const userEmailInput = document.getElementById('user-email');
|
| 1022 |
+
// const emailErrorDiv = document.getElementById('email-error');
|
| 1023 |
+
// const emailStatusDiv = document.getElementById('email-status');
|
| 1024 |
+
|
| 1025 |
+
let clientInstance;
|
| 1026 |
+
let debounceTimer;
|
| 1027 |
+
let countUpIntervalId; // For count-up timer
|
| 1028 |
+
|
| 1029 |
+
tabs.forEach(tab => {
|
| 1030 |
+
tab.addEventListener('click', () => {
|
| 1031 |
+
tabs.forEach(t => t.classList.remove('active'));
|
| 1032 |
+
tabContents.forEach(c => c.classList.remove('active'));
|
| 1033 |
+
tab.classList.add('active');
|
| 1034 |
+
document.getElementById(tab.dataset.tab).classList.add('active');
|
| 1035 |
+
});
|
| 1036 |
+
});
|
| 1037 |
+
|
| 1038 |
+
async function initClient() {
|
| 1039 |
+
let gradioClientClass;
|
| 1040 |
+
try {
|
| 1041 |
+
const module = await import("https://esm.sh/@gradio/client");
|
| 1042 |
+
gradioClientClass = module.Client || module.default;
|
| 1043 |
+
|
| 1044 |
+
if (!gradioClientClass || typeof gradioClientClass.connect !== 'function') {
|
| 1045 |
+
console.error("Gradio module loaded but does not export a 'Client' class with a static 'connect' method or a usable default export for connection:", module);
|
| 1046 |
+
throw new Error("Gradio client library export structure not recognizable. This may indicate an extremely new or old Gradio client version has a different API, or a bundling issue with esm.sh.");
|
| 1047 |
+
}
|
| 1048 |
+
} catch (importError) {
|
| 1049 |
+
console.error("Failed to dynamically import Gradio client module from esm.sh:", importError);
|
| 1050 |
+
showError("Could not load core prediction library. Please ensure a stable internet connection and try clearing your browser's cache (hard refresh). If the issue persists, the CDN (esm.sh) or Gradio client library itself might have changed or be experiencing issues.");
|
| 1051 |
+
if (predictBtn) predictBtn.disabled = true;
|
| 1052 |
+
return;
|
| 1053 |
+
}
|
| 1054 |
+
|
| 1055 |
+
try {
|
| 1056 |
+
// Connecting directly to the Hugging Face Gradio Space.
|
| 1057 |
+
// This will work because the frontend (this HTML) is now also hosted on Hugging Face.
|
| 1058 |
+
clientInstance = await gradioClientClass.connect(GRADIO_PREDICTION_TARGET_URL);
|
| 1059 |
+
console.log("Gradio client for prediction initialized successfully directly to:", GRADIO_PREDICTION_TARGET_URL);
|
| 1060 |
+
|
| 1061 |
+
if(sequenceInput && validateSequence(sequenceInput.value)) {
|
| 1062 |
+
if(predictBtn) predictBtn.disabled = false;
|
| 1063 |
+
}
|
| 1064 |
+
|
| 1065 |
+
} catch (error) {
|
| 1066 |
+
console.error("Failed to initialize Gradio client for prediction (direct attempt):", error);
|
| 1067 |
+
showError(`Failed to connect to the classifier service. Please check if the Hugging Face Gradio Space (${GRADIO_HF_SPACE_RAW_URL}) is active and publicly accessible.`);
|
| 1068 |
+
if (predictBtn) predictBtn.disabled = true;
|
| 1069 |
+
}
|
| 1070 |
+
}
|
| 1071 |
+
|
| 1072 |
+
window.onload = function() {
|
| 1073 |
+
initClient();
|
| 1074 |
+
if (document.getElementById('info-icon')) {
|
| 1075 |
+
document.getElementById('info-icon').addEventListener('mouseenter', showTooltip);
|
| 1076 |
+
document.getElementById('info-icon').addEventListener('mouseleave', hideTooltip);
|
| 1077 |
+
}
|
| 1078 |
+
if (fileInput) fileInput.addEventListener('change', handleFileSelect);
|
| 1079 |
+
|
| 1080 |
+
// Email-related event listener removed
|
| 1081 |
+
// if(userEmailInput) {
|
| 1082 |
+
// userEmailInput.addEventListener('input', () => {
|
| 1083 |
+
// validateEmail(userEmailInput.value);
|
| 1084 |
+
// if (emailStatusDiv) emailStatusDiv.textContent = '';
|
| 1085 |
+
// });
|
| 1086 |
+
// } else {
|
| 1087 |
+
// console.error("Email input field with ID 'user-email' not found.");
|
| 1088 |
+
// }
|
| 1089 |
+
|
| 1090 |
+
clearInput();
|
| 1091 |
+
};
|
| 1092 |
+
|
| 1093 |
+
function showTooltip() {
|
| 1094 |
+
const tooltip = document.querySelector('.tooltip');
|
| 1095 |
+
if (tooltip) tooltip.style.display = 'block';
|
| 1096 |
+
}
|
| 1097 |
+
|
| 1098 |
+
function hideTooltip() {
|
| 1099 |
+
const tooltip = document.querySelector('.tooltip');
|
| 1100 |
+
if (tooltip) tooltip.style.display = 'none';
|
| 1101 |
+
}
|
| 1102 |
+
|
| 1103 |
+
function clearInput() {
|
| 1104 |
+
if(sequenceInput) sequenceInput.value = '';
|
| 1105 |
+
if(fileInput) fileInput.value = '';
|
| 1106 |
+
if(charCount) charCount.textContent = '0';
|
| 1107 |
+
clearError();
|
| 1108 |
+
|
| 1109 |
+
if(downloadLink) {
|
| 1110 |
+
downloadLink.style.display = 'none';
|
| 1111 |
+
downloadLink.href = '#';
|
| 1112 |
+
downloadLink.innerHTML = 'Download Detailed Report (PDF)';
|
| 1113 |
+
}
|
| 1114 |
+
|
| 1115 |
+
if(ampClassificationOutput) ampClassificationOutput.innerHTML = '<p class="info-message">The prediction will appear here.</p>';
|
| 1116 |
+
if(additionalDetailsOutput) {
|
| 1117 |
+
additionalDetailsOutput.innerHTML = '<p class="info-message">The detailed report will appear here.</p>'; // Simplified message
|
| 1118 |
+
if(downloadLink && !additionalDetailsOutput.contains(downloadLink)) {
|
| 1119 |
+
additionalDetailsOutput.appendChild(downloadLink);
|
| 1120 |
+
}
|
| 1121 |
+
if(downloadLink) downloadLink.style.display = 'none';
|
| 1122 |
+
}
|
| 1123 |
+
|
| 1124 |
+
if(micCheckboxes) micCheckboxes.forEach(checkbox => {
|
| 1125 |
+
checkbox.checked = false;
|
| 1126 |
+
checkbox.disabled = true;
|
| 1127 |
+
});
|
| 1128 |
+
|
| 1129 |
+
if (countUpIntervalId) {
|
| 1130 |
+
clearInterval(countUpIntervalId);
|
| 1131 |
+
countUpIntervalId = null;
|
| 1132 |
+
}
|
| 1133 |
+
|
| 1134 |
+
if(predictBtn) {
|
| 1135 |
+
predictBtn.disabled = true;
|
| 1136 |
+
predictBtn.textContent = 'Submit';
|
| 1137 |
+
}
|
| 1138 |
+
|
| 1139 |
+
// Email-related input clearing removed
|
| 1140 |
+
// if (userEmailInput) userEmailInput.value = '';
|
| 1141 |
+
// if (emailErrorDiv) {
|
| 1142 |
+
// emailErrorDiv.textContent = '';
|
| 1143 |
+
// emailErrorDiv.style.display = 'none';
|
| 1144 |
+
// }
|
| 1145 |
+
// if (emailStatusDiv) emailStatusDiv.textContent = '';
|
| 1146 |
+
}
|
| 1147 |
+
|
| 1148 |
+
function handleFileSelect(event) {
|
| 1149 |
+
const file = event.target.files[0];
|
| 1150 |
+
if (!file) {
|
| 1151 |
+
if (sequenceInput && sequenceInput.dataset.source === 'file') {
|
| 1152 |
+
clearInput();
|
| 1153 |
+
}
|
| 1154 |
+
return;
|
| 1155 |
+
}
|
| 1156 |
+
|
| 1157 |
+
const allowedExtensions = ['.fasta', '.fa', '.fna'];
|
| 1158 |
+
const fileName = file.name.toLowerCase();
|
| 1159 |
+
const isValidExtension = allowedExtensions.some(ext => fileName.endsWith(ext));
|
| 1160 |
+
|
| 1161 |
+
if (!isValidExtension) {
|
| 1162 |
+
showError('Invalid file type. Please upload a .fasta, .fa, or .fna file.');
|
| 1163 |
+
if(fileInput) fileInput.value = '';
|
| 1164 |
+
if(micCheckboxes) micCheckboxes.forEach(checkbox => checkbox.disabled = true);
|
| 1165 |
+
if(predictBtn) predictBtn.disabled = true;
|
| 1166 |
+
return;
|
| 1167 |
+
}
|
| 1168 |
+
|
| 1169 |
+
clearError();
|
| 1170 |
+
const reader = new FileReader();
|
| 1171 |
+
reader.onload = function(e) {
|
| 1172 |
+
try {
|
| 1173 |
+
const parsedSeq = parseFASTA(e.target.result);
|
| 1174 |
+
if (parsedSeq) {
|
| 1175 |
+
if(sequenceInput) {
|
| 1176 |
+
sequenceInput.value = parsedSeq;
|
| 1177 |
+
sequenceInput.dataset.source = 'file';
|
| 1178 |
+
}
|
| 1179 |
+
updateCharacterCount();
|
| 1180 |
+
validateSequence(parsedSeq);
|
| 1181 |
+
} else {
|
| 1182 |
+
showError("No valid sequence found in FASTA file.");
|
| 1183 |
+
if(fileInput) fileInput.value = '';
|
| 1184 |
+
if(sequenceInput) sequenceInput.dataset.source = '';
|
| 1185 |
+
if(micCheckboxes) micCheckboxes.forEach(checkbox => checkbox.disabled = true);
|
| 1186 |
+
if(predictBtn) predictBtn.disabled = true;
|
| 1187 |
+
}
|
| 1188 |
+
} catch (error) {
|
| 1189 |
+
console.error("Error in FASTA parsing:", error);
|
| 1190 |
+
showError(error.message || "Error processing FASTA file.");
|
| 1191 |
+
if(fileInput) fileInput.value = '';
|
| 1192 |
+
if(sequenceInput) sequenceInput.dataset.source = '';
|
| 1193 |
+
if(micCheckboxes) micCheckboxes.forEach(checkbox => checkbox.disabled = true);
|
| 1194 |
+
if(predictBtn) predictBtn.disabled = true;
|
| 1195 |
+
}
|
| 1196 |
+
};
|
| 1197 |
+
reader.onerror = function(error) {
|
| 1198 |
+
console.error("FileReader error:", error);
|
| 1199 |
+
showError("Error reading file.");
|
| 1200 |
+
if(fileInput) fileInput.value = '';
|
| 1201 |
+
if(sequenceInput) sequenceInput.dataset.source = '';
|
| 1202 |
+
if(micCheckboxes) micCheckboxes.forEach(checkbox => checkbox.disabled = true);
|
| 1203 |
+
if(predictBtn) predictBtn.disabled = true;
|
| 1204 |
+
};
|
| 1205 |
+
reader.readAsText(file);
|
| 1206 |
+
}
|
| 1207 |
+
|
| 1208 |
+
function parseFASTA(text) {
|
| 1209 |
+
const lines = text.trim().split(/[\r\n]+/);
|
| 1210 |
+
let sequenceData = '';
|
| 1211 |
+
let headerFound = false;
|
| 1212 |
+
for (const line of lines) {
|
| 1213 |
+
const trimmedLine = line.trim();
|
| 1214 |
+
if (trimmedLine.startsWith('>')) {
|
| 1215 |
+
if (headerFound && sequenceData) { return sequenceData.toUpperCase(); }
|
| 1216 |
+
headerFound = true; sequenceData = '';
|
| 1217 |
+
} else if (headerFound) {
|
| 1218 |
+
sequenceData += trimmedLine.replace(/\s/g, '');
|
| 1219 |
+
} else if (!trimmedLine.startsWith('>') && trimmedLine.length > 0) {
|
| 1220 |
+
sequenceData += trimmedLine.replace(/\s/g, '');
|
| 1221 |
+
}
|
| 1222 |
+
}
|
| 1223 |
+
if (!headerFound && sequenceData) { console.warn("No FASTA header found."); }
|
| 1224 |
+
else if (!sequenceData && headerFound) { throw new Error("FASTA header found but no sequence.");}
|
| 1225 |
+
else if (!sequenceData && !headerFound && lines.some(l=>l.trim().length>0) && !lines.some(l=>l.trim().startsWith('>'))){
|
| 1226 |
+
sequenceData = lines.join('').replace(/\s/g, '');
|
| 1227 |
+
} else if (!sequenceData && !headerFound && lines.every(l=>l.trim().length === 0)) {
|
| 1228 |
+
throw new Error("FASTA file is empty.");
|
| 1229 |
+
}
|
| 1230 |
+
if (sequenceData) { return sequenceData.toUpperCase(); }
|
| 1231 |
+
else { throw new Error("No valid sequence found in FASTA."); }
|
| 1232 |
+
}
|
| 1233 |
+
|
| 1234 |
+
|
| 1235 |
+
function validateSequence(seqToValidate) {
|
| 1236 |
+
let isValid = true;
|
| 1237 |
+
let errorMessage = '';
|
| 1238 |
+
const currentLength = seqToValidate.length;
|
| 1239 |
+
|
| 1240 |
+
if (!seqToValidate) {
|
| 1241 |
+
isValid = false;
|
| 1242 |
+
} else if (/[^ACDEFGHIKLMNPQRSTVWY]/i.test(seqToValidate)) {
|
| 1243 |
+
errorMessage = 'Invalid characters in sequence. Only standard amino acid characters (ACDEFGHIKLMNPQRSTVWY) are allowed.';
|
| 1244 |
+
isValid = false;
|
| 1245 |
+
} else if (currentLength < 10 || currentLength > 100) {
|
| 1246 |
+
errorMessage = `Sequence length (${currentLength}) must be between 10 and 100 characters.`;
|
| 1247 |
+
isValid = false;
|
| 1248 |
+
}
|
| 1249 |
+
|
| 1250 |
+
if (isValid) {
|
| 1251 |
+
clearError();
|
| 1252 |
+
if(predictBtn) predictBtn.disabled = false;
|
| 1253 |
+
} else {
|
| 1254 |
+
if (errorMessage) showError(errorMessage); else clearError();
|
| 1255 |
+
if(predictBtn) predictBtn.disabled = true;
|
| 1256 |
+
}
|
| 1257 |
+
|
| 1258 |
+
if(micCheckboxes) micCheckboxes.forEach(checkbox => {
|
| 1259 |
+
checkbox.disabled = !isValid;
|
| 1260 |
+
if (!isValid) checkbox.checked = false;
|
| 1261 |
+
});
|
| 1262 |
+
return isValid;
|
| 1263 |
+
}
|
| 1264 |
+
|
| 1265 |
+
function updateCharacterCount() {
|
| 1266 |
+
if(!sequenceInput || !charCount) return;
|
| 1267 |
+
const currentLength = sequenceInput.value.length;
|
| 1268 |
+
charCount.textContent = currentLength;
|
| 1269 |
+
charCount.style.color = currentLength > 100 ? 'var(--warning-color)' : 'var(--text-color)';
|
| 1270 |
+
}
|
| 1271 |
+
|
| 1272 |
+
if(sequenceInput) {
|
| 1273 |
+
sequenceInput.addEventListener('input', () => {
|
| 1274 |
+
sequenceInput.dataset.source = 'manual';
|
| 1275 |
+
updateCharacterCount();
|
| 1276 |
+
if (sequenceInput) validateSequence(sequenceInput.value);
|
| 1277 |
+
});
|
| 1278 |
+
|
| 1279 |
+
sequenceInput.addEventListener('paste', (e) => {
|
| 1280 |
+
e.preventDefault();
|
| 1281 |
+
const paste = (e.clipboardData || window.clipboardData).getData('text');
|
| 1282 |
+
const cleanPaste = paste.replace(/[\s\r\n]+/g, '').toUpperCase();
|
| 1283 |
+
|
| 1284 |
+
const selectionStart = sequenceInput.selectionStart;
|
| 1285 |
+
const selectionEnd = sequenceInput.selectionEnd;
|
| 1286 |
+
const currentText = sequenceInput.value;
|
| 1287 |
+
let newText = currentText.substring(0, selectionStart) + cleanPaste + currentText.substring(selectionEnd);
|
| 1288 |
+
|
| 1289 |
+
if (newText.length > parseInt(sequenceInput.maxLength, 10)) {
|
| 1290 |
+
newText = newText.substring(0, parseInt(sequenceInput.maxLength, 10));
|
| 1291 |
+
}
|
| 1292 |
+
|
| 1293 |
+
sequenceInput.value = newText;
|
| 1294 |
+
sequenceInput.dataset.source = 'manual';
|
| 1295 |
+
updateCharacterCount();
|
| 1296 |
+
validateSequence(newText);
|
| 1297 |
+
sequenceInput.selectionStart = sequenceInput.selectionEnd = selectionStart + cleanPaste.length;
|
| 1298 |
+
});
|
| 1299 |
+
|
| 1300 |
+
sequenceInput.addEventListener('keypress', (e) => {
|
| 1301 |
+
if (e.key.length === 1 && !/^[ACDEFGHIKLMNPQRSTVWY]$/i.test(e.key)) {
|
| 1302 |
+
e.preventDefault();
|
| 1303 |
+
} else {
|
| 1304 |
+
clearError();
|
| 1305 |
+
}
|
| 1306 |
+
});
|
| 1307 |
+
}
|
| 1308 |
+
|
| 1309 |
+
|
| 1310 |
+
function showError(message) {
|
| 1311 |
+
if(errorDiv) {
|
| 1312 |
+
errorDiv.textContent = message;
|
| 1313 |
+
errorDiv.style.display = 'block';
|
| 1314 |
+
}
|
| 1315 |
+
}
|
| 1316 |
+
|
| 1317 |
+
function clearError() {
|
| 1318 |
+
if(errorDiv) {
|
| 1319 |
+
errorDiv.style.display = 'none';
|
| 1320 |
+
errorDiv.textContent = '';
|
| 1321 |
+
}
|
| 1322 |
+
}
|
| 1323 |
+
|
| 1324 |
+
// Email validation removed
|
| 1325 |
+
// function validateEmail(emailToVal) {
|
| 1326 |
+
// // ... (validation logic)
|
| 1327 |
+
// }
|
| 1328 |
+
|
| 1329 |
+
async function classifySequenceDebounced() {
|
| 1330 |
+
clearTimeout(debounceTimer);
|
| 1331 |
+
debounceTimer = setTimeout(classifySequence, 300);
|
| 1332 |
+
}
|
| 1333 |
+
|
| 1334 |
+
async function classifySequence() {
|
| 1335 |
+
if (!clientInstance) {
|
| 1336 |
+
showError("Classifier service is not ready. Please wait a moment and try again.");
|
| 1337 |
+
console.error("Gradio client instance is not initialized when classifySequence called.");
|
| 1338 |
+
if (predictBtn) { predictBtn.disabled = false; predictBtn.textContent = 'Submit'; }
|
| 1339 |
+
return;
|
| 1340 |
+
}
|
| 1341 |
+
|
| 1342 |
+
const currentSequence = sequenceInput ? sequenceInput.value.trim().toUpperCase() : "";
|
| 1343 |
+
// const recipientEmail = userEmailInput ? userEmailInput.value.trim() : ""; // Removed email var
|
| 1344 |
+
|
| 1345 |
+
if (!validateSequence(currentSequence)) return;
|
| 1346 |
+
// Email validation removed
|
| 1347 |
+
// if (!validateEmail(recipientEmail)) {
|
| 1348 |
+
// if (userEmailInput) userEmailInput.focus();
|
| 1349 |
+
// return;
|
| 1350 |
+
// }
|
| 1351 |
+
|
| 1352 |
+
clearError();
|
| 1353 |
+
// Email-related error/status clearing removed
|
| 1354 |
+
// if (emailErrorDiv) { emailErrorDiv.style.display = 'none'; emailErrorDiv.textContent = ''; }
|
| 1355 |
+
// if (emailStatusDiv) emailStatusDiv.textContent = '';
|
| 1356 |
+
|
| 1357 |
+
if (predictBtn) predictBtn.disabled = true;
|
| 1358 |
+
if (ampClassificationOutput) ampClassificationOutput.innerHTML = '<p class="info-message">Analyzing...</p>';
|
| 1359 |
+
if (additionalDetailsOutput) {
|
| 1360 |
+
additionalDetailsOutput.innerHTML = '<p class="info-message">Generating detailed report...</p>';
|
| 1361 |
+
if(downloadLink && !additionalDetailsOutput.contains(downloadLink)) {
|
| 1362 |
+
additionalDetailsOutput.appendChild(downloadLink);
|
| 1363 |
+
}
|
| 1364 |
+
if(downloadLink) downloadLink.style.display = 'none';
|
| 1365 |
+
}
|
| 1366 |
+
if (micCheckboxes) micCheckboxes.forEach(checkbox => checkbox.disabled = true);
|
| 1367 |
+
|
| 1368 |
+
let secondsElapsed = 0;
|
| 1369 |
+
if(predictBtn) predictBtn.textContent = `Processing... (${secondsElapsed}s elapsed)`;
|
| 1370 |
+
|
| 1371 |
+
if (countUpIntervalId) clearInterval(countUpIntervalId);
|
| 1372 |
+
countUpIntervalId = setInterval(() => {
|
| 1373 |
+
secondsElapsed++;
|
| 1374 |
+
if(predictBtn) predictBtn.textContent = `Processing... (${secondsElapsed}s elapsed)`;
|
| 1375 |
+
}, 1000);
|
| 1376 |
+
|
| 1377 |
+
|
| 1378 |
+
let micDataForPdfFromPrediction = {};
|
| 1379 |
+
let ampLabelFromPrediction = 'Unknown';
|
| 1380 |
+
let ampConfidenceFromPrediction = 0;
|
| 1381 |
+
let limeFeaturesForPdfFromPrediction = [];
|
| 1382 |
+
|
| 1383 |
+
try {
|
| 1384 |
+
// This call will now work from a Hugging Face Space frontend.
|
| 1385 |
+
const classificationResult = await clientInstance.predict("/predict", [currentSequence]);
|
| 1386 |
+
console.log("Gradio Result (Prediction):", classificationResult);
|
| 1387 |
+
|
| 1388 |
+
if (!classificationResult || !classificationResult.data || typeof classificationResult.data[0] !== 'string') {
|
| 1389 |
+
throw new Error("Unexpected result format from prediction server.");
|
| 1390 |
+
}
|
| 1391 |
+
const rawTextOutput = classificationResult.data[0];
|
| 1392 |
+
console.log("Raw text output from Gradio (Prediction):\n", rawTextOutput);
|
| 1393 |
+
|
| 1394 |
+
const lines = rawTextOutput.split('\n').map(line => line.trim()).filter(Boolean);
|
| 1395 |
+
const labelRegex = /Prediction:\s*(.+)/i;
|
| 1396 |
+
const confidenceRegex = /Confidence:\s*([\d.]+)%/i;
|
| 1397 |
+
const micSectionHeaderRegex = /Predicted MIC Values \(μM\):/i;
|
| 1398 |
+
const topFeaturesSectionHeaderRegex = /Top Features Influencing Prediction/i;
|
| 1399 |
+
const micLineRegex = /-\s*([^:]+?):\s*((?:[\d.]+)|(?:Error:.*)|(?:N\/A)|(?:Could not process)|(?:Skipped))/i;
|
| 1400 |
+
const featureExtractorRegex = /-\s*(.+?)\s*:\s*([+-]?[\d.]+)/i;
|
| 1401 |
+
|
| 1402 |
+
const labelMatch = rawTextOutput.match(labelRegex);
|
| 1403 |
+
if (labelMatch && labelMatch[1]) ampLabelFromPrediction = labelMatch[1];
|
| 1404 |
+
else console.warn("Could not parse AMP Label from output.");
|
| 1405 |
+
|
| 1406 |
+
const confidenceMatch = rawTextOutput.match(confidenceRegex);
|
| 1407 |
+
if (confidenceMatch && confidenceMatch[1]) ampConfidenceFromPrediction = parseFloat(confidenceMatch[1]) / 100;
|
| 1408 |
+
else console.warn("Could not parse Confidence from output.");
|
| 1409 |
+
|
| 1410 |
+
let currentSection = null;
|
| 1411 |
+
micDataForPdfFromPrediction = {};
|
| 1412 |
+
limeFeaturesForPdfFromPrediction = [];
|
| 1413 |
+
|
| 1414 |
+
for (const line of lines) {
|
| 1415 |
+
if (micSectionHeaderRegex.test(line)) { currentSection = 'mic'; continue; }
|
| 1416 |
+
if (topFeaturesSectionHeaderRegex.test(line)) { currentSection = 'lime_features'; continue; }
|
| 1417 |
+
|
| 1418 |
+
if (currentSection === 'mic') {
|
| 1419 |
+
const micLineMatch = line.match(micLineRegex);
|
| 1420 |
+
if (micLineMatch && micLineMatch[1] && micLineMatch[2]) {
|
| 1421 |
+
const bacteriumDisplayName = micLineMatch[1].trim();
|
| 1422 |
+
const micValueOrError = micLineMatch[2].trim();
|
| 1423 |
+
micDataForPdfFromPrediction[bacteriumDisplayName] = !isNaN(parseFloat(micValueOrError)) ? parseFloat(micValueOrError) : micValueOrError;
|
| 1424 |
+
}
|
| 1425 |
+
} else if (currentSection === 'lime_features') {
|
| 1426 |
+
const featureMatch = line.match(featureExtractorRegex);
|
| 1427 |
+
if (featureMatch) {
|
| 1428 |
+
const featureDescription = featureMatch[1].trim();
|
| 1429 |
+
const featureValue = parseFloat(featureMatch[2]);
|
| 1430 |
+
if (!isNaN(featureValue)) {
|
| 1431 |
+
limeFeaturesForPdfFromPrediction.push({ feature: featureDescription, condition: '', value: featureValue });
|
| 1432 |
+
} else { console.warn(`Could not parse LIME feature value from line: ${line}`); }
|
| 1433 |
+
} else {
|
| 1434 |
+
if (line.trim().length > 0 && !line.includes('---') && !line.toLowerCase().includes("influencing prediction")) {
|
| 1435 |
+
console.warn(`Line not parsed as LIME feature: ${line}`);
|
| 1436 |
+
}
|
| 1437 |
+
}
|
| 1438 |
+
}
|
| 1439 |
+
}
|
| 1440 |
+
|
| 1441 |
+
// PDF generation is still handled here, but email sending is skipped.
|
| 1442 |
+
// A dummy recipientEmail is passed to satisfy the function signature, but won't be used.
|
| 1443 |
+
await generatePDFReportAndSendEmail(currentSequence, ampLabelFromPrediction, ampConfidenceFromPrediction, micDataForPdfFromPrediction, limeFeaturesForPdfFromPrediction, "dummy@example.com");
|
| 1444 |
+
|
| 1445 |
+
if(ampClassificationOutput) ampClassificationOutput.innerHTML = `<p style="font-size: 1.3rem; font-weight: bold; color: ${ampLabelFromPrediction.toLowerCase().includes('non-amp') ? 'var(--clear-button-bg)' : 'var(--success-color)'}; margin: 0; text-align: center;">${ampLabelFromPrediction}</p>`;
|
| 1446 |
+
|
| 1447 |
+
if(additionalDetailsOutput && downloadLink) {
|
| 1448 |
+
if (downloadLink.style.display === 'block' && downloadLink.href && downloadLink.href !== '#' && !downloadLink.href.endsWith('#')) {
|
| 1449 |
+
additionalDetailsOutput.innerHTML = '<p class="info-message">Detailed report available:</p>';
|
| 1450 |
+
if (!additionalDetailsOutput.contains(downloadLink)) {
|
| 1451 |
+
additionalDetailsOutput.appendChild(downloadLink);
|
| 1452 |
+
}
|
| 1453 |
+
} else {
|
| 1454 |
+
additionalDetailsOutput.innerHTML = '<p class="info-message" style="color: var(--warning-color);">Could not generate PDF report for download.</p>';
|
| 1455 |
+
if (downloadLink.parentNode === additionalDetailsOutput) {
|
| 1456 |
+
downloadLink.style.display = 'none';
|
| 1457 |
+
}
|
| 1458 |
+
}
|
| 1459 |
+
}
|
| 1460 |
+
|
| 1461 |
+
if (ampLabelFromPrediction.toLowerCase().includes('amp') && !ampLabelFromPrediction.toLowerCase().includes('non-amp')) {
|
| 1462 |
+
if(micCheckboxes) micCheckboxes.forEach(checkbox => checkbox.disabled = false);
|
| 1463 |
+
} else {
|
| 1464 |
+
if(micCheckboxes) micCheckboxes.forEach(checkbox => { checkbox.checked = false; checkbox.disabled = true; });
|
| 1465 |
+
}
|
| 1466 |
+
|
| 1467 |
+
} catch (error) {
|
| 1468 |
+
console.error("Error during prediction or processing (direct attempt):", error);
|
| 1469 |
+
showError(`Prediction failed: ${error.message || "Unknown error."} Please check the Hugging Face Gradio Space for any issues.`);
|
| 1470 |
+
if(ampClassificationOutput) ampClassificationOutput.innerHTML = '<p style="text-align: center; color: var(--clear-button-bg);">Error in Prediction</p>';
|
| 1471 |
+
if(additionalDetailsOutput) {
|
| 1472 |
+
additionalDetailsOutput.innerHTML = '<p style="text-align: center; color: var(--clear-button-bg);">Detailed report not available (due to prediction error).</p>';
|
| 1473 |
+
if(downloadLink) {
|
| 1474 |
+
if(!additionalDetailsOutput.contains(downloadLink)) additionalDetailsOutput.appendChild(downloadLink);
|
| 1475 |
+
downloadLink.style.display = 'none';
|
| 1476 |
+
}
|
| 1477 |
+
}
|
| 1478 |
+
// Email status will not be updated here as email is removed.
|
| 1479 |
+
} finally {
|
| 1480 |
+
if (countUpIntervalId) { clearInterval(countUpIntervalId); countUpIntervalId = null; }
|
| 1481 |
+
if (predictBtn) { predictBtn.disabled = false; predictBtn.textContent = 'Submit';}
|
| 1482 |
+
}
|
| 1483 |
+
}
|
| 1484 |
+
|
| 1485 |
+
async function getBase64Image(imgSrc) {
|
| 1486 |
+
return new Promise((resolve) => {
|
| 1487 |
+
if (!imgSrc) { resolve(null); return; }
|
| 1488 |
+
const img = new Image();
|
| 1489 |
+
img.crossOrigin = 'Anonymous';
|
| 1490 |
+
img.onload = () => {
|
| 1491 |
+
if (img.naturalWidth === 0 || img.naturalHeight === 0) {
|
| 1492 |
+
console.warn(`getBase64Image: Image at "${imgSrc}" has zero dimensions.`);
|
| 1493 |
+
resolve(null); return;
|
| 1494 |
+
}
|
| 1495 |
+
try {
|
| 1496 |
+
const canvas = document.createElement("canvas");
|
| 1497 |
+
canvas.width = img.naturalWidth; canvas.height = img.naturalHeight;
|
| 1498 |
+
const ctx = canvas.getContext("2d");
|
| 1499 |
+
ctx.drawImage(img, 0, 0);
|
| 1500 |
+
resolve(canvas.toDataURL("image/png"));
|
| 1501 |
+
} catch (e) {
|
| 1502 |
+
console.error(`Error converting image "${imgSrc}" to base64:`, e);
|
| 1503 |
+
resolve(null);
|
| 1504 |
+
}
|
| 1505 |
+
};
|
| 1506 |
+
img.onerror = () => {
|
| 1507 |
+
console.error(`Failed to load image for base64: "${imgSrc}"`);
|
| 1508 |
+
resolve(null);
|
| 1509 |
+
};
|
| 1510 |
+
img.src = imgSrc;
|
| 1511 |
+
});
|
| 1512 |
+
}
|
| 1513 |
+
|
| 1514 |
+
async function generatePDFReportContent(sequenceForPdf, predictionForPdf, confidenceForPdf, micResultsForPdf, limeFeaturesForPdf) {
|
| 1515 |
+
if (!window.jspdf || !window.jspdf.jsPDF) { console.error("jsPDF is not loaded."); return null; }
|
| 1516 |
+
const { jsPDF } = window.jspdf; const pdf = new jsPDF();
|
| 1517 |
+
const primaryC = [0,77,64], textC=[51,51,51], successC=[39,174,96], errorC=[231,76,60], headerTextC=[44,62,80];
|
| 1518 |
+
const pageWidth = pdf.internal.pageSize.width; let yPos = 15;
|
| 1519 |
+
|
| 1520 |
+
let toolLogoB64 = null, shapPlotB64 = null;
|
| 1521 |
+
const toolLogoEl = document.querySelector('.logos-container img');
|
| 1522 |
+
if (toolLogoEl && toolLogoEl.src) toolLogoB64 = await getBase64Image(toolLogoEl.src);
|
| 1523 |
+
const shapImgEl = document.querySelector('#shap-plot-container img');
|
| 1524 |
+
if (shapImgEl && shapImgEl.src) shapPlotB64 = await getBase64Image('shap.png');
|
| 1525 |
+
|
| 1526 |
+
if (toolLogoB64) {
|
| 1527 |
+
const img = new Image(); img.src = toolLogoB64; await new Promise(r=>img.onload=r);
|
| 1528 |
+
if(img.naturalWidth > 0){
|
| 1529 |
+
const logoW = pageWidth*0.8, ratio=img.naturalHeight/img.naturalWidth, logoH=logoW*ratio, logoX=(pageWidth-logoW)/2;
|
| 1530 |
+
pdf.addImage(toolLogoB64,'PNG',logoX,yPos,logoW,logoH); yPos+=logoH+10;
|
| 1531 |
+
} else {yPos+=15;}
|
| 1532 |
+
} else { yPos+=15; }
|
| 1533 |
+
|
| 1534 |
+
yPos += 5;
|
| 1535 |
+
|
| 1536 |
+
pdf.setFont("helvetica","bold"); pdf.setFontSize(28); pdf.setTextColor(headerTextC[0],headerTextC[1],headerTextC[2]);
|
| 1537 |
+
pdf.text("Anti-microbial Peptides Report",pageWidth/2,yPos,{align:"center"}); yPos+=28+10;
|
| 1538 |
+
pdf.setFontSize(16); pdf.setTextColor(primaryC[0],primaryC[1],primaryC[2]); pdf.text("Input Sequence:",20,yPos); yPos+=7;
|
| 1539 |
+
pdf.setFontSize(10); pdf.setTextColor(textC[0],textC[1],textC[2]);
|
| 1540 |
+
const seqLines=pdf.splitTextToSize(sequenceForPdf,pageWidth-40); pdf.text(seqLines,20,yPos); yPos+=(seqLines.length*(pdf.getFontSize()/pdf.internal.scaleFactor)*1.15)+18;
|
| 1541 |
+
|
| 1542 |
+
if(yPos+35 > pdf.internal.pageSize.height-30){pdf.addPage(); yPos=20;}
|
| 1543 |
+
pdf.setFontSize(16); pdf.setTextColor(primaryC[0],primaryC[1],primaryC[2]); pdf.text("Analysis Summary:",20,yPos); yPos+=8;
|
| 1544 |
+
const predHead=[['Metric','Value']], predBody=[['Prediction',predictionForPdf],['Confidence',`${(confidenceForPdf*100).toFixed(2)}%`]];
|
| 1545 |
+
pdf.autoTable({startY:yPos, head:predHead, body:predBody, theme:'striped',
|
| 1546 |
+
headStyles:{fillColor:primaryC,textColor:255,fontSize:11,fontStyle:'bold',halign:'left'},
|
| 1547 |
+
bodyStyles:{textColor:textC,fontSize:10,cellPadding:2,lineWidth:0.1,lineColor:[200,200,200]},
|
| 1548 |
+
columnStyles:{0:{cellWidth:70,halign:'left'},1:{halign:'left',cellWidth:'auto'}},
|
| 1549 |
+
didParseCell: (data) => {
|
| 1550 |
+
if(data.section==='body' && data.column.index === 1 && data.row.raw[0]==='Prediction'){
|
| 1551 |
+
data.cell.styles.fontStyle='bold';
|
| 1552 |
+
data.cell.styles.textColor = predictionForPdf.toLowerCase().includes('non-amp') ? errorC : successC;
|
| 1553 |
+
} else if (data.section === 'body' && data.column.index === 1 && data.row.raw[0]==='Confidence'){
|
| 1554 |
+
data.cell.styles.textColor = successC;
|
| 1555 |
+
}
|
| 1556 |
+
}
|
| 1557 |
+
});
|
| 1558 |
+
yPos=pdf.lastAutoTable.finalY+20;
|
| 1559 |
+
|
| 1560 |
+
const micDataForTable = [];
|
| 1561 |
+
if (micResultsForPdf && Object.keys(micResultsForPdf).length > 0) {
|
| 1562 |
+
Object.entries(micResultsForPdf).forEach(([bacterium, micVal]) => {
|
| 1563 |
+
let isChecked = false;
|
| 1564 |
+
if(micCheckboxes) {
|
| 1565 |
+
micCheckboxes.forEach(cb => {
|
| 1566 |
+
const cbLabel = cb.parentElement.querySelector('.mic-label').textContent.trim();
|
| 1567 |
+
if (cb.checked && bacterium.toLowerCase().includes(cbLabel.toLowerCase().split('.')[0])) {
|
| 1568 |
+
isChecked = true;
|
| 1569 |
+
}
|
| 1570 |
+
});
|
| 1571 |
+
}
|
| 1572 |
+
if(isChecked) {
|
| 1573 |
+
micDataForTable.push([bacterium, typeof micVal === 'number' ? micVal.toFixed(3) : String(micVal)]);
|
| 1574 |
+
}
|
| 1575 |
+
});
|
| 1576 |
+
}
|
| 1577 |
+
|
| 1578 |
+
if(micDataForTable.length > 0){
|
| 1579 |
+
if(yPos+35 > pdf.internal.pageSize.height-30){pdf.addPage(); yPos=20;}
|
| 1580 |
+
pdf.setFontSize(16); pdf.setTextColor(primaryC[0],primaryC[1],primaryC[2]); pdf.text("Predicted MIC (µM):",20,yPos); yPos+=8;
|
| 1581 |
+
const micHead=[['Bacterium','MIC (µM)']];
|
| 1582 |
+
pdf.autoTable({startY:yPos, head:micHead, body:micDataForTable, theme:'striped',
|
| 1583 |
+
headStyles:{fillColor:primaryC,textColor:255,fontSize:11,fontStyle:'bold',halign:'center'},
|
| 1584 |
+
columnStyles:{0:{fontStyle:'italic',cellWidth:90,halign:'left'},1:{halign:'right',cellWidth:'auto'}},
|
| 1585 |
+
styles:{cellPadding:2,fontSize:10,textColor:textC,lineColor:[200,200,200],lineWidth:0.1},
|
| 1586 |
+
});
|
| 1587 |
+
yPos=pdf.lastAutoTable.finalY+20;
|
| 1588 |
+
} else {
|
| 1589 |
+
if(yPos+25 > pdf.internal.pageSize.height-30){pdf.addPage(); yPos=20;}
|
| 1590 |
+
pdf.setFontSize(10); pdf.setTextColor(100,100,100);
|
| 1591 |
+
pdf.text("No MIC prediction displayed (non-AMP, no bacteria selected, or no valid predictions for selected bacteria).", 20, yPos); yPos+=15;
|
| 1592 |
+
}
|
| 1593 |
+
|
| 1594 |
+
if(!limeFeaturesForPdf || limeFeaturesForPdf.length === 0){ limeFeaturesForPdf = []; }
|
| 1595 |
+
|
| 1596 |
+
if(limeFeaturesForPdf.length > 0) {
|
| 1597 |
+
pdf.addPage(); yPos=20;
|
| 1598 |
+
pdf.setFontSize(16); pdf.setTextColor(primaryC[0],primaryC[1],primaryC[2]);
|
| 1599 |
+
pdf.text("Top Features Influencing Prediction (Local XAI by LIME)",20,yPos);
|
| 1600 |
+
yPos+=8;
|
| 1601 |
+
const limeHead = [['Feature Description','Importance (LIME Weight)']];
|
| 1602 |
+
const limeBody = limeFeaturesForPdf.sort((a,b)=>Math.abs(b.value)-Math.abs(a.value))
|
| 1603 |
+
.map(f=>[f.feature, typeof f.value === 'number' ? f.value.toFixed(4) : 'N/A']);
|
| 1604 |
+
pdf.autoTable({startY:yPos, head:limeHead, body:limeBody, theme:'grid',
|
| 1605 |
+
headStyles:{fillColor:primaryC,textColor:255,fontSize:10,fontStyle:'bold'},
|
| 1606 |
+
styles:{fontSize:9,cellPadding:1.5,lineColor:[220,220,220],lineWidth:0.1},
|
| 1607 |
+
columnStyles:{0:{cellWidth:100},1:{halign:'right'}},
|
| 1608 |
+
didDrawCell: (data) => {
|
| 1609 |
+
if(data.column.index===1 && data.row.section === 'body'){
|
| 1610 |
+
const val = parseFloat(String(data.cell.raw).trim());
|
| 1611 |
+
if(!isNaN(val)){
|
| 1612 |
+
if(val > 0) pdf.setTextColor(successC[0],successC[1],successC[2]);
|
| 1613 |
+
else if (val < 0) pdf.setTextColor(errorC[0],errorC[1],errorC[2]);
|
| 1614 |
+
}
|
| 1615 |
+
}
|
| 1616 |
+
}
|
| 1617 |
+
});
|
| 1618 |
+
yPos=pdf.lastAutoTable.finalY+20;
|
| 1619 |
+
} else {
|
| 1620 |
+
if(yPos+20 > pdf.internal.pageSize.height-30){pdf.addPage();yPos=20;}
|
| 1621 |
+
else { pdf.addPage(); yPos=20; }
|
| 1622 |
+
pdf.setFontSize(10); pdf.setTextColor(100,100,100);
|
| 1623 |
+
pdf.text("LIME explanation data not available or not generated for this prediction.", 20, yPos); yPos+=15;
|
| 1624 |
+
}
|
| 1625 |
+
|
| 1626 |
+
if (shapPlotB64) {
|
| 1627 |
+
const img = new Image(); img.src = shapPlotB64; await new Promise(r=>img.onload=r);
|
| 1628 |
+
if(img.naturalWidth > 0){
|
| 1629 |
+
let imgW=img.naturalWidth,imgH=img.naturalHeight,ratio=imgW/imgH,maxH=100,maxW=pageWidth-40;
|
| 1630 |
+
if(imgW>maxW){imgW=maxW;imgH=imgW/ratio;} if(imgH>maxH){imgH=maxH;imgW=imgH*ratio;}
|
| 1631 |
+
if(yPos+imgH+30 > pdf.internal.pageSize.height-30){pdf.addPage(); yPos=20;}
|
| 1632 |
+
pdf.setFontSize(16); pdf.setTextColor(primaryC[0],primaryC[1],primaryC[2]);
|
| 1633 |
+
pdf.text("Global SHAP Feature Importance:",20,yPos);
|
| 1634 |
+
yPos+=8;
|
| 1635 |
+
try{pdf.addImage(shapPlotB64,'PNG',(pageWidth-imgW)/2,yPos,imgW,imgH); yPos+=imgH+10;}
|
| 1636 |
+
catch(e){console.error("Error adding SHAP PDF:",e); yPos+=10;}
|
| 1637 |
+
}
|
| 1638 |
+
} else {
|
| 1639 |
+
if(yPos+20 > pdf.internal.pageSize.height-30){pdf.addPage();yPos=20;}
|
| 1640 |
+
pdf.setFontSize(10); pdf.setTextColor(100,100,100);
|
| 1641 |
+
pdf.text("Global SHAP plot image not available for this report.", 20, yPos); yPos+=15;
|
| 1642 |
+
}
|
| 1643 |
+
|
| 1644 |
+
addPageNumbersAndFooter(pdf);
|
| 1645 |
+
pdf.setPage(pdf.internal.getNumberOfPages());
|
| 1646 |
+
pdf.setFontSize(10); pdf.setTextColor(primaryC[0],primaryC[1],primaryC[2]);
|
| 1647 |
+
pdf.text("For inquiries: epicamp.sup@gmail.com", pageWidth/2, pdf.internal.pageSize.height-18, {align:"center"});
|
| 1648 |
+
|
| 1649 |
+
return pdf;
|
| 1650 |
+
}
|
| 1651 |
+
|
| 1652 |
+
function addPageNumbersAndFooter(doc) {
|
| 1653 |
+
const pageCount = doc.internal.getNumberOfPages();
|
| 1654 |
+
for (let i = 1; i <= pageCount; i++) {
|
| 1655 |
+
doc.setPage(i);
|
| 1656 |
+
doc.setFontSize(9); doc.setTextColor(120,120,120);
|
| 1657 |
+
doc.text(`Page ${i} of ${pageCount}`, doc.internal.pageSize.width - 20, doc.internal.pageSize.height - 7, { align: "right" });
|
| 1658 |
+
doc.text("Generated by EPIC-AMP @ Zewail City", pageWidth / 2, doc.internal.pageSize.height - 7, { align: "center" });
|
| 1659 |
+
}
|
| 1660 |
+
}
|
| 1661 |
+
|
| 1662 |
+
// The entire email sending logic (generatePDFReportAndSendEmail and sendReportViaApi)
|
| 1663 |
+
// is now adjusted: generatePDFReportAndSendEmail is still called to create the PDF,
|
| 1664 |
+
// but the email sending part within it (via sendReportViaApi) is removed.
|
| 1665 |
+
async function generatePDFReportAndSendEmail(sequenceForPdfAndEmail, predictionForPdfAndEmail, confidenceForPdfAndEmail, micResultsForPdfAndEmail, limeFeaturesForPdfAndEmail, recipientEmailForSending) {
|
| 1666 |
+
const pdfDoc = await generatePDFReportContent(sequenceForPdfAndEmail, predictionForPdfAndEmail, confidenceForPdfAndEmail, micResultsForPdfAndEmail, limeFeaturesForPdfAndEmail);
|
| 1667 |
+
|
| 1668 |
+
if (!pdfDoc) {
|
| 1669 |
+
console.error("PDF generation failed, cannot set download link.");
|
| 1670 |
+
if(downloadLink) {
|
| 1671 |
+
downloadLink.innerHTML = "PDF Generation Error";
|
| 1672 |
+
downloadLink.href="#";
|
| 1673 |
+
downloadLink.style.display = 'block';
|
| 1674 |
+
}
|
| 1675 |
+
// No email status update here
|
| 1676 |
+
return;
|
| 1677 |
+
}
|
| 1678 |
+
|
| 1679 |
+
const pdfBlob = pdfDoc.output('blob');
|
| 1680 |
+
const pdfUrl = URL.createObjectURL(pdfBlob);
|
| 1681 |
+
const pdfFileName = `EPIC-AMP_Report_${sequenceForPdfAndEmail.substring(0, 10).replace(/[^a-zA-Z0-9]/g, '')}_${new Date().toISOString().slice(0, 10)}.pdf`;
|
| 1682 |
+
|
| 1683 |
+
if(downloadLink){
|
| 1684 |
+
downloadLink.href = pdfUrl;
|
| 1685 |
+
downloadLink.download = pdfFileName;
|
| 1686 |
+
downloadLink.innerHTML = `<i class="fas fa-download"></i> Download Report (PDF)`;
|
| 1687 |
+
downloadLink.style.display = 'block';
|
| 1688 |
+
}
|
| 1689 |
+
|
| 1690 |
+
// Email sending part is completely removed as requested.
|
| 1691 |
+
// if (recipientEmailForSending) {
|
| 1692 |
+
// // ... (email sending logic)
|
| 1693 |
+
// }
|
| 1694 |
+
}
|
| 1695 |
+
|
| 1696 |
+
// sendReportViaApi function is entirely removed as it's no longer needed.
|
| 1697 |
+
// async function sendReportViaApi(...) { ... }
|
| 1698 |
+
</script>
|
| 1699 |
+
|
| 1700 |
+
</body>
|
| 1701 |
+
</html>
|