supzammy commited on
Commit
cc866ee
·
verified ·
1 Parent(s): 341e7e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -276,16 +276,21 @@ def run_real_prediction(file):
276
  return summary, bar, dense, gauge, status
277
 
278
 
279
- def download_template_real():
 
 
280
  if REAL_MODEL_READY:
281
  cols = REAL_FEATURES
282
  else:
283
  cols = EXPLORE_GENES
284
- path = "/tmp/genome_matrix_template.csv"
285
- pd.DataFrame([[0] * len(cols)], columns=cols, index=["your_genome_id"]).to_csv(path)
 
 
 
 
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
  # ----------------------------------------------------------------------