Skip to content

Commit 69e21a5

Browse files
committed
v2.0.1 first updates
1 parent ce3c5c5 commit 69e21a5

File tree

7 files changed

+84
-6
lines changed

7 files changed

+84
-6
lines changed

docs/source/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
# -- Project information
44

55
project = "scLiTr"
6-
copyright = "2024, Kharchenko lab, Adameyko lab"
6+
copyright = "2026, Kharchenko lab, Adameyko lab"
77
authors = "Isaev"
88

9-
release = "2.0.0"
10-
version = "2.0.0"
9+
release = "2.0.1"
10+
version = "2.0.1"
1111

1212
# -- General configuration ------------------------------------------------
1313

sclitr/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from . import utils
66
from . import seurat
77

8-
__version__ = "2.0.0"
8+
__version__ = "2.0.1"
99

1010
# Restrict top-level tab-completion to submodules only
1111
__all__ = [

sclitr/associations.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,29 @@ def graph_associations(
628628
key_added: str = "X_gPCA",
629629
) -> None:
630630
"""
631+
Computes the supervised principal components analysis (sPCA) of the data
632+
[10.1016/j.patcog.2010.12.015]. Shortly, it finds the axes that maximize the correlation
633+
between the gene expression and the graph Laplacian (one can see it as an
634+
autocorrelation-aware PCA).
635+
636+
Parameters
637+
----------
638+
adata : sc.AnnData
639+
AnnData object containing the data.
640+
layer : None | str
641+
Layer to use for the analysis.
642+
graph_key : str
643+
Key to use for the graph.
644+
n_pcs : int
645+
Number of principal components to compute.
646+
adj_method : str
647+
Method for adjusting p-values.
648+
key_added : str
649+
Key to use for adding the results to the AnnData object.
650+
651+
Returns
652+
-------
653+
None
631654
"""
632655
from scipy.sparse.linalg import eigsh
633656
import scipy.stats as stats

sclitr/catboost.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@
1717
logg = sc.logging
1818

1919
class _catboost_tqdm:
20+
"""
21+
Custom progress bar for CatBoost training.
22+
23+
Parameters
24+
----------
25+
total_iterations : int
26+
Total number of iterations.
27+
show : bool, optional
28+
Whether to show the progress bar, by default True.
29+
prefix : str, optional
30+
Prefix for the progress bar, by default "".
31+
"""
2032
def __init__(self, total_iterations, show: bool = True, prefix: str = ""):
2133
if show:
2234
self.pbar = tqdm(

sclitr/datasets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def Erickson_murine_development(
3333
file_path: str | Path | None = None,
3434
) -> AnnData:
3535
"""
36-
Dataset from [PMID: None] with clonal atlas of murine development.
36+
Dataset from [PMID: 40502176] with clonal atlas of murine development.
3737
3838
Parameters
3939
----------

sclitr/eigenvalues.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@
3636
def _tracy_widom_cdf(x: float) -> float:
3737
"""
3838
Computes the CDF of the Tracy-Widom distribution (with beta = 1).
39+
40+
Parameters
41+
----------
42+
x : float
43+
Value at which to evaluate the CDF.
44+
45+
Returns
46+
-------
47+
float
48+
The value of the CDF at x.
3949
"""
4050
if x > 3:
4151
tail_prob = np.exp(-2.0/3.0 * x**1.5) / (4.0 * np.sqrt(np.pi) * x**1.5)
@@ -57,6 +67,17 @@ def _tracy_widom_cdf(x: float) -> float:
5767

5868
def _calculate_statistics(X: np.ndarray) -> float:
5969
"""
70+
Calculates the test statistic for the Tracy-Widom distribution.
71+
72+
Parameters
73+
----------
74+
X : np.ndarray
75+
Matrix of shape (n, p) containing the data.
76+
77+
Returns
78+
-------
79+
float
80+
The value of the test statistic.
6081
"""
6182
n, p = X.shape
6283
X_centered = (X - np.mean(X, axis=0)) / np.std(X, axis=0)
@@ -85,6 +106,28 @@ def eigenvalue_test(
85106
):
86107
"""
87108
Performs Johnstone’s Spiked Covariance Test to identify if the embedding is random.
109+
110+
Parameters
111+
----------
112+
adata : sc.AnnData | np.ndarray
113+
AnnData object or numpy array containing the data.
114+
key : str | None
115+
Key to use for AnnData input.
116+
key_added : str
117+
Key to use for adding the results to the AnnData object.
118+
flavor : Literal["asymptotic", "synthetic"]
119+
Flavor of the test to use.
120+
n_simulations : int
121+
Number of simulations to use for the synthetic approach.
122+
progress_bar : bool
123+
Whether to show a progress bar.
124+
null_distribution : np.ndarray | None
125+
Null distribution to use for the synthetic approach.
126+
127+
Returns
128+
-------
129+
dict
130+
Dictionary containing the test statistic and p-value.
88131
"""
89132
start = logg.info(f"computing eigenvalues test via {flavor} approach")
90133

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = scLiTr
3-
version = 2.0.0
3+
version = 2.0.1
44
author = Sergey Isaev
55
author_email = sergey.isaev@meduniwien.ac.at
66
description = Package for an analysis of lineage-tracing scRNA-Seq data

0 commit comments

Comments
 (0)