Spaces:
Sleeping
Sleeping
Update app.py
#8
by
LfOreVEr
- opened
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=["
|
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()
|