geno_lewm.planning.costs¶
costs
¶
Edit-sequence cost functions for RFC-0008 planning.
DEFAULT_TYPE_COSTS
module-attribute
¶
Default non-negative type costs for weighted_type_cost.
The defaults keep SNVs cheapest, assign a higher penalty to simple indels and MNVs, and make mixed indels the most expensive v1 edit class. Structural variants are outside the v1 planner surface.
count_cost
¶
edit_bp_cost
¶
Return the base-pair cost contribution of a single edit.
SNVs cost one base. Insertions and deletions cost their event length excluding the VCF anchor base. MNVs cost their substituted span. Mixed indels cost the larger touched span because both the deleted and inserted sequence are material to the action.
Source code in geno_lewm/planning/costs.py
bp_cost
¶
weighted_type_cost
¶
weighted_type_cost(edits: Sequence[RelEdit], weights: Mapping[EditType, float] = DEFAULT_TYPE_COSTS) -> float
Return the sum of per-edit-type costs for edits.
Source code in geno_lewm/planning/costs.py
custom_cost
¶
Evaluate and validate a user-provided cost function.