Skip to content

Commit

Permalink
#530 - fixed genotyping of deletions
Browse files Browse the repository at this point in the history
(cherry picked from commit 3fb44948405b5b475f8a64b5eb5738f64cd142b6)
  • Loading branch information
Hermann Romanek committed Nov 28, 2024
1 parent 02aa6ce commit 10ddf03
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sniffles/genotyping.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ def _calculate_af(self, support: int, coverage: int) -> float:
return support / float(coverage)

def _get_coverage_from_list(self, coverage_list: list = None) -> int:
"""
Coverage here is NOT the same as in IGV, but the number of reads spanning the SV
"""
svcall = self.svcall
if coverage_list is None:
coverage_list = [svcall.coverage_start, svcall.coverage_center, svcall.coverage_end]
Expand Down Expand Up @@ -179,9 +182,7 @@ def _calculate_coverage(self, support: int) -> int:


class DeletionGenotyper(Genotyper):
def _calculate_coverage(self, support: int) -> int:
svcall = self.svcall
return self._get_coverage_from_list([svcall.coverage_start + support, svcall.coverage_center + support, svcall.coverage_end + support])
...


GENOTYPER_BY_TYPE = {
Expand Down

0 comments on commit 10ddf03

Please sign in to comment.