svphaser 2.0.4__tar.gz → 2.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: svphaser
3
- Version: 2.0.4
3
+ Version: 2.0.6
4
4
  Summary: Structural-variant phasing from HP-tagged long-read BAMs
5
5
  Project-URL: Homepage, https://github.com/your-org/svphaser
6
6
  Project-URL: Issues, https://github.com/your-org/svphaser/issues
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '2.0.4'
32
- __version_tuple__ = version_tuple = (2, 0, 4)
31
+ __version__ = version = '2.0.6'
32
+ __version_tuple__ = version_tuple = (2, 0, 6)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -46,26 +46,27 @@ def classify_haplotype(
46
46
  *,
47
47
  min_support: int = 10,
48
48
  major_delta: float = 0.70,
49
- equal_delta: float = 0.25,
49
+ equal_delta: float = 0.10,
50
50
  ) -> tuple[str, int]:
51
- """Return (GT, GQ) using ratio thresholds and an overflow-safe GQ."""
52
51
  total = n1 + n2
53
-
54
52
  if n1 < min_support and n2 < min_support:
55
53
  return "./.", 0
56
54
  if total == 0:
57
55
  return "./.", 0
58
56
 
59
57
  gq = phasing_gq(n1, n2)
58
+
59
+ # 1) near-tie FIRST → homozygous phased
60
+ if abs(n1 - n2) / total <= equal_delta:
61
+ return "1|1", gq # includes exactly 50/50
62
+
63
+ # 2) strong majority → heterozygous phased
60
64
  r1 = n1 / total
61
65
  r2 = n2 / total
62
-
63
66
  if r1 >= major_delta:
64
- gt = "1|0"
65
- elif r2 >= major_delta:
66
- gt = "0|1"
67
- elif abs(n1 - n2) / total <= equal_delta:
68
- gt = "1|1"
69
- else:
70
- gt = "./."
71
- return gt, gq
67
+ return "1|0", gq
68
+ if r2 >= major_delta:
69
+ return "0|1", gq
70
+
71
+ # 3) otherwise ambiguous
72
+ return "./.", gq
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes