bioforge 3.3.0__tar.gz → 3.4.0__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.
Files changed (38) hide show
  1. {bioforge-3.3.0 → bioforge-3.4.0}/PKG-INFO +1 -1
  2. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/__init__.py +1 -1
  3. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/engine/engine.c +2 -1
  4. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/engine/engine.dll +0 -0
  5. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/genomemap.py +9 -7
  6. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge.egg-info/PKG-INFO +1 -1
  7. {bioforge-3.3.0 → bioforge-3.4.0}/LICENSE +0 -0
  8. {bioforge-3.3.0 → bioforge-3.4.0}/README.md +0 -0
  9. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/aligner.py +0 -0
  10. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/analyze.py +0 -0
  11. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/bgzf.py +0 -0
  12. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/biocore.py +0 -0
  13. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/engine/__init__.py +0 -0
  14. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/engine/_loader.py +0 -0
  15. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/engine/build.py +0 -0
  16. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/minimizers.py +0 -0
  17. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/qcreport.py +0 -0
  18. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/refindex.py +0 -0
  19. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge/smart_translator.py +0 -0
  20. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge.egg-info/SOURCES.txt +0 -0
  21. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge.egg-info/dependency_links.txt +0 -0
  22. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge.egg-info/entry_points.txt +0 -0
  23. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge.egg-info/requires.txt +0 -0
  24. {bioforge-3.3.0 → bioforge-3.4.0}/bioforge.egg-info/top_level.txt +0 -0
  25. {bioforge-3.3.0 → bioforge-3.4.0}/pyproject.toml +0 -0
  26. {bioforge-3.3.0 → bioforge-3.4.0}/setup.cfg +0 -0
  27. {bioforge-3.3.0 → bioforge-3.4.0}/setup.py +0 -0
  28. {bioforge-3.3.0 → bioforge-3.4.0}/tests/test_aligner.py +0 -0
  29. {bioforge-3.3.0 → bioforge-3.4.0}/tests/test_analyze.py +0 -0
  30. {bioforge-3.3.0 → bioforge-3.4.0}/tests/test_bgzf.py +0 -0
  31. {bioforge-3.3.0 → bioforge-3.4.0}/tests/test_biocore.py +0 -0
  32. {bioforge-3.3.0 → bioforge-3.4.0}/tests/test_errors.py +0 -0
  33. {bioforge-3.3.0 → bioforge-3.4.0}/tests/test_genomemap.py +0 -0
  34. {bioforge-3.3.0 → bioforge-3.4.0}/tests/test_minimizers.py +0 -0
  35. {bioforge-3.3.0 → bioforge-3.4.0}/tests/test_qcreport.py +0 -0
  36. {bioforge-3.3.0 → bioforge-3.4.0}/tests/test_refindex.py +0 -0
  37. {bioforge-3.3.0 → bioforge-3.4.0}/tests/test_streaming.py +0 -0
  38. {bioforge-3.3.0 → bioforge-3.4.0}/tests/test_translator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bioforge
3
- Version: 3.3.0
3
+ Version: 3.4.0
4
4
  Summary: High-performance bioinformatics engine for Edge Computing — 5-bit encoding, vectorised NumPy core, optional C backend
5
5
  Author-email: Aarón Aranda Torrijos <noe9601@gmail.com>
6
6
  License: # PolyForm Noncommercial License 1.0.0
