Spaces:
Sleeping
Sleeping
Commit
•
105bca0
1
Parent(s):
1df763a
fixed app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import cas9on
|
|
4 |
import cas9off
|
5 |
import pandas as pd
|
6 |
import streamlit as st
|
|
|
7 |
from pathlib import Path
|
8 |
from igv_component import igv_component
|
9 |
|
@@ -105,13 +106,14 @@ if selected_model == 'Cas9':
|
|
105 |
st.session_state['full_on_target_results'] = predictions
|
106 |
|
107 |
if 'on_target_results' in st.session_state and st.session_state['on_target_results']:
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
|
|
115 |
genome_reference=genome_reference,
|
116 |
gene_symbol=gene_symbol,
|
117 |
key="igv_viewer")
|
|
|
4 |
import cas9off
|
5 |
import pandas as pd
|
6 |
import streamlit as st
|
7 |
+
import numpy as np
|
8 |
from pathlib import Path
|
9 |
from igv_component import igv_component
|
10 |
|
|
|
106 |
st.session_state['full_on_target_results'] = predictions
|
107 |
|
108 |
if 'on_target_results' in st.session_state and st.session_state['on_target_results']:
|
109 |
+
# Convert non-serializable types (like numpy float32) to Python native types
|
110 |
+
crispr_results_serializable = [
|
111 |
+
[item if not isinstance(item, np.floating) else float(item) for item in row]
|
112 |
+
for row in st.session_state['on_target_results']
|
113 |
+
]
|
114 |
+
|
115 |
+
# Pass the serializable results to the IGV component
|
116 |
+
igv_component(crispr_results=crispr_results_serializable,
|
117 |
genome_reference=genome_reference,
|
118 |
gene_symbol=gene_symbol,
|
119 |
key="igv_viewer")
|