o4-mini-2025-04-16· OpenAI
LMArena Human Preference 140K
Untitled conversation
- Usercode
import numpy as np import pandas as pd # --- Load PWM --- pwm_file = 'sigma70-PWM-10.txt' pwm_df = pd.read_csv(pwm_file, sep='\t') seq_length = len(pwm_df) # --- Load FASTA sequence --- def read_fasta(filename): seq = [] with open(filename) as f: for line in f: if line.startswith('>'): continue seq.append(line.strip()) return ''.join(seq).lower() fasta_file = 'sega007-rev.fasta' # Change to your file path if needed sequence = read_fasta(fasta_file) # --- Slide window and calculate PWM scores --- scores = [] for i in range(len(sequence) - seq_length + 1): window = sequence[i:i+seq_length] score = 0.0 for j, nt in enumerate(window): # Optionally, you can handle invalid characters as needed (e.g., skip window or assign a penalty). score += pwm_df.loc[j, nt.upper()] scores.append(score) scores = np.array(scores) # --- Save array to file --- np.save('sliding_scores.npy', scores) print(f"Saved {len(scores)} scores to sliding_scores.npy")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.