Commit 2c5c858 1 parent 7b6f4a3 commit 2c5c858 Copy full SHA for 2c5c858
File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ def cellrank_to_tree(
18
18
auto_root : bool = False ,
19
19
root_params : dict = {},
20
20
reassign_pseudotime : bool = False ,
21
+ key_cellrank = "term_states_fwd_memberships" ,
21
22
copy = False ,
22
23
** kwargs
23
24
):
@@ -48,6 +49,8 @@ def cellrank_to_tree(
48
49
min_val parameter from :func:`scFates.tl.root`
49
50
reassign_pseudotime
50
51
whether use the time key to replace the distances comptued from the tree.
52
+ key_cellrank
53
+ where to get the forward terminal fate memberships.
51
54
copy
52
55
Return a copy instead of writing to adata.
53
56
kwargs
@@ -90,18 +93,18 @@ def cellrank_to_tree(
90
93
91
94
adata = adata .copy () if copy else adata
92
95
93
- n_states = adata .obsm ["to_terminal_states" ].shape [1 ]
96
+ n_states = adata .obsm [key_cellrank ].shape [1 ]
94
97
95
98
if n_states == 2 :
96
99
adata .obsm ["X_fates" ] = np .vstack (
97
100
[
98
- np .array (adata .obsm ["to_terminal_states" ][:, 0 ].flatten ()),
101
+ np .array (adata .obsm [key_cellrank ][:, 0 ].flatten ()),
99
102
adata .obs [time ],
100
103
]
101
104
).T
102
105
logg .hint (
103
106
"with .obsm['X_fates'], created by combining:\n "
104
- " .obsm['to_terminal_states' ][:,0] and adata.obs['" + time + " ']\n "
107
+ f " .obsm[{ key_cellrank } ][:,0] and adata.obs['{ time } ']\n "
105
108
)
106
109
else :
107
110
logg .hint (
You can’t perform that action at this time.
0 commit comments