supercat666 commited on
Commit
f0489eb
1 Parent(s): 445015e
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -177,7 +177,7 @@ if selected_model == 'Cas9':
177
  # Include "Target" in the DataFrame's columns
178
  try:
179
  df = pd.DataFrame(st.session_state['on_target_results'],
180
- columns=["Chr", "Start Pos", "End Pos", "Strand", "Transcript", "Target", "gRNA", "pred_Score"])
181
  st.dataframe(df)
182
  except ValueError as e:
183
  st.error(f"DataFrame creation error: {e}")
@@ -223,7 +223,7 @@ if selected_model == 'Cas9':
223
 
224
  # Iterate over top 5 sorted predictions to create the plot
225
  for i, prediction in enumerate(st.session_state['on_target_results'][:5], start=1): # Only top 5
226
- chrom, start, end, strand, transcript, target, gRNA, pred_score = prediction
227
  midpoint = (int(start) + int(end)) / 2
228
 
229
  # Vertical position based on rank, modified by strand
@@ -237,7 +237,7 @@ if selected_model == 'Cas9':
237
  marker=dict(symbol='triangle-up' if strand == '1' else 'triangle-down', size=12),
238
  text=f"Rank: {i}", # Text label
239
  hoverinfo='text',
240
- hovertext=f"Rank: {i}<br>Chromosome: {chrom}<br>Target Sequence: {target}<br>gRNA: {gRNA}<br>Start: {start}<br>End: {end}<br>Strand: {'+' if strand == '1' else '-'}<br>Transcript: {transcript}<br>Prediction Score: {pred_score:.4f}",
241
  ))
242
 
243
  # Update layout for clarity and interaction
 
177
  # Include "Target" in the DataFrame's columns
178
  try:
179
  df = pd.DataFrame(st.session_state['on_target_results'],
180
+ columns=["Chr", "Start Pos", "End Pos", "Strand", "Transcript", "Target", "gRNA", "Prediction"])
181
  st.dataframe(df)
182
  except ValueError as e:
183
  st.error(f"DataFrame creation error: {e}")
 
223
 
224
  # Iterate over top 5 sorted predictions to create the plot
225
  for i, prediction in enumerate(st.session_state['on_target_results'][:5], start=1): # Only top 5
226
+ chrom, start, end, strand, transcript, target, gRNA, Prediction = prediction
227
  midpoint = (int(start) + int(end)) / 2
228
 
229
  # Vertical position based on rank, modified by strand
 
237
  marker=dict(symbol='triangle-up' if strand == '1' else 'triangle-down', size=12),
238
  text=f"Rank: {i}", # Text label
239
  hoverinfo='text',
240
+ hovertext=f"Rank: {i}<br>Chromosome: {chrom}<br>Target Sequence: {target}<br>gRNA: {gRNA}<br>Start: {start}<br>End: {end}<br>Strand: {'+' if strand == '1' else '-'}<br>Transcript: {transcript}<br>Prediction: {Prediction:.4f}",
241
  ))
242
 
243
  # Update layout for clarity and interaction