Update app.py
Browse files
app.py
CHANGED
|
@@ -276,16 +276,21 @@ def run_real_prediction(file):
|
|
| 276 |
return summary, bar, dense, gauge, status
|
| 277 |
|
| 278 |
|
| 279 |
-
def
|
|
|
|
|
|
|
| 280 |
if REAL_MODEL_READY:
|
| 281 |
cols = REAL_FEATURES
|
| 282 |
else:
|
| 283 |
cols = EXPLORE_GENES
|
| 284 |
-
|
| 285 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 286 |
return path
|
| 287 |
|
| 288 |
-
|
| 289 |
# ----------------------------------------------------------------------
|
| 290 |
# Explore tab logic (10-gene sandbox, explicitly the weaker panel)
|
| 291 |
# ----------------------------------------------------------------------
|
|
|
|
| 276 |
return summary, bar, dense, gauge, status
|
| 277 |
|
| 278 |
|
| 279 |
+
def download_sample_genome():
|
| 280 |
+
import tempfile
|
| 281 |
+
import numpy as np
|
| 282 |
if REAL_MODEL_READY:
|
| 283 |
cols = REAL_FEATURES
|
| 284 |
else:
|
| 285 |
cols = EXPLORE_GENES
|
| 286 |
+
np.random.seed(42) # reproducible
|
| 287 |
+
row = {c: np.random.randint(0, 2) for c in cols}
|
| 288 |
+
df = pd.DataFrame([row], index=["sample_genome"])
|
| 289 |
+
fd, path = tempfile.mkstemp(suffix=".csv")
|
| 290 |
+
os.close(fd)
|
| 291 |
+
df.to_csv(path)
|
| 292 |
return path
|
| 293 |
|
|
|
|
| 294 |
# ----------------------------------------------------------------------
|
| 295 |
# Explore tab logic (10-gene sandbox, explicitly the weaker panel)
|
| 296 |
# ----------------------------------------------------------------------
|