SingleCellExperiment 0.4.7__tar.gz → 0.5.0__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.
- singlecellexperiment-0.5.0/.github/workflows/pypi-publish.yml +52 -0
- singlecellexperiment-0.5.0/.github/workflows/pypi-test.yml +33 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/.pre-commit-config.yaml +14 -13
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/CHANGELOG.md +5 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/PKG-INFO +2 -2
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/docs/changelog.md +5 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/pyproject.toml +4 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/setup.cfg +1 -1
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/SingleCellExperiment.egg-info/PKG-INFO +2 -2
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/SingleCellExperiment.py +33 -83
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/io/tenx.py +2 -6
- singlecellexperiment-0.4.7/.github/workflows/pypi-publish.yml +0 -51
- singlecellexperiment-0.4.7/.github/workflows/pypi-test.yml +0 -40
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/.coveragerc +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/.gitignore +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/.readthedocs.yml +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/AUTHORS.md +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/CONTRIBUTING.md +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/LICENSE.txt +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/README.md +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/docs/Makefile +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/docs/_static/.gitignore +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/docs/authors.md +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/docs/conf.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/docs/contributing.md +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/docs/index.md +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/docs/license.md +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/docs/readme.md +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/docs/requirements.txt +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/docs/tutorial.md +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/setup.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/SingleCellExperiment.egg-info/SOURCES.txt +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/SingleCellExperiment.egg-info/dependency_links.txt +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/SingleCellExperiment.egg-info/not-zip-safe +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/SingleCellExperiment.egg-info/requires.txt +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/SingleCellExperiment.egg-info/top_level.txt +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/__init__.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/_combineutils.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/_ioutils.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/io/__init__.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/io/h5ad.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/tests/conftest.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/tests/data/adata.h5ad +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/tests/data/mocks.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/tests/data/tenx.sub.h5 +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/tests/test_sce.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/tests/test_sce_combine_cols.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/tests/test_sce_combine_rows.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/tests/test_sce_io.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/tests/test_sce_methods.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/tests/test_sce_slice.py +0 -0
- {singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/tox.ini +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: Publish to PyPI
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
tags: "*"
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Set up Python 3.11
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: 3.11
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: |
|
|
24
|
+
python -m pip install --upgrade pip
|
|
25
|
+
pip install tox
|
|
26
|
+
|
|
27
|
+
- name: Test with tox
|
|
28
|
+
run: |
|
|
29
|
+
tox
|
|
30
|
+
|
|
31
|
+
- name: Build docs
|
|
32
|
+
run: |
|
|
33
|
+
tox -e docs
|
|
34
|
+
|
|
35
|
+
- run: touch ./docs/_build/html/.nojekyll
|
|
36
|
+
|
|
37
|
+
- name: GH Pages Deployment
|
|
38
|
+
uses: JamesIves/github-pages-deploy-action@v4
|
|
39
|
+
with:
|
|
40
|
+
branch: gh-pages # The branch the action should deploy to.
|
|
41
|
+
folder: ./docs/_build/html
|
|
42
|
+
clean: true # Automatically remove deleted files from the deploy branch
|
|
43
|
+
|
|
44
|
+
- name: Build Project and Publish
|
|
45
|
+
run: |
|
|
46
|
+
python -m tox -e clean,build
|
|
47
|
+
|
|
48
|
+
- name: Publish package
|
|
49
|
+
uses: pypa/gh-action-pypi-publish@v1.12.2
|
|
50
|
+
with:
|
|
51
|
+
user: __token__
|
|
52
|
+
password: ${{ secrets.PYPI_PASSWORD }}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Run tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
15
|
+
|
|
16
|
+
name: Python ${{ matrix.python-version }}
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Setup Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
cache: "pip"
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: |
|
|
28
|
+
python -m pip install --upgrade pip
|
|
29
|
+
pip install tox
|
|
30
|
+
|
|
31
|
+
- name: Test with tox
|
|
32
|
+
run: |
|
|
33
|
+
tox
|
|
@@ -17,26 +17,27 @@ repos:
|
|
|
17
17
|
- id: mixed-line-ending
|
|
18
18
|
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows
|
|
19
19
|
|
|
20
|
-
- repo: https://github.com/PyCQA/docformatter
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
# - repo: https://github.com/PyCQA/docformatter
|
|
21
|
+
# rev: master
|
|
22
|
+
# hooks:
|
|
23
|
+
# - id: docformatter
|
|
24
|
+
# additional_dependencies: [tomli]
|
|
25
|
+
# args: [--in-place, --wrap-descriptions=120, --wrap-summaries=120]
|
|
26
|
+
# # --config, ./pyproject.toml
|
|
27
27
|
|
|
28
|
-
- repo: https://github.com/psf/black
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
# - repo: https://github.com/psf/black
|
|
29
|
+
# rev: 24.8.0
|
|
30
|
+
# hooks:
|
|
31
|
+
# - id: black
|
|
32
|
+
# language_version: python3
|
|
33
33
|
|
|
34
34
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
35
35
|
# Ruff version.
|
|
36
|
-
rev: v0.
|
|
36
|
+
rev: v0.6.8
|
|
37
37
|
hooks:
|
|
38
38
|
- id: ruff
|
|
39
39
|
args: [--fix, --exit-non-zero-on-fix]
|
|
40
|
+
- id: ruff-format
|
|
40
41
|
|
|
41
42
|
## If like to embrace black styles even in the docs:
|
|
42
43
|
# - repo: https://github.com/asottile/blacken-docs
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Version 0.5.0
|
|
4
|
+
|
|
5
|
+
- chore: Remove Python 3.8 (EOL)
|
|
6
|
+
- precommit: Replace docformatter with ruff's formatter
|
|
7
|
+
|
|
3
8
|
## Version 0.4.7
|
|
4
9
|
|
|
5
10
|
- Fix package version issues to support Python<=3.9. Mostly related to how anndata dependencies are versioned in the MuData package discussed [here](https://github.com/scverse/mudata/issues/82).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: SingleCellExperiment
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Container class for single-cell experiments
|
|
5
5
|
Home-page: https://github.com/BiocPy/SingleCellExperiment
|
|
6
6
|
Author: jkanche
|
|
@@ -10,7 +10,7 @@ Project-URL: Documentation, https://github.com/BiocPy/SingleCellExperiment
|
|
|
10
10
|
Platform: any
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Programming Language :: Python
|
|
13
|
-
Requires-Python: >=3.
|
|
13
|
+
Requires-Python: >=3.9
|
|
14
14
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
15
15
|
License-File: LICENSE.txt
|
|
16
16
|
Requires-Dist: importlib-metadata; python_version < "3.8"
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Version 0.5.0
|
|
4
|
+
|
|
5
|
+
- chore: Remove Python 3.8 (EOL)
|
|
6
|
+
- precommit: Replace docformatter with ruff's formatter
|
|
7
|
+
|
|
3
8
|
## Version 0.4.7
|
|
4
9
|
|
|
5
10
|
- Fix package version issues to support Python<=3.9. Mostly related to how anndata dependencies are versioned in the MuData package discussed [here](https://github.com/scverse/mudata/issues/82).
|
{singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/SingleCellExperiment.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: SingleCellExperiment
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Container class for single-cell experiments
|
|
5
5
|
Home-page: https://github.com/BiocPy/SingleCellExperiment
|
|
6
6
|
Author: jkanche
|
|
@@ -10,7 +10,7 @@ Project-URL: Documentation, https://github.com/BiocPy/SingleCellExperiment
|
|
|
10
10
|
Platform: any
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
12
|
Classifier: Programming Language :: Python
|
|
13
|
-
Requires-Python: >=3.
|
|
13
|
+
Requires-Python: >=3.9
|
|
14
14
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
15
15
|
License-File: LICENSE.txt
|
|
16
16
|
Requires-Dist: importlib-metadata; python_version < "3.8"
|
|
@@ -30,9 +30,7 @@ __license__ = "MIT"
|
|
|
30
30
|
|
|
31
31
|
def _validate_reduced_dims(reduced_dims, shape):
|
|
32
32
|
if reduced_dims is None:
|
|
33
|
-
raise ValueError(
|
|
34
|
-
"'reduced_dims' cannot be `None`, must be assigned to an empty dictionary."
|
|
35
|
-
)
|
|
33
|
+
raise ValueError("'reduced_dims' cannot be `None`, must be assigned to an empty dictionary.")
|
|
36
34
|
|
|
37
35
|
if not isinstance(reduced_dims, dict):
|
|
38
36
|
raise TypeError("'reduced_dims' is not a dictionary.")
|
|
@@ -40,21 +38,16 @@ def _validate_reduced_dims(reduced_dims, shape):
|
|
|
40
38
|
for rdname, mat in reduced_dims.items():
|
|
41
39
|
if not hasattr(mat, "shape"):
|
|
42
40
|
raise TypeError(
|
|
43
|
-
f"Reduced dimension: '{rdname}' must be a matrix-like object."
|
|
44
|
-
"Does not contain a `shape` property."
|
|
41
|
+
f"Reduced dimension: '{rdname}' must be a matrix-like object." "Does not contain a `shape` property."
|
|
45
42
|
)
|
|
46
43
|
|
|
47
44
|
if shape[1] != mat.shape[0]:
|
|
48
|
-
raise ValueError(
|
|
49
|
-
f"Reduced dimension: '{rdname}' does not contain embeddings for all cells."
|
|
50
|
-
)
|
|
45
|
+
raise ValueError(f"Reduced dimension: '{rdname}' does not contain embeddings for all cells.")
|
|
51
46
|
|
|
52
47
|
|
|
53
48
|
def _validate_alternative_experiments(alternative_experiments, shape):
|
|
54
49
|
if alternative_experiments is None:
|
|
55
|
-
raise ValueError(
|
|
56
|
-
"'alternative_experiments' cannot be `None`, must be assigned to an empty dictionary."
|
|
57
|
-
)
|
|
50
|
+
raise ValueError("'alternative_experiments' cannot be `None`, must be assigned to an empty dictionary.")
|
|
58
51
|
|
|
59
52
|
if not isinstance(alternative_experiments, dict):
|
|
60
53
|
raise TypeError("'alternative_experiments' is not a dictionary.")
|
|
@@ -67,10 +60,7 @@ def _validate_alternative_experiments(alternative_experiments, shape):
|
|
|
67
60
|
)
|
|
68
61
|
|
|
69
62
|
if shape[1] != alternative_experiment.shape[1]:
|
|
70
|
-
raise ValueError(
|
|
71
|
-
f"Alternative experiment: '{alt_name}' does not contain same number of"
|
|
72
|
-
" cells."
|
|
73
|
-
)
|
|
63
|
+
raise ValueError(f"Alternative experiment: '{alt_name}' does not contain same number of" " cells.")
|
|
74
64
|
|
|
75
65
|
|
|
76
66
|
def _validate_pairs(pairs):
|
|
@@ -204,18 +194,14 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
204
194
|
|
|
205
195
|
self._reduced_dims = reduced_dims if reduced_dims is not None else {}
|
|
206
196
|
|
|
207
|
-
self._alternative_experiments =
|
|
208
|
-
alternative_experiments if alternative_experiments is not None else {}
|
|
209
|
-
)
|
|
197
|
+
self._alternative_experiments = alternative_experiments if alternative_experiments is not None else {}
|
|
210
198
|
|
|
211
199
|
self._row_pairs = row_pairs if row_pairs is not None else {}
|
|
212
200
|
self._column_pairs = column_pairs if column_pairs is not None else {}
|
|
213
201
|
|
|
214
202
|
if validate:
|
|
215
203
|
_validate_reduced_dims(self._reduced_dims, self._shape)
|
|
216
|
-
_validate_alternative_experiments(
|
|
217
|
-
self._alternative_experiments, self._shape
|
|
218
|
-
)
|
|
204
|
+
_validate_alternative_experiments(self._alternative_experiments, self._shape)
|
|
219
205
|
_validate_pairs(self._row_pairs)
|
|
220
206
|
_validate_pairs(self._column_pairs)
|
|
221
207
|
|
|
@@ -309,14 +295,10 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
309
295
|
output += ", row_ranges=" + self._row_ranges.__repr__()
|
|
310
296
|
|
|
311
297
|
if self._alternative_experiments is not None:
|
|
312
|
-
output += ", alternative_experiments=" + ut.print_truncated_list(
|
|
313
|
-
self.alternative_experiment_names
|
|
314
|
-
)
|
|
298
|
+
output += ", alternative_experiments=" + ut.print_truncated_list(self.alternative_experiment_names)
|
|
315
299
|
|
|
316
300
|
if self._reduced_dims is not None:
|
|
317
|
-
output += ", reduced_dims=" + ut.print_truncated_list(
|
|
318
|
-
self.reduced_dim_names
|
|
319
|
-
)
|
|
301
|
+
output += ", reduced_dims=" + ut.print_truncated_list(self.reduced_dim_names)
|
|
320
302
|
|
|
321
303
|
if self._main_experiment_name is not None:
|
|
322
304
|
output += ", main_experiment_name=" + self._main_experiment_name
|
|
@@ -344,10 +326,14 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
344
326
|
|
|
345
327
|
output += f"assays({len(self.assay_names)}): {ut.print_truncated_list(self.assay_names)}\n"
|
|
346
328
|
|
|
347
|
-
output +=
|
|
329
|
+
output += (
|
|
330
|
+
f"row_data columns({len(self._rows.column_names)}): {ut.print_truncated_list(self._rows.column_names)}\n"
|
|
331
|
+
)
|
|
348
332
|
output += f"row_names({0 if self._row_names is None else len(self._row_names)}): {' ' if self._row_names is None else ut.print_truncated_list(self._row_names)}\n"
|
|
349
333
|
|
|
350
|
-
output +=
|
|
334
|
+
output += (
|
|
335
|
+
f"column_data columns({len(self._cols.column_names)}): {ut.print_truncated_list(self._cols.column_names)}\n"
|
|
336
|
+
)
|
|
351
337
|
output += f"column_names({0 if self._column_names is None else len(self._column_names)}): {' ' if self._column_names is None else ut.print_truncated_list(self._column_names)}\n"
|
|
352
338
|
|
|
353
339
|
output += f"main_experiment_name: {' ' if self._main_experiment_name is None else self._main_experiment_name}\n"
|
|
@@ -373,9 +359,7 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
373
359
|
"""
|
|
374
360
|
return self._reduced_dims
|
|
375
361
|
|
|
376
|
-
def set_reduced_dims(
|
|
377
|
-
self, reduced_dims: Dict[str, Any], in_place: bool = False
|
|
378
|
-
) -> "SingleCellExperiment":
|
|
362
|
+
def set_reduced_dims(self, reduced_dims: Dict[str, Any], in_place: bool = False) -> "SingleCellExperiment":
|
|
379
363
|
"""Set new reduced dimensions.
|
|
380
364
|
|
|
381
365
|
Args:
|
|
@@ -421,9 +405,7 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
421
405
|
"""
|
|
422
406
|
return list(self._reduced_dims.keys())
|
|
423
407
|
|
|
424
|
-
def set_reduced_dim_names(
|
|
425
|
-
self, names: List[str], in_place: bool = False
|
|
426
|
-
) -> "SingleCellExperiment":
|
|
408
|
+
def set_reduced_dim_names(self, names: List[str], in_place: bool = False) -> "SingleCellExperiment":
|
|
427
409
|
"""Replace :py:attr:`~.reduced_dims`'s names.
|
|
428
410
|
|
|
429
411
|
Args:
|
|
@@ -439,9 +421,7 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
439
421
|
"""
|
|
440
422
|
current_names = self.get_reduced_dim_names()
|
|
441
423
|
if len(names) != len(current_names):
|
|
442
|
-
raise ValueError(
|
|
443
|
-
"Length of 'names' does not match the number of `reduced_dims`."
|
|
444
|
-
)
|
|
424
|
+
raise ValueError("Length of 'names' does not match the number of `reduced_dims`.")
|
|
445
425
|
|
|
446
426
|
new_reduced_dims = OrderedDict()
|
|
447
427
|
for idx in range(len(names)):
|
|
@@ -499,9 +479,7 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
499
479
|
|
|
500
480
|
return self._reduced_dims[dimension]
|
|
501
481
|
|
|
502
|
-
raise TypeError(
|
|
503
|
-
f"'dimension' must be a string or integer, provided '{type(dimension)}'."
|
|
504
|
-
)
|
|
482
|
+
raise TypeError(f"'dimension' must be a string or integer, provided '{type(dimension)}'.")
|
|
505
483
|
|
|
506
484
|
################################
|
|
507
485
|
######>> main_expt_name <<######
|
|
@@ -515,9 +493,7 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
515
493
|
"""
|
|
516
494
|
return self._main_experiment_name
|
|
517
495
|
|
|
518
|
-
def set_main_experiment_name(
|
|
519
|
-
self, name: Optional[str], in_place: bool = False
|
|
520
|
-
) -> "SingleCellExperiment":
|
|
496
|
+
def set_main_experiment_name(self, name: Optional[str], in_place: bool = False) -> "SingleCellExperiment":
|
|
521
497
|
"""Set new experiment data (assays).
|
|
522
498
|
|
|
523
499
|
Args:
|
|
@@ -609,9 +585,7 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
609
585
|
"""
|
|
610
586
|
return list(self._alternative_experiments.keys())
|
|
611
587
|
|
|
612
|
-
def set_alternative_experiment_names(
|
|
613
|
-
self, names: List[str], in_place: bool = False
|
|
614
|
-
) -> "SingleCellExperiment":
|
|
588
|
+
def set_alternative_experiment_names(self, names: List[str], in_place: bool = False) -> "SingleCellExperiment":
|
|
615
589
|
"""Replace :py:attr:`~.alternative_experiment`'s names.
|
|
616
590
|
|
|
617
591
|
Args:
|
|
@@ -627,15 +601,11 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
627
601
|
"""
|
|
628
602
|
current_names = self.get_alternative_experiment_names()
|
|
629
603
|
if len(names) != len(current_names):
|
|
630
|
-
raise ValueError(
|
|
631
|
-
"Length of 'names' does not match the number of `alternative_experiments`."
|
|
632
|
-
)
|
|
604
|
+
raise ValueError("Length of 'names' does not match the number of `alternative_experiments`.")
|
|
633
605
|
|
|
634
606
|
new_alt_expts = OrderedDict()
|
|
635
607
|
for idx in range(len(names)):
|
|
636
|
-
new_alt_expts[names[idx]] = self._alternative_experiments.pop(
|
|
637
|
-
current_names[idx]
|
|
638
|
-
)
|
|
608
|
+
new_alt_expts[names[idx]] = self._alternative_experiments.pop(current_names[idx])
|
|
639
609
|
|
|
640
610
|
output = self._define_output(in_place)
|
|
641
611
|
output._alternative_experiments = new_alt_expts
|
|
@@ -680,13 +650,9 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
680
650
|
raise IndexError("Index cannot be negative.")
|
|
681
651
|
|
|
682
652
|
if name > len(self.alternative_experiment_names):
|
|
683
|
-
raise IndexError(
|
|
684
|
-
"Index greater than the number of alternative experiments."
|
|
685
|
-
)
|
|
653
|
+
raise IndexError("Index greater than the number of alternative experiments.")
|
|
686
654
|
|
|
687
|
-
return self._alternative_experiments[
|
|
688
|
-
self.alternative_experiment_names[name]
|
|
689
|
-
]
|
|
655
|
+
return self._alternative_experiments[self.alternative_experiment_names[name]]
|
|
690
656
|
elif isinstance(name, str):
|
|
691
657
|
if name not in self._alternative_experiments:
|
|
692
658
|
raise AttributeError(f"Alternative experiment: {name} does not exist.")
|
|
@@ -707,9 +673,7 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
707
673
|
"""
|
|
708
674
|
return self._row_pairs
|
|
709
675
|
|
|
710
|
-
def set_row_pairs(
|
|
711
|
-
self, pairs: Dict[str, Any], in_place: bool = False
|
|
712
|
-
) -> "SingleCellExperiment":
|
|
676
|
+
def set_row_pairs(self, pairs: Dict[str, Any], in_place: bool = False) -> "SingleCellExperiment":
|
|
713
677
|
"""Replace :py:attr:`~.row_pairs`'s names.
|
|
714
678
|
|
|
715
679
|
Args:
|
|
@@ -755,9 +719,7 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
755
719
|
"""
|
|
756
720
|
return list(self._row_pairs.keys())
|
|
757
721
|
|
|
758
|
-
def set_row_pair_names(
|
|
759
|
-
self, names: List[str], in_place: bool = False
|
|
760
|
-
) -> "SingleCellExperiment":
|
|
722
|
+
def set_row_pair_names(self, names: List[str], in_place: bool = False) -> "SingleCellExperiment":
|
|
761
723
|
"""Replace :py:attr:`~.row_pair`'s names.
|
|
762
724
|
|
|
763
725
|
Args:
|
|
@@ -773,9 +735,7 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
773
735
|
"""
|
|
774
736
|
current_names = self.get_row_pair_names()
|
|
775
737
|
if len(names) != len(current_names):
|
|
776
|
-
raise ValueError(
|
|
777
|
-
"Length of 'names' does not match the number of `row_pairs`."
|
|
778
|
-
)
|
|
738
|
+
raise ValueError("Length of 'names' does not match the number of `row_pairs`.")
|
|
779
739
|
|
|
780
740
|
new_row_pairs = OrderedDict()
|
|
781
741
|
for idx in range(len(names)):
|
|
@@ -811,9 +771,7 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
811
771
|
"""
|
|
812
772
|
return self._column_pairs
|
|
813
773
|
|
|
814
|
-
def set_column_pairs(
|
|
815
|
-
self, pairs: Dict[str, Any], in_place: bool = False
|
|
816
|
-
) -> "SingleCellExperiment":
|
|
774
|
+
def set_column_pairs(self, pairs: Dict[str, Any], in_place: bool = False) -> "SingleCellExperiment":
|
|
817
775
|
"""Replace :py:attr:`~.column_pairs`'s names.
|
|
818
776
|
|
|
819
777
|
Args:
|
|
@@ -859,9 +817,7 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
859
817
|
"""
|
|
860
818
|
return list(self._column_pairs.keys())
|
|
861
819
|
|
|
862
|
-
def set_column_pair_names(
|
|
863
|
-
self, names: List[str], in_place: bool = False
|
|
864
|
-
) -> "SingleCellExperiment":
|
|
820
|
+
def set_column_pair_names(self, names: List[str], in_place: bool = False) -> "SingleCellExperiment":
|
|
865
821
|
"""Replace :py:attr:`~.column_pair`'s names.
|
|
866
822
|
|
|
867
823
|
Args:
|
|
@@ -877,9 +833,7 @@ class SingleCellExperiment(RangedSummarizedExperiment):
|
|
|
877
833
|
"""
|
|
878
834
|
current_names = self.get_column_pair_names()
|
|
879
835
|
if len(names) != len(current_names):
|
|
880
|
-
raise ValueError(
|
|
881
|
-
"Length of 'names' does not match the number of `column_pairs`."
|
|
882
|
-
)
|
|
836
|
+
raise ValueError("Length of 'names' does not match the number of `column_pairs`.")
|
|
883
837
|
|
|
884
838
|
new_column_pairs = OrderedDict()
|
|
885
839
|
for idx in range(len(names)):
|
|
@@ -1252,9 +1206,7 @@ def relaxed_combine_columns(
|
|
|
1252
1206
|
|
|
1253
1207
|
_new_rdim = None
|
|
1254
1208
|
try:
|
|
1255
|
-
_new_rdim = relaxed_merge_numpy_generic(
|
|
1256
|
-
x, by="row", attr="reduced_dims", names_attr="reduced_dim_names"
|
|
1257
|
-
)
|
|
1209
|
+
_new_rdim = relaxed_merge_numpy_generic(x, by="row", attr="reduced_dims", names_attr="reduced_dim_names")
|
|
1258
1210
|
except Exception as e:
|
|
1259
1211
|
warn(
|
|
1260
1212
|
f"Cannot combine 'reduced_dimensions' across experiments, {str(e)}",
|
|
@@ -1263,9 +1215,7 @@ def relaxed_combine_columns(
|
|
|
1263
1215
|
|
|
1264
1216
|
_new_alt_expt = None
|
|
1265
1217
|
try:
|
|
1266
|
-
_new_alt_expt = relaxed_merge_generic(
|
|
1267
|
-
x, by="column", attr="alternative_experiments"
|
|
1268
|
-
)
|
|
1218
|
+
_new_alt_expt = relaxed_merge_generic(x, by="column", attr="alternative_experiments")
|
|
1269
1219
|
except Exception as e:
|
|
1270
1220
|
warn(
|
|
1271
1221
|
f"Cannot combine 'alternative_experiments' across experiments, {str(e)}",
|
{singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/io/tenx.py
RENAMED
|
@@ -75,9 +75,7 @@ def read_tenx_h5(path: str, realize_assays: bool = False) -> SingleCellExperimen
|
|
|
75
75
|
# read the matrix
|
|
76
76
|
shape = tuple(h5["matrix"]["shape"][:])
|
|
77
77
|
|
|
78
|
-
counts = Hdf5CompressedSparseMatrix(
|
|
79
|
-
path=path, group_name="matrix", by_column=True, shape=shape
|
|
80
|
-
)
|
|
78
|
+
counts = Hdf5CompressedSparseMatrix(path=path, group_name="matrix", by_column=True, shape=shape)
|
|
81
79
|
|
|
82
80
|
if realize_assays is True:
|
|
83
81
|
counts = da.to_scipy_sparse_matrix(counts, "csr")
|
|
@@ -111,6 +109,4 @@ def read_tenx_h5(path: str, realize_assays: bool = False) -> SingleCellExperimen
|
|
|
111
109
|
|
|
112
110
|
h5.close()
|
|
113
111
|
|
|
114
|
-
return SingleCellExperiment(
|
|
115
|
-
assays={"counts": counts}, row_data=features, column_data=barcodes
|
|
116
|
-
)
|
|
112
|
+
return SingleCellExperiment(assays={"counts": counts}, row_data=features, column_data=barcodes)
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
|
2
|
-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
3
|
-
|
|
4
|
-
name: Publish to PyPI
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
tags: "*"
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build:
|
|
12
|
-
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
|
|
15
|
-
steps:
|
|
16
|
-
- uses: actions/checkout@v2
|
|
17
|
-
- name: Set up Python 3.9
|
|
18
|
-
uses: actions/setup-python@v2
|
|
19
|
-
with:
|
|
20
|
-
python-version: 3.9
|
|
21
|
-
- name: Install dependencies
|
|
22
|
-
run: |
|
|
23
|
-
python -m pip install --upgrade pip
|
|
24
|
-
pip install flake8 pytest tox
|
|
25
|
-
# - name: Lint with flake8
|
|
26
|
-
# run: |
|
|
27
|
-
# # stop the build if there are Python syntax errors or undefined names
|
|
28
|
-
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
29
|
-
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
30
|
-
# # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
31
|
-
- name: Test with tox
|
|
32
|
-
run: |
|
|
33
|
-
tox
|
|
34
|
-
- name: Build docs
|
|
35
|
-
run: |
|
|
36
|
-
tox -e docs
|
|
37
|
-
- run: touch ./docs/_build/html/.nojekyll
|
|
38
|
-
- name: GH Pages Deployment
|
|
39
|
-
uses: JamesIves/github-pages-deploy-action@4.1.3
|
|
40
|
-
with:
|
|
41
|
-
branch: gh-pages # The branch the action should deploy to.
|
|
42
|
-
folder: ./docs/_build/html
|
|
43
|
-
clean: true # Automatically remove deleted files from the deploy branch
|
|
44
|
-
- name: Build Project and Publish
|
|
45
|
-
run: |
|
|
46
|
-
python -m tox -e clean,build
|
|
47
|
-
- name: Publish package
|
|
48
|
-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
|
|
49
|
-
with:
|
|
50
|
-
user: __token__
|
|
51
|
-
password: ${{ secrets.PYPI_PASSWORD }}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
|
2
|
-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
3
|
-
|
|
4
|
-
name: Test the library
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches: [ master ]
|
|
9
|
-
pull_request:
|
|
10
|
-
branches: [ master ]
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
build:
|
|
14
|
-
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
strategy:
|
|
17
|
-
matrix:
|
|
18
|
-
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
|
|
19
|
-
|
|
20
|
-
name: Python ${{ matrix.python-version }}
|
|
21
|
-
steps:
|
|
22
|
-
- uses: actions/checkout@v2
|
|
23
|
-
- name: Setup Python
|
|
24
|
-
uses: actions/setup-python@v2
|
|
25
|
-
with:
|
|
26
|
-
python-version: ${{ matrix.python-version }}
|
|
27
|
-
cache: 'pip'
|
|
28
|
-
- name: Install dependencies
|
|
29
|
-
run: |
|
|
30
|
-
python -m pip install --upgrade pip
|
|
31
|
-
pip install flake8 pytest tox
|
|
32
|
-
# - name: Lint with flake8
|
|
33
|
-
# run: |
|
|
34
|
-
# # stop the build if there are Python syntax errors or undefined names
|
|
35
|
-
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
36
|
-
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
37
|
-
# # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
38
|
-
- name: Test with tox
|
|
39
|
-
run: |
|
|
40
|
-
tox
|
|
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
|
{singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/__init__.py
RENAMED
|
File without changes
|
{singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/_combineutils.py
RENAMED
|
File without changes
|
{singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/_ioutils.py
RENAMED
|
File without changes
|
{singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/io/__init__.py
RENAMED
|
File without changes
|
{singlecellexperiment-0.4.7 → singlecellexperiment-0.5.0}/src/singlecellexperiment/io/h5ad.py
RENAMED
|
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
|