Skip to content

Commit

Permalink
style: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Colpus committed Mar 15, 2024
1 parent c91e98d commit c8bca14
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions gumpy/variantfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Classes used to parse and store VCF data
"""

import copy
import pathlib
import warnings
Expand Down Expand Up @@ -81,9 +82,7 @@ def __init__(self, record: pysam.libcbcf.VariantRecord, sample: str | int):
self.is_filter_pass = False
else:
self.filter = str(record.filter.items()[0][0])
self.is_filter_pass = (
True if record.filter.items()[0][0] == "PASS" else False
)
self.is_filter_pass = True if record.filter.items()[0][0] == "PASS" else False

# Get the info field
self.info = {}
Expand Down Expand Up @@ -378,9 +377,7 @@ def _find_minor_populations(self):
simple_calls.append((idx, pos, t, bases))
seen = []

allelic_depth_tag = (
"COV" if "COV" in self.format_fields_metadata.keys() else "AD"
)
allelic_depth_tag = "COV" if "COV" in self.format_fields_metadata.keys() else "AD"

for idx, type_ in self.calls.keys():
# Check if we've delt with this vcf already
Expand Down Expand Up @@ -523,7 +520,9 @@ def __find_calls(self):
variant_type = "ref"

if index in record_positions:
raise ValueError("Multiple calls at position " + str(index) + " in VCF file")
raise ValueError(
"Multiple calls at position " + str(index) + " in VCF file"
)
record_positions.add(index)

# if the REF, ALT pair are the same length, check if we can decompose
Expand Down Expand Up @@ -801,9 +800,7 @@ def __get_variants(self):
alts.append(alt)
variants.append(variant)
for key in self.calls[(index, type_)]["original_vcf_row"]:
metadata[key].append(
self.calls[(index, type_)]["original_vcf_row"][key]
)
metadata[key].append(self.calls[(index, type_)]["original_vcf_row"][key])

# Remove ref calls as required
for key in to_drop:
Expand Down

0 comments on commit c8bca14

Please sign in to comment.