Skip to content

Commit 075bbd9

Browse files
authored
Merge branch 'master' into cache-bugs
2 parents e7eb956 + c5a3b19 commit 075bbd9

4 files changed

Lines changed: 19 additions & 7 deletions

File tree

malariagen_data/anoph/fst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def average_fst(
363363
region: base_params.region,
364364
cohort1_query: base_params.sample_query,
365365
cohort2_query: base_params.sample_query,
366-
sample_query_options: Optional[base_params.sample_query] = None,
366+
sample_query_options: Optional[base_params.sample_query_options] = None,
367367
sample_sets: Optional[base_params.sample_sets] = None,
368368
cohort_size: Optional[base_params.cohort_size] = fst_params.cohort_size_default,
369369
min_cohort_size: Optional[

malariagen_data/anoph/hap_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _prep_phasing_analysis_param(self, *, analysis: hap_params.analysis) -> str:
6464
return analysis
6565
else:
6666
raise ValueError(
67-
f"Invalid phasing analysis, must be one of f{self.phasing_analysis_ids}."
67+
f"Invalid phasing analysis, must be one of {self.phasing_analysis_ids}."
6868
)
6969

7070
@_check_types

malariagen_data/anoph/snp_data.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ def _prep_site_mask_param(
116116
elif site_mask in self.site_mask_ids:
117117
return site_mask
118118
else:
119-
raise ValueError(
120-
f"Invalid site mask, must be one of f{self.site_mask_ids}."
121-
)
119+
raise ValueError(f"Invalid site mask, must be one of {self.site_mask_ids}.")
122120

123121
def _prep_optional_site_mask_param(
124122
self,

malariagen_data/veff.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,21 @@ def _get_within_intron_effect(base_effect, intron):
548548
effect = base_effect._replace(effect="INTRONIC", impact="MODIFIER")
549549

550550
else:
551-
# TODO intronic INDELs and MNPs
552-
effect = base_effect._replace(effect="TODO intronic indels and MNPs")
551+
# INDELs and MNPs — use the closest edge of the variant to the splice site
552+
if strand == "+":
553+
dist_5prime = ref_start - (intron_start - 1)
554+
dist_3prime = -(ref_stop - (intron_stop + 1))
555+
else:
556+
dist_5prime = (intron_stop + 1) - ref_stop
557+
dist_3prime = -((intron_start - 1) - ref_start)
558+
559+
indel_min_dist = min(dist_5prime, dist_3prime)
560+
561+
if indel_min_dist <= 2:
562+
effect = base_effect._replace(effect="SPLICE_CORE", impact="HIGH")
563+
elif indel_min_dist <= 7:
564+
effect = base_effect._replace(effect="SPLICE_REGION", impact="MODERATE")
565+
else:
566+
effect = base_effect._replace(effect="INTRONIC", impact="MODIFIER")
553567

554568
return effect

0 commit comments

Comments
 (0)