Skip to content

Commit

Permalink
Add indel_variants to result json
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjameskennedy committed Aug 22, 2024
1 parent ff10330 commit f3493c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions prp/models/phenotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class VariantType(str, Enum):
SNV = "SNV"
MNV = "MNV"
SV = "SV"
INDEL = "INDEL"
STR = "STR"


Expand Down
1 change: 1 addition & 0 deletions prp/models/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class PipelineResult(SampleBase):
# optional variant info
snv_variants: Optional[list[VariantBase]] = None
sv_variants: Optional[list[VariantBase]] = None
indel_variants: Optional[list[VariantBase]] = None
# optional alignment info
reference_genome: Optional[ReferenceGenome] = None
read_mapping: Optional[str] = None
Expand Down
8 changes: 4 additions & 4 deletions prp/parse/variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def _filter_variants(variant_list):
# Initialize the results dictionary
filetered_variants = {
'sv_variants': [],
'mnv_variants': [],
'indel_variants': [],
'snv_variants': []
}

Expand All @@ -26,8 +26,8 @@ def _filter_variants(variant_list):
# Append the variant to the appropriate key in the results dictionary
if variant_type == "SV":
filetered_variants['sv_variants'].append(variant)
elif variant_type == "MNV":
filetered_variants['mnv_variants'].append(variant)
elif variant_type == "INDEL":
filetered_variants['indel_variants'].append(variant)
elif variant_type == "SNV":
filetered_variants['snv_variants'].append(variant)
return filetered_variants
Expand All @@ -41,7 +41,7 @@ def _get_variant_type(variant) -> VariantType:
case "mnp":
var_type = VariantType.MNV
case "indel":
var_type = VariantType.SV
var_type = VariantType.INDEL
case _:
var_type = VariantType(variant.var_type.upper())
return var_type
Expand Down

0 comments on commit f3493c5

Please sign in to comment.