scFates 1.2.3__tar.gz → 1.2.4__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.
- {scfates-1.2.3/scFates.egg-info → scfates-1.2.4}/PKG-INFO +2 -2
- {scfates-1.2.3 → scfates-1.2.4}/pyproject.toml +1 -1
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/graph_fitting.py +0 -132
- {scfates-1.2.3 → scfates-1.2.4/scFates.egg-info}/PKG-INFO +2 -2
- {scfates-1.2.3 → scfates-1.2.4}/scFates.egg-info/requires.txt +1 -1
- {scfates-1.2.3 → scfates-1.2.4}/LICENSE +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/MANIFEST.in +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/README.md +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/__init__.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/datasets/__init__.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/datasets/_datasets.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/datasets/test.h5ad +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/get/__init__.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/get/get.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/logging.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/pl.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/__init__.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/binned_pseudotime_meta.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/covariate.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/dendrogram.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/features.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/linearity_deviation.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/matrix.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/milestones.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/module_inclusion.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/modules.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/palette_tools.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/palettes.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/slide_cors.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/synchro_path.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/test_association.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/test_fork.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/trajectory.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/plot/utils.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/pp.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/preprocessing/__init__.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/preprocessing/diffusion.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/preprocessing/pagoda2.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/settings.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tests/test_w_plots.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tl.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/__init__.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/_test_monocle3.R +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/bifurcation_tools.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/cluster.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/conversion.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/correlation_tools.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/covariate.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/dendrogram.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/fit.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/graph_operations.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/linearity_deviation.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/pseudotime.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/root.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/slide_cors.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/test_association.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates/tools/utils.py +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates.egg-info/SOURCES.txt +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates.egg-info/dependency_links.txt +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/scFates.egg-info/top_level.txt +0 -0
- {scfates-1.2.3 → scfates-1.2.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scFates
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: scanpy compatible python suite for fast tree inference and advanced pseudotime downstream analysis
|
|
5
5
|
Author: Louis Faure
|
|
6
6
|
Project-URL: Repository, https://github.com/LouisFaure/scFates
|
|
@@ -26,7 +26,7 @@ Requires-Dist: typing_extensions
|
|
|
26
26
|
Requires-Dist: scikit-learn
|
|
27
27
|
Requires-Dist: scikit-misc
|
|
28
28
|
Requires-Dist: simpleppt>=1.1.3
|
|
29
|
-
Requires-Dist: elpigraph-python
|
|
29
|
+
Requires-Dist: elpigraph-python>=0.3.4
|
|
30
30
|
Requires-Dist: networkx>3.0
|
|
31
31
|
Requires-Dist: igraph>=0.9.6
|
|
32
32
|
Requires-Dist: adjustText>=0.7.3
|
|
@@ -23,132 +23,6 @@ from .. import settings
|
|
|
23
23
|
from .utils import get_X
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
def _patch_elpigraph_grammar():
|
|
27
|
-
"""Monkey-patch elpigraph's AddNode2Node to fix numpy 2.x scalar assignment.
|
|
28
|
-
|
|
29
|
-
In elpigraph 0.3.2, ``ineighbour`` is a 1-element array but is used as a
|
|
30
|
-
scalar index, causing ``ValueError: setting an array element with a sequence``
|
|
31
|
-
on numpy ≥ 2.0 (Linux x86 build) because:
|
|
32
|
-
- ``Mus[ineighbour]`` returns shape ``(1,)`` assigned to a scalar slot
|
|
33
|
-
- ``NodePositions[ineighbour,]`` returns shape ``(1, ndims)`` instead of ``(ndims,)``
|
|
34
|
-
"""
|
|
35
|
-
try:
|
|
36
|
-
import elpigraph.src.grammar_operations as _go
|
|
37
|
-
except ImportError:
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
_orig = _go.AddNode2Node
|
|
41
|
-
|
|
42
|
-
def _patched_AddNode2Node(
|
|
43
|
-
X,
|
|
44
|
-
NodePositions,
|
|
45
|
-
ElasticMatrix,
|
|
46
|
-
partition,
|
|
47
|
-
AdjustVect,
|
|
48
|
-
FixNodesAtPoints,
|
|
49
|
-
Max_K=float("inf"),
|
|
50
|
-
MaxNumberOfGraphCandidates=float("inf"),
|
|
51
|
-
PointWeights=None,
|
|
52
|
-
):
|
|
53
|
-
import numpy as _np
|
|
54
|
-
|
|
55
|
-
nNodes = NodePositions.shape[0]
|
|
56
|
-
Mus = ElasticMatrix.diagonal()
|
|
57
|
-
Lambda = ElasticMatrix.copy()
|
|
58
|
-
_np.fill_diagonal(Lambda, 0)
|
|
59
|
-
indL = Lambda > 0
|
|
60
|
-
Connectivities = indL.sum(axis=0)
|
|
61
|
-
|
|
62
|
-
if PointWeights is not None:
|
|
63
|
-
assoc = _np.bincount(
|
|
64
|
-
partition[partition > -1].ravel(),
|
|
65
|
-
weights=PointWeights[partition > -1].ravel(),
|
|
66
|
-
minlength=nNodes,
|
|
67
|
-
)
|
|
68
|
-
else:
|
|
69
|
-
assoc = _np.bincount(
|
|
70
|
-
partition[partition > -1].ravel(), minlength=nNodes
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
npProt = _np.vstack(
|
|
74
|
-
(NodePositions, _np.zeros((1, NodePositions.shape[1])))
|
|
75
|
-
)
|
|
76
|
-
emProt = _np.vstack(
|
|
77
|
-
(
|
|
78
|
-
_np.hstack((Lambda, _np.zeros((nNodes, 1)))),
|
|
79
|
-
_np.zeros((1, nNodes + 1)),
|
|
80
|
-
)
|
|
81
|
-
)
|
|
82
|
-
niProt = _np.arange(nNodes + 1, dtype=int)
|
|
83
|
-
MuProt = _np.zeros(nNodes + 1)
|
|
84
|
-
MuProt[:-1] = Mus
|
|
85
|
-
|
|
86
|
-
if not _np.isinf(Max_K):
|
|
87
|
-
Degree = _np.sum(ElasticMatrix > 0, axis=1)
|
|
88
|
-
Degree[Degree > 1] = Degree[Degree > 1] - 1
|
|
89
|
-
if _np.sum(Degree <= Max_K) > 1:
|
|
90
|
-
idx_nodes = _np.where(Degree <= Max_K)[0]
|
|
91
|
-
else:
|
|
92
|
-
raise ValueError(
|
|
93
|
-
"AddNode2Node impossible with the current parameters!"
|
|
94
|
-
)
|
|
95
|
-
else:
|
|
96
|
-
idx_nodes = _np.array(range(nNodes))
|
|
97
|
-
|
|
98
|
-
if MaxNumberOfGraphCandidates < len(idx_nodes) and _np.isinf(Max_K):
|
|
99
|
-
idx_nodes = _np.argsort(assoc)[::-1][:MaxNumberOfGraphCandidates]
|
|
100
|
-
elif MaxNumberOfGraphCandidates < len(idx_nodes) and not (
|
|
101
|
-
_np.isinf(Max_K)
|
|
102
|
-
):
|
|
103
|
-
nGraphs = [
|
|
104
|
-
i
|
|
105
|
-
for i in _np.argsort(assoc)[::-1]
|
|
106
|
-
if i in idx_nodes
|
|
107
|
-
]
|
|
108
|
-
idx_nodes = _np.array(nGraphs)[:MaxNumberOfGraphCandidates]
|
|
109
|
-
|
|
110
|
-
if FixNodesAtPoints != []:
|
|
111
|
-
idx_nodes = idx_nodes[
|
|
112
|
-
~_np.isin(idx_nodes, _np.arange(len(FixNodesAtPoints)))
|
|
113
|
-
]
|
|
114
|
-
|
|
115
|
-
NodePositionsArray = [npProt.copy() for i in range(len(idx_nodes))]
|
|
116
|
-
ElasticMatrices = [emProt.copy() for i in range(len(idx_nodes))]
|
|
117
|
-
NodeIndicesArray = _np.repeat(
|
|
118
|
-
niProt[:, _np.newaxis], len(idx_nodes), axis=1
|
|
119
|
-
)
|
|
120
|
-
AdjustVectArray = [AdjustVect + [False] for i in range(len(idx_nodes))]
|
|
121
|
-
|
|
122
|
-
for j, i in enumerate(idx_nodes):
|
|
123
|
-
MuProt[-1] = 0
|
|
124
|
-
meanL = Lambda[i, indL[i,]].mean(axis=0)
|
|
125
|
-
ElasticMatrices[j][nNodes, i] = ElasticMatrices[j][i, nNodes] = meanL
|
|
126
|
-
|
|
127
|
-
if Connectivities[i] == 1:
|
|
128
|
-
ineighbour = _np.nonzero(indL[i,])[0][0] # scalar, not array
|
|
129
|
-
NewNodePosition = (
|
|
130
|
-
2 * NodePositions[i,] - NodePositions[ineighbour,]
|
|
131
|
-
)
|
|
132
|
-
MuProt[i] = Mus[ineighbour] # scalar assignment
|
|
133
|
-
else:
|
|
134
|
-
if assoc[i] == 0:
|
|
135
|
-
NewNodePosition = NodePositions[indL[:, i]].mean(axis=0)
|
|
136
|
-
else:
|
|
137
|
-
NewNodePosition = X[(partition == i).ravel()].mean(axis=0)
|
|
138
|
-
|
|
139
|
-
NodePositionsArray[j][nNodes, :] = NewNodePosition
|
|
140
|
-
_np.fill_diagonal(ElasticMatrices[j], MuProt)
|
|
141
|
-
|
|
142
|
-
return (
|
|
143
|
-
NodePositionsArray,
|
|
144
|
-
ElasticMatrices,
|
|
145
|
-
AdjustVectArray,
|
|
146
|
-
NodeIndicesArray,
|
|
147
|
-
)
|
|
148
|
-
|
|
149
|
-
_go.AddNode2Node = _patched_AddNode2Node
|
|
150
|
-
|
|
151
|
-
|
|
152
26
|
def curve(
|
|
153
27
|
adata: AnnData,
|
|
154
28
|
Nodes: int = None,
|
|
@@ -592,8 +466,6 @@ def tree_epg(
|
|
|
592
466
|
|
|
593
467
|
import elpigraph
|
|
594
468
|
|
|
595
|
-
_patch_elpigraph_grammar()
|
|
596
|
-
|
|
597
469
|
logg.hint(
|
|
598
470
|
"parameters used \n"
|
|
599
471
|
" "
|
|
@@ -656,8 +528,6 @@ def curve_epg(
|
|
|
656
528
|
):
|
|
657
529
|
import elpigraph
|
|
658
530
|
|
|
659
|
-
_patch_elpigraph_grammar()
|
|
660
|
-
|
|
661
531
|
X, use_rep = get_data(adata, use_rep, ndims_rep)
|
|
662
532
|
X = X.values
|
|
663
533
|
|
|
@@ -723,8 +593,6 @@ def circle_epg(
|
|
|
723
593
|
):
|
|
724
594
|
import elpigraph
|
|
725
595
|
|
|
726
|
-
_patch_elpigraph_grammar()
|
|
727
|
-
|
|
728
596
|
X, use_rep = get_data(adata, use_rep, ndims_rep)
|
|
729
597
|
X = X.values
|
|
730
598
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scFates
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: scanpy compatible python suite for fast tree inference and advanced pseudotime downstream analysis
|
|
5
5
|
Author: Louis Faure
|
|
6
6
|
Project-URL: Repository, https://github.com/LouisFaure/scFates
|
|
@@ -26,7 +26,7 @@ Requires-Dist: typing_extensions
|
|
|
26
26
|
Requires-Dist: scikit-learn
|
|
27
27
|
Requires-Dist: scikit-misc
|
|
28
28
|
Requires-Dist: simpleppt>=1.1.3
|
|
29
|
-
Requires-Dist: elpigraph-python
|
|
29
|
+
Requires-Dist: elpigraph-python>=0.3.4
|
|
30
30
|
Requires-Dist: networkx>3.0
|
|
31
31
|
Requires-Dist: igraph>=0.9.6
|
|
32
32
|
Requires-Dist: adjustText>=0.7.3
|
|
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
|
|
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
|
|
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
|