julse commited on
Commit
24b1044
·
verified ·
1 Parent(s): c4c964a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -202,7 +202,7 @@ def process_prediction(fasta_file, rna_sequence, protein_sequence, input_method)
202
  # Calculate default Threshold (minimum non-zero value)
203
  non_zero_values = contact_matrix[contact_matrix > 0]
204
  default_threshold = float(np.min(non_zero_values)) if len(non_zero_values) > 0 else 0.0
205
- max_threshold = float(np.max(contact_matrix))
206
 
207
  # Create initial heatmap with default Threshold
208
  heatmap = create_heatmap(contact_matrix, rna_labels, protein_labels, rna_id, protein_id, default_threshold)
@@ -229,11 +229,12 @@ def process_prediction(fasta_file, rna_sequence, protein_sequence, input_method)
229
  }
230
 
231
  # Update slider configuration
 
232
  slider_update = gr.update(
233
  minimum=default_threshold,
234
  maximum=max_threshold,
235
  value=default_threshold,
236
- step=(max_threshold - default_threshold) / 100,
237
  visible=True
238
  )
239
 
 
202
  # Calculate default Threshold (minimum non-zero value)
203
  non_zero_values = contact_matrix[contact_matrix > 0]
204
  default_threshold = float(np.min(non_zero_values)) if len(non_zero_values) > 0 else 0.0
205
+ max_threshold = round(float(np.max(contact_matrix), 2))
206
 
207
  # Create initial heatmap with default Threshold
208
  heatmap = create_heatmap(contact_matrix, rna_labels, protein_labels, rna_id, protein_id, default_threshold)
 
229
  }
230
 
231
  # Update slider configuration
232
+ default_threshold = round(default_threshold, 2)
233
  slider_update = gr.update(
234
  minimum=default_threshold,
235
  maximum=max_threshold,
236
  value=default_threshold,
237
+ step=0.001,
238
  visible=True
239
  )
240