NiniCat LfOreVEr commited on
Commit
107852c
1 Parent(s): 4f7bcab

Update app.py (#8)

Browse files

- Update app.py (0798648920359a9e04f77c6435bac0fe57d37853)


Co-authored-by: Qingyang Liu <LfOreVEr@users.noreply.huggingface.co>

Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -439,12 +439,14 @@ elif selected_model == 'Cas12':
439
  predictions, gene_sequence, exons = cas12.process_gene(gene_symbol,cas12_path)
440
  sorted_predictions = sorted(predictions, key=lambda x: x[-1], reverse=True)[:10]
441
  st.session_state['on_target_results'] = sorted_predictions
 
 
442
  st.success('Prediction completed!')
443
 
444
  # Visualization and file generation
445
  if 'on_target_results' in st.session_state and st.session_state['on_target_results']:
446
  df = pd.DataFrame(st.session_state['on_target_results'],
447
- columns=["Gene ID", "Start Pos", "End Pos", "Strand", "Target", "gRNA", "Prediction"])
448
  st.dataframe(df)
449
  # Now create a Plotly plot with the sorted_predictions
450
  fig = go.Figure()
 
439
  predictions, gene_sequence, exons = cas12.process_gene(gene_symbol,cas12_path)
440
  sorted_predictions = sorted(predictions, key=lambda x: x[-1], reverse=True)[:10]
441
  st.session_state['on_target_results'] = sorted_predictions
442
+ st.session_state['gene_sequence'] = gene_sequence # Save gene sequence in session state
443
+ st.session_state['exons'] = exons # Store exon data
444
  st.success('Prediction completed!')
445
 
446
  # Visualization and file generation
447
  if 'on_target_results' in st.session_state and st.session_state['on_target_results']:
448
  df = pd.DataFrame(st.session_state['on_target_results'],
449
+ columns=["Chr", "Start Pos", "End Pos", "Strand", "Transcript", "Exon", "Target", "gRNA", "Prediction"])
450
  st.dataframe(df)
451
  # Now create a Plotly plot with the sorted_predictions
452
  fig = go.Figure()