phylogenie 1.0.6__py3-none-any.whl → 1.0.7__py3-none-any.whl
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.
- phylogenie/backend/treesimulator.py +1 -0
- phylogenie/core/msas/base.py +20 -3
- {phylogenie-1.0.6.dist-info → phylogenie-1.0.7.dist-info}/METADATA +1 -1
- {phylogenie-1.0.6.dist-info → phylogenie-1.0.7.dist-info}/RECORD +7 -7
- {phylogenie-1.0.6.dist-info → phylogenie-1.0.7.dist-info}/LICENSE.txt +0 -0
- {phylogenie-1.0.6.dist-info → phylogenie-1.0.7.dist-info}/WHEEL +0 -0
- {phylogenie-1.0.6.dist-info → phylogenie-1.0.7.dist-info}/entry_points.txt +0 -0
phylogenie/core/msas/base.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from abc import abstractmethod
|
|
3
3
|
from enum import Enum
|
|
4
|
+
from pathlib import Path
|
|
4
5
|
from typing import Literal
|
|
5
6
|
|
|
6
7
|
from numpy.random import Generator
|
|
@@ -14,9 +15,14 @@ class BackendType(str, Enum):
|
|
|
14
15
|
ALISIM = "alisim"
|
|
15
16
|
|
|
16
17
|
|
|
18
|
+
MSAS_DIRNAME = "MSAs"
|
|
19
|
+
TREES_DIRNAME = "trees"
|
|
20
|
+
|
|
21
|
+
|
|
17
22
|
class MSAsGenerator(DatasetGenerator):
|
|
18
23
|
data_type: Literal[DataType.MSAS] = DataType.MSAS
|
|
19
24
|
trees: TreesGeneratorConfig
|
|
25
|
+
keep_trees: bool = False
|
|
20
26
|
|
|
21
27
|
@abstractmethod
|
|
22
28
|
def _generate_one_from_tree(
|
|
@@ -24,11 +30,22 @@ class MSAsGenerator(DatasetGenerator):
|
|
|
24
30
|
) -> None: ...
|
|
25
31
|
|
|
26
32
|
def _generate_one(self, filename: str, rng: Generator, data: pgt.Data) -> None:
|
|
27
|
-
|
|
33
|
+
if self.keep_trees:
|
|
34
|
+
base_dir = Path(filename).parent
|
|
35
|
+
file_id = Path(filename).stem
|
|
36
|
+
tree_filename = os.path.join(base_dir, TREES_DIRNAME, file_id)
|
|
37
|
+
msas_dir = os.path.join(base_dir, MSAS_DIRNAME)
|
|
38
|
+
os.makedirs(msas_dir, exist_ok=True)
|
|
39
|
+
msa_filename = os.path.join(msas_dir, file_id)
|
|
40
|
+
else:
|
|
41
|
+
tree_filename = f"{filename}.temp-tree"
|
|
42
|
+
msa_filename = filename
|
|
43
|
+
|
|
28
44
|
self.trees.generate_one(
|
|
29
45
|
filename=tree_filename, data=data, seed=int(rng.integers(0, 2**32 - 1))
|
|
30
46
|
)
|
|
31
47
|
self._generate_one_from_tree(
|
|
32
|
-
filename=
|
|
48
|
+
filename=msa_filename, tree_file=f"{tree_filename}.nwk", rng=rng, data=data
|
|
33
49
|
)
|
|
34
|
-
|
|
50
|
+
if not self.keep_trees:
|
|
51
|
+
os.remove(f"{tree_filename}.nwk")
|
|
@@ -3,7 +3,7 @@ phylogenie/backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
|
|
|
3
3
|
phylogenie/backend/remaster/__init__.py,sha256=g1oMKi6SX60Geq_e2AjBlf7-pDvLfrsT3gW6AORdbMo,509
|
|
4
4
|
phylogenie/backend/remaster/generate.py,sha256=Sb5izUQO0GmUcIEMoXtHWLsh9c4vIeyNIUm7u4RVLdw,6100
|
|
5
5
|
phylogenie/backend/remaster/reactions.py,sha256=oc2ZY9WtTajbOWjARDmA0JnS255tbVeMt1DmyCUp95M,5904
|
|
6
|
-
phylogenie/backend/treesimulator.py,sha256=
|
|
6
|
+
phylogenie/backend/treesimulator.py,sha256=pJmSX_0EOFngJTCxh36qTap1llYIZq4p9azQ9PIjlo4,5469
|
|
7
7
|
phylogenie/configs.py,sha256=HtRUWZ-zNq1--zTBWL3QFXX27Ybw5x1qSWcmx7Sz8YA,125
|
|
8
8
|
phylogenie/core/__init__.py,sha256=pvQMohKFAPaSvujw7H5sQJn7SOSqENQUHECuVfUBVNg,402
|
|
9
9
|
phylogenie/core/configs.py,sha256=9tUYWrmdDn_Gg6xnywCDcGDEk0gne0vYqFH9dXixJbM,1042
|
|
@@ -15,7 +15,7 @@ phylogenie/core/dataset.py,sha256=mgPAexXTat6x7YB9-BI6d5HWwrAvt8xydmiWVzwVD3M,24
|
|
|
15
15
|
phylogenie/core/factories.py,sha256=DwuocGd48Ham7wD7uyGnGA0tHvXhzuP1Ji0PW5-onwM,7397
|
|
16
16
|
phylogenie/core/msas/__init__.py,sha256=-2XjTmiTA6zAwiLs2ksKecCrSbNLheo7KKjDyvuLipg,207
|
|
17
17
|
phylogenie/core/msas/alisim.py,sha256=TG4LAHJaH3rGWa3cwXzX6MgaXuh2tLzhdoALyOkoiXY,1047
|
|
18
|
-
phylogenie/core/msas/base.py,sha256=
|
|
18
|
+
phylogenie/core/msas/base.py,sha256=Mw7bI4PU7J4b5mrsd0kMkJVJk7bqmJQZFtZ91I8oRS0,1597
|
|
19
19
|
phylogenie/core/trees/__init__.py,sha256=epKgJ-EI04kBEuS4kfBcnsAj7dMObT1T742peBAnB78,335
|
|
20
20
|
phylogenie/core/trees/base.py,sha256=sNBCJRtWGYaMog4WoyAkrK4F2SXrgjXrxjuVQ6Ae5Js,305
|
|
21
21
|
phylogenie/core/trees/remaster/__init__.py,sha256=FfgXYjkeosb22Anbp78re2NssWtNcNNaj7hFQZx8JLE,116
|
|
@@ -32,8 +32,8 @@ phylogenie/skyline/parameter.py,sha256=CJ5OEyRQG2Tg1WJWQ1IpfX-6hjJv80Zj8lMoRke5n
|
|
|
32
32
|
phylogenie/skyline/vector.py,sha256=Zh6HWoziXQFKDz-XvVE2e_Tw1706NrbwcvBpyPpw_cc,7120
|
|
33
33
|
phylogenie/typeguards.py,sha256=WBOSJSaOC8VDtrYoA2w_AYEXTpyKdCfmsM29KaKXl3A,1350
|
|
34
34
|
phylogenie/typings.py,sha256=93VRedBxrpzXkT4uaNu_1JiMzsOjp7fUy4kLv_eYxUE,565
|
|
35
|
-
phylogenie-1.0.
|
|
36
|
-
phylogenie-1.0.
|
|
37
|
-
phylogenie-1.0.
|
|
38
|
-
phylogenie-1.0.
|
|
39
|
-
phylogenie-1.0.
|
|
35
|
+
phylogenie-1.0.7.dist-info/LICENSE.txt,sha256=NUrDqElK-eD3I0WqC004CJsy6cs0JgsAoebDv_42-pw,1071
|
|
36
|
+
phylogenie-1.0.7.dist-info/METADATA,sha256=nxNZz_0FxtO1QnN99JDqE3c_a6K5I2YkiQBbuFuALVg,6291
|
|
37
|
+
phylogenie-1.0.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
38
|
+
phylogenie-1.0.7.dist-info/entry_points.txt,sha256=Rt6_usN0FkBX1ZfiqCirjMN9FKOgFLG8rydcQ8kugeE,51
|
|
39
|
+
phylogenie-1.0.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|