score_enhancers#
- alphagenome.interpretation.enhancer_scoring.score_enhancers(gradients_output, enhancers, *, window_size=2400, sigma=300.0)[source]#
Scores candidate enhancers for the target gene of an input gradient.
The per-position score is
|sum_b gradients[pos, b]|, i.e. the gradients are summed across nucleotides before taking the absolute value (as inInputGradientsOutput.to_track_data). The score of an enhancer is the Gaussian-weighted mean of these per-position scores, centered on the enhancer midpoint ((start + end) // 2). Positions are restricted to[midpoint - window_size // 2, midpoint + window_size // 2]and clipped to the input interval.Enhancers whose midpoint lies outside the gradient interval are not scored: they get
is_scored=Falseand a NaNgradient_score.- Parameters:
gradients_output (
InputGradientsOutput) – Output ofDnaClient.predict_interval_gradients.enhancers (
Sequence[Interval]) – Candidate enhancer intervals.window_size (
int(default:2400)) – Width of the window around the enhancer midpoint (bp).sigma (
float(default:300.0)) – Standard deviation of the Gaussian kernel (bp).
- Return type:
- Returns:
DataFrame with one row per enhancer, in input order, with columns
chromosome,start,end,name(of the enhancer interval),biosample_name,gene_id(target gene of the gradient),gradient_score, andis_scored, plus a trailinggene_namecolumn when present ingradients_output.target_gene.- Raises:
ValueError – If
window_sizeis negative orsigmais not positive.