Spaces:
Sleeping
Sleeping
Commit
•
7708ddd
1
Parent(s):
9b2b874
fix
Browse files
app.py
CHANGED
@@ -179,9 +179,15 @@ if selected_model == 'Cas9':
|
|
179 |
st.markdown("**Nuclease**")
|
180 |
st.markdown("SpCas9")
|
181 |
# Include "Target" in the DataFrame's columns
|
182 |
-
|
183 |
-
|
184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
# Initialize Plotly figure
|
186 |
fig = go.Figure()
|
187 |
|
@@ -383,7 +389,7 @@ if selected_model == 'Cas9':
|
|
383 |
elif selected_model == 'Cas12':
|
384 |
# Gene symbol entry with autocomplete-like feature
|
385 |
gene_symbol = st.selectbox('Enter a Gene Symbol:', [''] + gene_symbol_list, key='gene_symbol',
|
386 |
-
format_func=lambda x: x if x else "
|
387 |
|
388 |
# Initialize the current_gene_symbol in the session state if it doesn't exist
|
389 |
if 'current_gene_symbol' not in st.session_state:
|
|
|
179 |
st.markdown("**Nuclease**")
|
180 |
st.markdown("SpCas9")
|
181 |
# Include "Target" in the DataFrame's columns
|
182 |
+
try:
|
183 |
+
df = pd.DataFrame(st.session_state['on_target_results'],
|
184 |
+
columns=["Chr", "Start", "End", "Strand", "Transcript ID", "Target Sequence",
|
185 |
+
"sgRNA", "Prediction"])
|
186 |
+
st.dataframe(df)
|
187 |
+
except ValueError as e:
|
188 |
+
st.error(f"DataFrame creation error: {e}")
|
189 |
+
# Optionally print or log the problematic data for debugging:
|
190 |
+
print(st.session_state['on_target_results'])
|
191 |
# Initialize Plotly figure
|
192 |
fig = go.Figure()
|
193 |
|
|
|
389 |
elif selected_model == 'Cas12':
|
390 |
# Gene symbol entry with autocomplete-like feature
|
391 |
gene_symbol = st.selectbox('Enter a Gene Symbol:', [''] + gene_symbol_list, key='gene_symbol',
|
392 |
+
format_func=lambda x: x if x else "")
|
393 |
|
394 |
# Initialize the current_gene_symbol in the session state if it doesn't exist
|
395 |
if 'current_gene_symbol' not in st.session_state:
|
cas9on.py
CHANGED
@@ -140,6 +140,8 @@ def process_gene(gene_symbol, model_path):
|
|
140 |
# Predict on-target efficiency for each gRNA site
|
141 |
formatted_data = format_prediction_output(targets,model_path)
|
142 |
results.append(formatted_data)
|
|
|
|
|
143 |
else:
|
144 |
print("Failed to retrieve gene sequence.")
|
145 |
else:
|
|
|
140 |
# Predict on-target efficiency for each gRNA site
|
141 |
formatted_data = format_prediction_output(targets,model_path)
|
142 |
results.append(formatted_data)
|
143 |
+
print(f"Appended formatted data: {formatted_data[-1]}") # Check the last appended item
|
144 |
+
print(f"Current results length: {len(results)}")
|
145 |
else:
|
146 |
print("Failed to retrieve gene sequence.")
|
147 |
else:
|