Skip to content

Commit

Permalink
fix: only clash for different vcf rows
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Colpus committed Mar 15, 2024
1 parent 56bc36b commit e55c857
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gumpy/variantfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,14 +567,15 @@ def __find_calls(self):
calls.append((index + p, variant_type, metadata))

# Convert calls to dict, checking for clashes
positions = set()
positions = {}
self.calls = {}
for pos, type_, metadata in calls:
if pos in positions:
raise ValueError(
"Multiple calls at position " + str(pos) + " in VCF file"
)
positions.add(pos)
if positions[pos] != metadata["original_vcf_row"]:
raise ValueError(
"Multiple calls at position " + str(pos) + " in VCF file"
)
positions[pos] = metadata["original_vcf_row"]
self.calls[(pos, type_)] = metadata

def _simplify_call(self, ref: str, alt: str) -> List[Tuple[int, str, str]]:
Expand Down

0 comments on commit e55c857

Please sign in to comment.