supercat666 commited on
Commit
ba0ca5b
1 Parent(s): c29b4c5
Files changed (1) hide show
  1. cas9on.py +6 -4
cas9on.py CHANGED
@@ -224,12 +224,14 @@ def create_bigwig(df, bigwig_path):
224
  bw = pyBigWig.open(bigwig_path, "w")
225
  bw.addHeader(header)
226
 
227
- # Create a list of tuples with (chromosome, start, end, value)
228
- entries = [(row['Chr'], row['Start Pos'], row['End Pos'], row['Prediction'])
229
- for _, row in df.iterrows()]
 
 
230
 
231
  # Add entries to the BigWig file
232
- bw.addEntries(entries)
233
 
234
  # Close the BigWig file
235
  bw.close()
 
224
  bw = pyBigWig.open(bigwig_path, "w")
225
  bw.addHeader(header)
226
 
227
+ # Create separate lists for chromosomes, starts, ends, and values
228
+ chromosomes = df['Chr'].tolist()
229
+ starts = df['Start Pos'].tolist()
230
+ ends = df['End Pos'].tolist()
231
+ values = df['Prediction'].astype(float).tolist()
232
 
233
  # Add entries to the BigWig file
234
+ bw.addEntries(chromosomes, starts, ends=ends, values=values)
235
 
236
  # Close the BigWig file
237
  bw.close()