~/bend-docscommunity

Alignment.bend checks

raw source on the hub · import bend-edit-distance@0.2.0.0/Alignment.bend as Alignment

3 imports
import Base
import ./EdlibTypes.bend as E
import ./Reconstruction.bend as R

Types

type Cell source · line 9 · raw

Data

Scalar reference locations use two score rows, without traceback prefixes. PATH reconstructs only the first interval with bounded DP / Hirschberg. The public API in main.bend uses Myers for all tasks' distances/ends and reverse SHW for HW starts.

type Location source · line 12 · raw

Data

type Best source · line 15 · raw

Data

Definitions

def extend source · line 18 · raw

@cell:Cell -> @cost:U32 -> Cell

def prefer_cells source · line 23 · raw

@first:Cell -> @second:Cell -> @prefer:Bool -> Cell

def prefer source · line 32 · raw

@+first:Cell -> @+second:Cell -> Cell

Earliest optimal start reproduces Edlib's last reverse-SHW location. Equal starts retain above, left, diagonal priority.

def step source · line 38 · raw

@above:Cell -> @left:Cell -> @diagonal:Cell -> @matches:Bool -> Cell

def row_cells source · line 42 · raw

@columns:String -> @previous:List<&2, Cell> -> @diagonal:Cell -> @left:Cell -> @+symbol:Char -> @+pairs:List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.EqualityPair> -> List<&2, Cell>

def next_row source · line 53 · raw

@previous:List<&2, Cell> -> @columns:String -> @symbol:Char -> @pairs:List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.EqualityPair> -> @+first:Cell -> List<&2, Cell>

def initial_cell source · line 62 · raw

@mode:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.Mode -> @+index:U32 -> Cell

def initial_row source · line 69 · raw

@columns:String -> @+mode:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.Mode -> @+index:U32 -> List<&2, Cell>

def rows source · line 76 · raw

@query:String -> @+columns:String -> @previous:List<&2, Cell> -> @+pairs:List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.EqualityPair> -> @+index:U32 -> List<&2, Cell>

def scores source · line 85 · raw

@query:String -> @+target:String -> @mode:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.Mode -> @pairs:List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.EqualityPair> -> List<&2, Cell>

def last_cell source · line 92 · raw

@cells:List<&2, Cell> -> Cell

def update_best source · line 101 · raw

@best:Best -> @score:U32 -> @location:Location -> @comparison:Cmp -> Best

def collect source · line 110 · raw

@cells:List<&2, Cell> -> @+index:Nat -> @+best:Best -> Best

def ordered source · line 119 · raw

@best:Best -> Best

def nw_endpoint source · line 124 · raw

@cell:Cell -> @target_length:Nat -> Best

def semiglobal_endpoints source · line 129 · raw

@cells:List<&2, Cell> -> @include_before:Bool -> Best

def endpoints source · line 138 · raw

@cells:List<&2, Cell> -> @mode:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.Mode -> @target_length:Nat -> @query_length:Nat -> Best

def ends source · line 148 · raw

@locations:List<&2, Location> -> List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.Coordinate>

def starts source · line 155 · raw

@locations:List<&2, Location> -> List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.Coordinate>

def span source · line 162 · raw

@target:String -> @location:Location -> String

def path_result source · line 169 · raw

@score:U32 -> @+locations:List<&2, Location> -> @+operations:List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.Operation> -> @format:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.CigarFormat -> 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.AlignResult

def location_valid source · line 174 · raw

@target:String -> @location:Location -> Bool

def path_checked source · line 181 · raw

@score:U32 -> @locations:List<&2, Location> -> @format:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.CigarFormat -> @operations:List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.Operation> -> @valid:Bool -> 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.AlignResult

def path_validate source · line 189 · raw

@query:String -> @segment:String -> @pairs:List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.EqualityPair> -> @+score:U32 -> @locations:List<&2, Location> -> @format:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.CigarFormat -> @+operations:List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.Operation> -> @valid_location:Bool -> 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.AlignResult

def path_reconstruct source · line 195 · raw

@+query:String -> @+segment:String -> @+pairs:List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.EqualityPair> -> @score:U32 -> @locations:List<&2, Location> -> @format:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.CigarFormat -> @valid_location:Bool -> 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.AlignResult

def result source · line 201 · raw

@query:String -> @target:String -> @task:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.Task -> @pairs:List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.EqualityPair> -> @format:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.CigarFormat -> @best:Best -> @accepted:Bool -> 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.AlignResult

def finish source · line 218 · raw

@query:String -> @target:String -> @task:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.Task -> @threshold:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.Threshold -> @pairs:List<&2, 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.EqualityPair> -> @format:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.CigarFormat -> @+best:Best -> 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.AlignResult

def align source · line 227 · raw

@query:String -> @target:String -> @config:0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.AlignConfig -> 0x174bb51b869e4a6769b3eebe332457c5/EdlibTypes.AlignResult

Pinned Edlib returns before applying k or calculating starts/path on empty inputs, including PATH. Preserve that observable oracle behavior.