Skip to content

Commit e3a0ec9

Browse files
authored
Merge pull request #177 from BiomedicalMachineLearning/dev_psts
Dev psts
2 parents 45c1db0 + fdad11c commit e3a0ec9

File tree

6 files changed

+39
-13
lines changed

6 files changed

+39
-13
lines changed

HISTORY.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
History
33
=======
44

5+
0.4.8 (2022-06-15)
6+
------------------
57
0.4.7 (2022-03-28)
68
------------------
79
0.4.6 (2022-03-09)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.4.7
2+
current_version = 0.4.8
33
commit = True
44
tag = True
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@
4949
test_suite="tests",
5050
tests_require=test_requirements,
5151
url="https://github.com/BiomedicalMachineLearning/stLearn",
52-
version="0.4.7",
52+
version="0.4.8",
5353
zip_safe=False,
5454
)

stlearn/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
__author__ = """Genomics and Machine Learning lab"""
44
__email__ = "duy.pham@uq.edu.au"
5-
__version__ = "0.4.7"
5+
__version__ = "0.4.8"
66

77

88
from . import add

stlearn/plotting/classes.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,12 @@ def __init__(
640640
text_box_size: Optional[float] = 5,
641641
color_bar_size: Optional[float] = 10,
642642
bbox_to_anchor: Optional[Tuple[float, float]] = (1, 1),
643+
# trajectory
644+
trajectory_node_size: Optional[int] = 10,
645+
trajectory_alpha: Optional[float] = 1.0,
646+
trajectory_width: Optional[float] = 2.5,
647+
trajectory_edge_color: Optional[str] = "#f4efd3",
648+
trajectory_arrowsize: Optional[int] = 17,
643649
):
644650
super().__init__(
645651
adata=adata,
@@ -683,6 +689,13 @@ def __init__(
683689
if show_subcluster:
684690
self._add_sub_clusters()
685691
if show_trajectories:
692+
693+
self.trajectory_node_size = trajectory_node_size
694+
self.trajectory_alpha = trajectory_alpha
695+
self.trajectory_width = trajectory_width
696+
self.trajectory_edge_color = trajectory_edge_color
697+
self.trajectory_arrowsize = trajectory_arrowsize
698+
686699
self._add_trajectories()
687700

688701
if crop:
@@ -913,23 +926,23 @@ def _add_trajectories(self):
913926
nx.draw_networkx_edges(
914927
G,
915928
pos=centroid_dict,
916-
node_size=10,
917-
alpha=1.0,
918-
width=2.5,
919-
edge_color="#f4efd3",
920-
arrowsize=17,
929+
node_size=self.trajectory_node_size,
930+
alpha=self.trajectory_alpha,
931+
width=self.trajectory_width,
932+
edge_color=self.trajectory_edge_color,
933+
arrowsize=self.trajectory_arrowsize,
921934
arrowstyle="<|-",
922935
connectionstyle="arc3,rad=0.2",
923936
)
924937
else:
925938
nx.draw_networkx_edges(
926939
G,
927940
pos=centroid_dict,
928-
node_size=10,
929-
alpha=1.0,
930-
width=2.5,
931-
edge_color="#f4efd3",
932-
arrowsize=17,
941+
node_size=self.trajectory_node_size,
942+
alpha=self.trajectory_alpha,
943+
width=self.trajectory_width,
944+
edge_color=self.trajectory_edge_color,
945+
arrowsize=self.trajectory_arrowsize,
933946
arrowstyle="-|>",
934947
connectionstyle="arc3,rad=0.2",
935948
)

stlearn/plotting/cluster_plot.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ def cluster_plot(
5353
text_box_size: Optional[float] = 5,
5454
color_bar_size: Optional[float] = 10,
5555
bbox_to_anchor: Optional[Tuple[float, float]] = (1, 1),
56+
# trajectory
57+
trajectory_node_size: Optional[int] = 10,
58+
trajectory_alpha: Optional[float] = 1.0,
59+
trajectory_width: Optional[float] = 2.5,
60+
trajectory_edge_color: Optional[str] = "#f4efd3",
61+
trajectory_arrowsize: Optional[int] = 17,
5662
) -> Optional[AnnData]:
5763

5864
"""\
@@ -106,6 +112,11 @@ def cluster_plot(
106112
text_box_size=text_box_size,
107113
color_bar_size=color_bar_size,
108114
bbox_to_anchor=bbox_to_anchor,
115+
trajectory_node_size=trajectory_node_size,
116+
trajectory_alpha=trajectory_alpha,
117+
trajectory_width=trajectory_width,
118+
trajectory_edge_color=trajectory_edge_color,
119+
trajectory_arrowsize=trajectory_arrowsize,
109120
)
110121

111122

0 commit comments

Comments
 (0)