MCPcopy Create free account
hub / github.com/DeepGraphLearning/S3F / get_optimal_window

Function get_optimal_window

script/evaluate.py:68–77  ·  view source on GitHub ↗
(mutation_position_relative, seq_len_wo_special, model_window)

Source from the content-addressed store, hash-verified

66
67
68def get_optimal_window(mutation_position_relative, seq_len_wo_special, model_window):
69 half_model_window = model_window // 2
70 if seq_len_wo_special <= model_window:
71 return [0,seq_len_wo_special]
72 elif mutation_position_relative < half_model_window:
73 return [0,model_window]
74 elif mutation_position_relative >= seq_len_wo_special - half_model_window:
75 return [seq_len_wo_special - model_window, seq_len_wo_special]
76 else:
77 return [max(0,mutation_position_relative-half_model_window), min(seq_len_wo_special,mutation_position_relative+half_model_window)]
78
79
80def predict(cfg, task, dataset):

Callers 1

load_datasetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected