phylogenie 3.1.8__tar.gz → 3.1.9__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.
- {phylogenie-3.1.8/src/phylogenie.egg-info → phylogenie-3.1.9}/PKG-INFO +1 -1
- {phylogenie-3.1.8 → phylogenie-3.1.9}/pyproject.toml +1 -1
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/draw.py +3 -6
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/io/fasta.py +9 -3
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/msa.py +4 -3
- {phylogenie-3.1.8 → phylogenie-3.1.9/src/phylogenie.egg-info}/PKG-INFO +1 -1
- {phylogenie-3.1.8 → phylogenie-3.1.9}/LICENSE.txt +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/README.md +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/setup.cfg +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/__init__.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/generators/__init__.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/generators/alisim.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/generators/configs.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/generators/dataset.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/generators/factories.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/generators/trees.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/generators/typeguards.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/io/__init__.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/main.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/mixins.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/py.typed +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/skyline/__init__.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/skyline/matrix.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/skyline/parameter.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/skyline/vector.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/__init__.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/events/__init__.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/events/base.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/events/contact_tracing.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/events/core.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/events/mutations.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/features.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/gillespie.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/io/__init__.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/io/newick.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/io/nexus.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/model.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/tree.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/utils.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/typeguards.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/typings.py +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie.egg-info/SOURCES.txt +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie.egg-info/dependency_links.txt +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie.egg-info/entry_points.txt +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie.egg-info/requires.txt +0 -0
- {phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie.egg-info/top_level.txt +0 -0
|
@@ -382,7 +382,7 @@ def _init_colored_tree_continuous(
|
|
|
382
382
|
vmin: float | None = ...,
|
|
383
383
|
vmax: float | None = ...,
|
|
384
384
|
*,
|
|
385
|
-
show_hist: Literal[True],
|
|
385
|
+
show_hist: Literal[True] = True,
|
|
386
386
|
hist_kwargs: dict[str, Any] | None = ...,
|
|
387
387
|
hist_axes_kwargs: dict[str, Any] | None = ...,
|
|
388
388
|
) -> tuple[Axes, dict[Tree, Color], Axes]: ...
|
|
@@ -394,7 +394,6 @@ def _init_colored_tree_continuous(
|
|
|
394
394
|
colormap: str | Colormap = "viridis",
|
|
395
395
|
vmin: float | None = None,
|
|
396
396
|
vmax: float | None = None,
|
|
397
|
-
*,
|
|
398
397
|
show_hist: bool = True,
|
|
399
398
|
hist_kwargs: dict[str, Any] | None = None,
|
|
400
399
|
hist_axes_kwargs: dict[str, Any] | None = None,
|
|
@@ -493,8 +492,7 @@ def draw_colored_tree_continuous(
|
|
|
493
492
|
colormap: str | Colormap = "viridis",
|
|
494
493
|
vmin: float | None = None,
|
|
495
494
|
vmax: float | None = None,
|
|
496
|
-
|
|
497
|
-
show_hist: Literal[True],
|
|
495
|
+
show_hist: Literal[True] = True,
|
|
498
496
|
hist_kwargs: dict[str, Any] | None = None,
|
|
499
497
|
hist_axes_kwargs: dict[str, Any] | None = None,
|
|
500
498
|
) -> tuple[Axes, Axes]: ...
|
|
@@ -602,8 +600,7 @@ def draw_colored_dated_tree_continuous(
|
|
|
602
600
|
colormap: str | Colormap = "viridis",
|
|
603
601
|
vmin: float | None = None,
|
|
604
602
|
vmax: float | None = None,
|
|
605
|
-
|
|
606
|
-
show_hist: Literal[True],
|
|
603
|
+
show_hist: Literal[True] = True,
|
|
607
604
|
hist_kwargs: dict[str, Any] | None = None,
|
|
608
605
|
hist_axes_kwargs: dict[str, Any] | None = None,
|
|
609
606
|
) -> tuple[Axes, Axes]: ...
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from datetime import date
|
|
1
2
|
from pathlib import Path
|
|
2
3
|
from typing import Callable
|
|
3
4
|
|
|
@@ -5,7 +6,8 @@ from phylogenie.msa import MSA, Sequence
|
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
def load_fasta(
|
|
8
|
-
fasta_file: str | Path,
|
|
9
|
+
fasta_file: str | Path,
|
|
10
|
+
extract_time_from_id: Callable[[str], float | date] | None = None,
|
|
9
11
|
) -> MSA:
|
|
10
12
|
sequences: list[Sequence] = []
|
|
11
13
|
with open(fasta_file, "r") as f:
|
|
@@ -17,10 +19,14 @@ def load_fasta(
|
|
|
17
19
|
if extract_time_from_id is not None:
|
|
18
20
|
time = extract_time_from_id(id)
|
|
19
21
|
elif "|" in id:
|
|
22
|
+
last_metadata = id.split("|")[-1]
|
|
20
23
|
try:
|
|
21
|
-
time = float(
|
|
24
|
+
time = float(last_metadata)
|
|
22
25
|
except ValueError:
|
|
23
|
-
|
|
26
|
+
try:
|
|
27
|
+
time = date.fromisoformat(last_metadata)
|
|
28
|
+
except ValueError:
|
|
29
|
+
pass
|
|
24
30
|
chars = next(f).strip()
|
|
25
31
|
sequences.append(Sequence(id, chars, time))
|
|
26
32
|
return MSA(sequences)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from collections.abc import Iterator
|
|
2
2
|
from dataclasses import dataclass
|
|
3
|
+
from datetime import date
|
|
3
4
|
|
|
4
5
|
import numpy as np
|
|
5
6
|
|
|
@@ -8,7 +9,7 @@ import numpy as np
|
|
|
8
9
|
class Sequence:
|
|
9
10
|
id: str
|
|
10
11
|
chars: str
|
|
11
|
-
time: float | None = None
|
|
12
|
+
time: float | date | None = None
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class MSA:
|
|
@@ -25,8 +26,8 @@ class MSA:
|
|
|
25
26
|
return [sequence.id for sequence in self.sequences]
|
|
26
27
|
|
|
27
28
|
@property
|
|
28
|
-
def times(self) -> list[float]:
|
|
29
|
-
times: list[float] = []
|
|
29
|
+
def times(self) -> list[float | date]:
|
|
30
|
+
times: list[float | date] = []
|
|
30
31
|
for sequence in self:
|
|
31
32
|
if sequence.time is None:
|
|
32
33
|
raise ValueError(f"Time is not set for sequence {sequence.id}.")
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{phylogenie-3.1.8 → phylogenie-3.1.9}/src/phylogenie/treesimulator/events/contact_tracing.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|