supercat666 commited on
Commit
4a895c3
1 Parent(s): dc94424
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -325,7 +325,7 @@ elif selected_model == 'Cas12':
325
  # Visualization and file generation
326
  if 'on_target_results' in st.session_state and st.session_state['on_target_results']:
327
  df = pd.DataFrame(st.session_state['on_target_results'],
328
- columns=["Gene ID", "Start Pos", "End Pos", "Strand", "gRNA", "Prediction"])
329
 
330
  # Now create a Plotly plot with the sorted_predictions
331
  fig = go.Figure()
@@ -333,7 +333,7 @@ elif selected_model == 'Cas12':
333
  # Iterate over the sorted predictions to create the plot
334
  for i, prediction in enumerate(sorted_predictions, start=1):
335
  # Extract data for plotting
336
- chrom, start, end, strand, gRNA, pred_score = prediction
337
  # Strand is not used in this plot, but you could use it to determine marker symbol, for example
338
  fig.add_trace(go.Scatter(
339
  x=[start, end],
@@ -343,7 +343,7 @@ elif selected_model == 'Cas12':
343
  text=[f"Rank: {i}", ""], # Text at the start position only
344
  hoverinfo='text',
345
  hovertext=[
346
- f"Rank: {i}<br>Chromosome: {chrom}<br>Target: {gRNA}<br>Start: {start}<br>End: {end}<br>Strand: {'+' if strand == 1 else '-'}<br>Prediction Score: {pred_score:.4f}",
347
  ""
348
  ],
349
  ))
 
325
  # Visualization and file generation
326
  if 'on_target_results' in st.session_state and st.session_state['on_target_results']:
327
  df = pd.DataFrame(st.session_state['on_target_results'],
328
+ columns=["Gene ID", "Start Pos", "End Pos", "Strand", "Target", "gRNA", "Prediction"])
329
 
330
  # Now create a Plotly plot with the sorted_predictions
331
  fig = go.Figure()
 
333
  # Iterate over the sorted predictions to create the plot
334
  for i, prediction in enumerate(sorted_predictions, start=1):
335
  # Extract data for plotting
336
+ chrom, start, end, strand, Target, gRNA, pred_score = prediction
337
  # Strand is not used in this plot, but you could use it to determine marker symbol, for example
338
  fig.add_trace(go.Scatter(
339
  x=[start, end],
 
343
  text=[f"Rank: {i}", ""], # Text at the start position only
344
  hoverinfo='text',
345
  hovertext=[
346
+ f"Rank: {i}<br>Chromosome: {chrom}<br>Target: {Target}<br>Start: {start}<br>End: {end}<br>Strand: {'+' if strand == 1 else '-'}<br>Prediction Score: {pred_score:.4f}",
347
  ""
348
  ],
349
  ))