Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more readable PCA computation and info retrieval #377

Merged
merged 4 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
- id: autopep8
args: [-i]
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/asottile/yesqa
Expand Down
1 change: 1 addition & 0 deletions scib/_package_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def wrapper(*args, **kwargs):
f"Mixed case function naming is deprecated for '{name}'. "
f"Please use '{func.__name__}' instead.",
DeprecationWarning,
stacklevel=2,
)
return func(*args, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion scib/metrics/lisi.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def clisi_graph(

"""
if batch_key is not None:
warnings.warn("'batch_key' is deprecated and will be ignore")
warnings.warn("'batch_key' is deprecated and will be ignore", stacklevel=1)

check_adata(adata)
check_batch(label_key, adata.obs)
Expand Down
5 changes: 1 addition & 4 deletions scib/metrics/pcr.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,14 @@ def pc_regression(

if verbose:
print("compute PCA")
pca = sc.tl.pca(
X_pca, _, _, pca_var = sc.tl.pca(
matrix,
n_comps=n_comps,
use_highly_variable=False,
return_info=True,
svd_solver=svd_solver,
copy=True,
)
X_pca = pca[0].copy()
pca_var = pca[3].copy()
del pca
else:
X_pca = matrix
n_comps = matrix.shape[1]
Expand Down
20 changes: 10 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ author = Malte D. Luecken, Maren Buettner, Daniel C. Strobl, Michaela F. Mueller
author_email = malte.luecken@helmholtz-muenchen.de, michaela.mueller@helmholtz-muenchen.de
license = MIT
url = https://github.com/theislab/scib
project_urls =
project_urls =
Pipeline = https://github.com/theislab/scib-pipeline
Reproducibility = https://theislab.github.io/scib-reproducibility
Bug Tracker = https://github.com/theislab/scib/issues
keywords =
keywords =
benchmarking
single cell
data integration
classifiers =
classifiers =
Development Status :: 3 - Alpha
Intended Audience :: Developers
Intended Audience :: Science/Research
Expand All @@ -40,13 +40,13 @@ classifiers =
build_number = 1

[options]
packages =
packages =
scib
scib.metrics
python_requires = >=3.7
install_requires =
install_requires =
numpy
pandas
pandas<2
seaborn
matplotlib
numba
Expand All @@ -65,7 +65,7 @@ install_requires =
zip_safe = False

[options.package_data]
scib =
scib =
resources/*.txt
knn_graph/*

Expand Down Expand Up @@ -95,7 +95,7 @@ skip_glob = docs/*
line-length = 120
target-version = py38
include = \.pyi?$
exclude =
exclude =
.eggs
.git
.venv
Expand All @@ -104,7 +104,7 @@ exclude =

[flake8]
max-line-length = 88
ignore =
ignore =
W503
W504
E501
Expand All @@ -126,7 +126,7 @@ ignore =
RST304
C408
exclude = .git,__pycache__,build,docs/_build,dist
per-file-ignores =
per-file-ignores =
scib/*: D
tests/*: D
*/__init__.py: F401