@@ -36,7 +36,7 @@ from .biocore import (
36
36
  from .genomemap import GenomeAligner, Mapping
37
37
  from .smart_translator import SmartTranslator
38
38
 
39
- __version__ = "3.3.0"
39
+ __version__ = "3.4.0"
40
40
  __author__ = "Aarón Aranda Torrijos"
41
41
 
42
42
  __all__ = [
@@ -1570,8 +1570,9 @@ EXPORT void bio_chain_dp(const int64_t* x, const int64_t* y, int32_t n,
1570
1570
  if (gap > max_gap) continue;
1571
1571
  int64_t mn = (dx < dy) ? dx : dy;
1572
1572
  double match = (double)((mn < (int64_t)k) ? mn : (int64_t)k);
1573
+ /* coste de hueco estilo minimap2: gap_w·|l| + 0.5·log2|l| (l≠0) */
1573
1574
  double cost = gap_w * (double)gap;
1574
- if (gap > 0) cost += log2((double)gap + 1.0);
1575
+ if (gap > 0) cost += 0.5 * log2((double)gap);
1575
1576
  double sc = f[j] + match - cost;
1576
1577
  if (sc > best) { best = sc; bp = j; }
1577
1578
  }
@@ -101,16 +101,17 @@ class Chain(NamedTuple):
101
101
  # Parámetros de chaining (razonables; ajustables).
102
102
  _MAX_GAP = 5000 # distancia máxima entre anclas consecutivas
103
103
  _WINDOW = 64 # nº de predecesores que se examinan por ancla
104
- _GAP_W = 0.2 # peso lineal de la penalización por hueco
104
+ _GAP_COEF = 0.01 # coste lineal de hueco = 0.01·k (fórmula de minimap2)
105
105
  _MIN_ANCHORS = 2
106
106
 
107
107
 
108
- def _chain_fill_numpy(xs: np.ndarray, ys: np.ndarray, k: int):
108
+ def _chain_fill_numpy(xs: np.ndarray, ys: np.ndarray, k: int, gap_w: float):
109
109
  """Fallback NumPy del DP de chaining (idéntico al C bio_chain_dp).
110
110
 
111
111
  Bucle EXTERNO secuencial (f[i] depende de f[j<i]); bucle INTERNO sobre la
112
112
  ventana de predecesores vectorizado. En empate gana el predecesor más
113
- cercano (mismo desempate que el C).
113
+ cercano (mismo desempate que el C). Coste de hueco estilo minimap2:
114
+ ``gap_w·|l| + 0.5·log2|l|``.
114
115
  """
115
116
  n = xs.size
116
117
  f = np.full(n, float(k), dtype=np.float64)
@@ -130,8 +131,8 @@ def _chain_fill_numpy(xs: np.ndarray, ys: np.ndarray, k: int):
130
131
  if not valid.any():
131
132
  continue
132
133
  match = np.minimum(np.minimum(dx, dy), k).astype(np.float64)
133
- logterm = np.where(gap > 0, np.log2(gap + 1.0), 0.0)
134
- sc = np.where(valid, f[lo:i] + match - (_GAP_W * gap + logterm), -np.inf)
134
+ logterm = np.where(gap > 0, 0.5 * np.log2(np.maximum(gap, 1)), 0.0)
135
+ sc = np.where(valid, f[lo:i] + match - (gap_w * gap + logterm), -np.inf)
135
136
  b = sc.size - 1 - int(sc[::-1].argmax()) # empate → predecesor cercano
136
137
  if sc[b] > kf:
137
138
  f[i], prev[i] = float(sc[b]), lo + b
@@ -153,11 +154,12 @@ def _chain_one(x: np.ndarray, y: np.ndarray, k: int,
153
154
  ys = np.ascontiguousarray(y[order], dtype=np.int64)
154
155
 
155
156
  # Relleno del DP: C si está disponible (10-50× más rápido), si no NumPy.
157
+ gap_w = _GAP_COEF * k # 0.01·k (coste de hueco minimap2)
156
158
  if C_CHAIN_AVAILABLE:
157
- f, prev = c_chain_dp(xs, ys, k, _MAX_GAP, _WINDOW, _GAP_W)
159
+ f, prev = c_chain_dp(xs, ys, k, _MAX_GAP, _WINDOW, gap_w)
158
160
  prev = prev.astype(np.int64)
159
161
  else:
160
- f, prev = _chain_fill_numpy(xs, ys, k)
162
+ f, prev = _chain_fill_numpy(xs, ys, k, gap_w)
161
163
 
162
164
  # Backtrack de cadenas no solapadas, por score descendente.
163
165
  used = np.zeros(n, dtype=bool)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bioforge
3
- Version: 3.3.0
3
+ Version: 3.4.0
4
4
  Summary: High-performance bioinformatics engine for Edge Computing — 5-bit encoding, vectorised NumPy core, optional C backend
5
5
  Author-email: Aarón Aranda Torrijos <noe9601@gmail.com>
6
6
  License: # PolyForm Noncommercial License 1.0.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes