Skip to content

mecfs_bio.build_system.task.genome_reference_harmonization.options

Options for genome-reference harmonization, validated at construction.

Classes:

GenomeReferenceHarmonizationOptions

min_checkable_snvs, min_checkable_indels: a table is trusted only if it has at least this many checkable SNVs (non-palindromic) and indels, all consistent with NEA as the reference allele. palindrome_maf_threshold, panel_maf_threshold: an untrusted palindromic SNV is resolved by frequency only when both its summary-statistic MAF and its panel MAF are at most these (gwaslab's defaults). palindrome_max_af_distance: an untrusted palindromic SNV is resolved only if, after the strand decision, its EAF is within this distance of the panel AF. Beyond 0.1, panels often contradict each other's strand call; see experiments/claude/gnomad_af_reference/palindrome_distance_vs_panel_disagreement.md. indel_max_af_distance, indel_min_af_margin: stringent rules for untrusted ambiguous indels. A reading is chosen only if its predicted EAF is within the distance and beats the other reading by at least the margin. max_suspicious_indel_fraction: a table is trusted only if at most this fraction of its checkable ambiguous indels (both orientations on the FASTA, with EAF and a panel record) are suspicious -- their EAF matches the complement of the opposite orientation's panel frequency, evidence the source is not perfectly reference-aligned. The suspicion test uses the same indel_max_af_distance and indel_min_af_margin. min_checkable_ambiguous_indels: the suspicious-fraction test is applied only when at least this many checkable ambiguous indels exist; below it the signal is too sparse to judge and does not affect trust. keep_unresolved_palindromes: keep untrusted palindromic SNVs whose strand cannot be resolved, instead of dropping them. Never applies to indels. excluded_chromosomes: gwaslab chromosome codes whose rows are dropped (MT by default, since UCSC hg19 chrM is not rCRS). extra_column_rules: flip rules for dataset-specific columns. max_gather_bytes: memory budget for one reference-gather slice.

Attributes:

excluded_chromosomes class-attribute instance-attribute

excluded_chromosomes: tuple[int, ...] = (
    GWASLAB_CHROM_CODE_FOR_NAME["MT"],
)

extra_column_rules class-attribute instance-attribute

extra_column_rules: tuple[ExtraColumnRule, ...] = ()

indel_max_af_distance class-attribute instance-attribute

indel_max_af_distance: float = 0.02

indel_min_af_margin class-attribute instance-attribute

indel_min_af_margin: float = 0.3

keep_unresolved_palindromes class-attribute instance-attribute

keep_unresolved_palindromes: bool = False

max_gather_bytes class-attribute instance-attribute

max_gather_bytes: int = DEFAULT_MAX_GATHER_BYTES

max_suspicious_indel_fraction class-attribute instance-attribute

max_suspicious_indel_fraction: float = 0.0001

min_checkable_ambiguous_indels class-attribute instance-attribute

min_checkable_ambiguous_indels: int = 100

min_checkable_indels class-attribute instance-attribute

min_checkable_indels: int = 1000

min_checkable_snvs class-attribute instance-attribute

min_checkable_snvs: int = 10000

palindrome_maf_threshold class-attribute instance-attribute

palindrome_maf_threshold: float = 0.4

palindrome_max_af_distance class-attribute instance-attribute

palindrome_max_af_distance: float = 0.1

panel_maf_threshold class-attribute instance-attribute

panel_maf_threshold: float = 0.4