bonesistools 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.
- {bonesistools-1.2.3 → bonesistools-1.2.4}/PKG-INFO +3 -3
- {bonesistools-1.2.3 → bonesistools-1.2.4}/README.md +2 -2
- {bonesistools-1.2.3 → bonesistools-1.2.4}/pyproject.toml +1 -1
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/ncbi/__init__.py +2 -1
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/ncbi/_genesyn.py +59 -11
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/plotting/__init__.py +7 -4
- bonesistools-1.2.3/src/bonesistools/sctools/plotting/_boxplot.py → bonesistools-1.2.4/src/bonesistools/sctools/plotting/_distribution.py +16 -2
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/plotting/_graph.py +18 -4
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/plotting/_scatterplot.py +2 -2
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/preprocessing/__init__.py +10 -2
- bonesistools-1.2.4/src/bonesistools/sctools/preprocessing/_duplicates.py +357 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/preprocessing/_genename.py +3 -106
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/preprocessing/_simple.py +1 -76
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/preprocessing/_transfer.py +106 -2
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/tools/__init__.py +14 -2
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/tools/_classification.py +3 -3
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/tools/_graph.py +17 -2
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/tools/_markers.py +16 -1
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/tools/_neighbors.py +83 -20
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/tools/_utils.py +16 -1
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/dbs/test_ncbi.py +7 -7
- bonesistools-1.2.3/tests/sct/plotting/test_boxplot.py → bonesistools-1.2.4/tests/sct/plotting/test_distribution.py +32 -28
- bonesistools-1.2.4/tests/sct/preprocessing/test_genename.py +322 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/preprocessing/test_transfer_obs.py +20 -20
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/tools/test_graph_neighbors_classification.py +13 -13
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/tools/test_knnbs.py +22 -22
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/tools/test_utils_conversion_maths.py +17 -17
- bonesistools-1.2.3/tests/sct/preprocessing/test_genename.py +0 -177
- {bonesistools-1.2.3 → bonesistools-1.2.4}/.gitignore +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/LICENSE +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/__init__.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/_compat.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/__init__.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/boolean_algebra/__init__.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/boolean_algebra/_algebra.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/boolean_algebra/_boolean.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/boolean_algebra/_hypercube.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/boolean_algebra/_parser.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/boolean_algebra/_representation.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/boolean_algebra/_structure.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/boolean_algebra/_typing.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/boolean_network/__init__.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/boolean_network/_network.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/boolean_network/_parser.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/boolean_network/_typing.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/influence_graph/__init__.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/influence_graph/_algorithms.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/influence_graph/_influence_graph.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/influence_graph/_parser.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/influence_graph/_scoring.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/influence_graph/_typing.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/plotting/__init__.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/plotting/_graphviz.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/plotting/_styles.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/boolpy/plotting/_svg.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/__init__.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/__init__.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/_orthologs.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_anole_lizard_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_c.elegans_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_cat_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_cattle_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_chicken_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_chimpanzee_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_dog_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_fruitfly_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_horse_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_macaque_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_mouse_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_opossum_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_pig_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_platypus_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_rat_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_s.cerevisiae_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_s.pombe_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_xenopus_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/hcop/data/human_zebrafish_hcop.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/ncbi/_typing.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/ncbi/data/gi/escherichia_coli_gene_info.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/ncbi/data/gi/homo_sapiens_gene_info.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/ncbi/data/gi/mus_musculus_gene_info.tsv.gz +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/omnipath/__init__.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/omnipath/_archive.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/omnipath/_collectri.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/databases/omnipath/_dorothea.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/grntools/__init__.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/py.typed +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/__init__.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/_dependencies.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/_typing.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/datasets/__init__.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/datasets/nestorowa_hvg.h5ad +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/plotting/_barplot.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/plotting/_colors.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/plotting/_density.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/plotting/_figure.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/plotting/_typing.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/plotting/_utils.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/tools/_conversion.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/tools/_maths.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/tools/_regress.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/tools/_write.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/bpy/conftest.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/bpy/test_aggregated_influence_graph.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/bpy/test_boolean_algebra.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/bpy/test_boolean_network.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/bpy/test_boolean_network_ensemble.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/bpy/test_hypercube.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/bpy/test_hypercube_collection.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/bpy/test_influence_graph.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/bpy/test_influence_graph_parser.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/bpy/test_influence_graph_scoring.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/bpy/test_partial_boolean.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/bpy/test_plotting_styles.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/dbs/test_hcop.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/dbs/test_hcop_orthologs.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/dbs/test_omnipath.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/dbs/test_omnipath_reproducibility.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/conftest.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/plotting/test_barplot.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/plotting/test_colors.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/plotting/test_density.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/plotting/test_figure.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/plotting/test_graph.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/plotting/test_scatterplot.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/preprocessing/test_simple.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/test_typing.py +0 -0
- {bonesistools-1.2.3 → bonesistools-1.2.4}/tests/sct/tools/test_write.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bonesistools
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: Bioinformatics toolkit for upstream and downstream analyses around the BoNesis framework
|
|
5
5
|
Project-URL: Repository, https://github.com/bnediction/bonesistools
|
|
6
6
|
Author: Théo Roncalli
|
|
@@ -627,7 +627,7 @@ Submodules:
|
|
|
627
627
|
|
|
628
628
|
- plotting: `bt.sct.pl`
|
|
629
629
|
- embedding, density, composition and graph visualizations
|
|
630
|
-
-
|
|
630
|
+
- distribution utilities
|
|
631
631
|
|
|
632
632
|
- datasets: `bt.sct.datasets`
|
|
633
633
|
- packaged reference datasets
|
|
@@ -694,7 +694,7 @@ Submodules:
|
|
|
694
694
|
Example:
|
|
695
695
|
|
|
696
696
|
```python
|
|
697
|
-
genesyn = bt.dbs.ncbi.
|
|
697
|
+
genesyn = bt.dbs.ncbi.genesyn()
|
|
698
698
|
|
|
699
699
|
grn = bt.dbs.omnipath.collectri(
|
|
700
700
|
organism="mouse",
|
|
@@ -49,7 +49,7 @@ Submodules:
|
|
|
49
49
|
|
|
50
50
|
- plotting: `bt.sct.pl`
|
|
51
51
|
- embedding, density, composition and graph visualizations
|
|
52
|
-
-
|
|
52
|
+
- distribution utilities
|
|
53
53
|
|
|
54
54
|
- datasets: `bt.sct.datasets`
|
|
55
55
|
- packaged reference datasets
|
|
@@ -116,7 +116,7 @@ Submodules:
|
|
|
116
116
|
Example:
|
|
117
117
|
|
|
118
118
|
```python
|
|
119
|
-
genesyn = bt.dbs.ncbi.
|
|
119
|
+
genesyn = bt.dbs.ncbi.genesyn()
|
|
120
120
|
|
|
121
121
|
grn = bt.dbs.omnipath.collectri(
|
|
122
122
|
organism="mouse",
|
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "bonesistools"
|
|
7
7
|
description = "Bioinformatics toolkit for upstream and downstream analyses around the BoNesis framework"
|
|
8
|
-
version = "1.2.
|
|
8
|
+
version = "1.2.4"
|
|
9
9
|
license = {file = "LICENSE"}
|
|
10
10
|
credits = ["BNeDiction", "PEPR Santé Numérique 2030"]
|
|
11
11
|
authors = [
|
|
@@ -45,6 +45,7 @@ from ._typing import (
|
|
|
45
45
|
|
|
46
46
|
InteractionList = Sequence[Tuple[str, str, Dict[str, int]]]
|
|
47
47
|
GeneInfoVersion = Union[Literal["bundled", "latest"], str, Path]
|
|
48
|
+
_SUPPRESS_GENE_SYNONYMS_CONSTRUCTOR_WARNING = False
|
|
48
49
|
|
|
49
50
|
ORGANISMS = Literal[
|
|
50
51
|
"all archaea bacteria",
|
|
@@ -306,14 +307,14 @@ class GeneSynonyms:
|
|
|
306
307
|
--------
|
|
307
308
|
Convert a list of gene identifiers through the callable interface:
|
|
308
309
|
|
|
309
|
-
>>>
|
|
310
|
-
>>>
|
|
310
|
+
>>> gene_synonyms = genesyn(organism="mouse")
|
|
311
|
+
>>> gene_synonyms(["Trp53", "Myc"])
|
|
311
312
|
['Trp53', 'Myc']
|
|
312
313
|
|
|
313
314
|
Convert an interaction list while preserving edge attributes:
|
|
314
315
|
|
|
315
316
|
>>> interactions = [("Trp53", "Myc", {"sign": 1})]
|
|
316
|
-
>>>
|
|
317
|
+
>>> gene_synonyms(interactions)
|
|
317
318
|
[('Trp53', 'Myc', {'sign': 1})]
|
|
318
319
|
|
|
319
320
|
Parameters
|
|
@@ -370,6 +371,15 @@ class GeneSynonyms:
|
|
|
370
371
|
show_warnings: bool = False,
|
|
371
372
|
) -> None:
|
|
372
373
|
|
|
374
|
+
if not _SUPPRESS_GENE_SYNONYMS_CONSTRUCTOR_WARNING:
|
|
375
|
+
warnings.warn(
|
|
376
|
+
"`bt.dbs.ncbi.GeneSynonyms()` is deprecated as a constructor "
|
|
377
|
+
"entry point and will be removed in 2.0.0; use "
|
|
378
|
+
"`bt.dbs.ncbi.genesyn()` instead.",
|
|
379
|
+
DeprecationWarning,
|
|
380
|
+
stacklevel=2,
|
|
381
|
+
)
|
|
382
|
+
|
|
373
383
|
organism = organism.lower().replace("-", " ")
|
|
374
384
|
|
|
375
385
|
if organism not in get_args(ORGANISMS):
|
|
@@ -1079,12 +1089,12 @@ class GeneSynonyms:
|
|
|
1079
1089
|
|
|
1080
1090
|
Examples
|
|
1081
1091
|
--------
|
|
1082
|
-
>>>
|
|
1083
|
-
>>>
|
|
1092
|
+
>>> gene_synonyms = genesyn(organism="mouse")
|
|
1093
|
+
>>> gene_synonyms.contains("Trp53")
|
|
1084
1094
|
[True]
|
|
1085
|
-
>>>
|
|
1095
|
+
>>> gene_synonyms.contains("Trp53", "not-a-gene")
|
|
1086
1096
|
[True, False]
|
|
1087
|
-
>>>
|
|
1097
|
+
>>> gene_synonyms.contains("22059", identifier_type="gene_id")
|
|
1088
1098
|
[True]
|
|
1089
1099
|
|
|
1090
1100
|
Parameters
|
|
@@ -1136,10 +1146,10 @@ class GeneSynonyms:
|
|
|
1136
1146
|
|
|
1137
1147
|
Examples
|
|
1138
1148
|
--------
|
|
1139
|
-
>>>
|
|
1140
|
-
>>>
|
|
1149
|
+
>>> gene_synonyms = genesyn(organism="mouse")
|
|
1150
|
+
>>> gene_synonyms.find("Trp53", "not-a-gene", "Myc")
|
|
1141
1151
|
['Trp53', 'Myc']
|
|
1142
|
-
>>>
|
|
1152
|
+
>>> gene_synonyms.find("22059", "bad-id", identifier_type="gene_id")
|
|
1143
1153
|
['22059']
|
|
1144
1154
|
|
|
1145
1155
|
Parameters
|
|
@@ -1522,7 +1532,7 @@ class GeneSynonyms:
|
|
|
1522
1532
|
awk_script = (
|
|
1523
1533
|
'BEGIN {OFS="\\t"; print "gene_id", "official_name", "ncbi_name", '
|
|
1524
1534
|
'"synonyms", "dbXrefs", "gene_type"} '
|
|
1525
|
-
|
|
1535
|
+
"NR>1 {print $2, $11, $3, $5, $6, $10}"
|
|
1526
1536
|
)
|
|
1527
1537
|
if str(outfile).endswith(".gz"):
|
|
1528
1538
|
cmd = (
|
|
@@ -1810,3 +1820,41 @@ class GeneSynonyms:
|
|
|
1810
1820
|
path.unlink()
|
|
1811
1821
|
except FileNotFoundError:
|
|
1812
1822
|
pass
|
|
1823
|
+
|
|
1824
|
+
|
|
1825
|
+
def genesyn(
|
|
1826
|
+
organism: str = "mouse",
|
|
1827
|
+
version: GeneInfoVersion = "bundled",
|
|
1828
|
+
show_warnings: bool = False,
|
|
1829
|
+
) -> GeneSynonyms:
|
|
1830
|
+
"""
|
|
1831
|
+
Create a GeneSynonyms converter.
|
|
1832
|
+
|
|
1833
|
+
Parameters
|
|
1834
|
+
----------
|
|
1835
|
+
organism: str (default: "mouse")
|
|
1836
|
+
Common name of the organism of interest.
|
|
1837
|
+
version: "bundled", "latest", str path or Path (default: "bundled")
|
|
1838
|
+
NCBI gene_info version to load.
|
|
1839
|
+
show_warnings: bool (default: False)
|
|
1840
|
+
If True, warn when a requested gene identifier has no correspondence.
|
|
1841
|
+
|
|
1842
|
+
Returns
|
|
1843
|
+
-------
|
|
1844
|
+
GeneSynonyms
|
|
1845
|
+
Converter for gene identifier resolution, conversion and
|
|
1846
|
+
standardisation.
|
|
1847
|
+
"""
|
|
1848
|
+
|
|
1849
|
+
global _SUPPRESS_GENE_SYNONYMS_CONSTRUCTOR_WARNING
|
|
1850
|
+
|
|
1851
|
+
previous = _SUPPRESS_GENE_SYNONYMS_CONSTRUCTOR_WARNING
|
|
1852
|
+
_SUPPRESS_GENE_SYNONYMS_CONSTRUCTOR_WARNING = True
|
|
1853
|
+
try:
|
|
1854
|
+
return GeneSynonyms(
|
|
1855
|
+
organism=organism,
|
|
1856
|
+
version=version,
|
|
1857
|
+
show_warnings=show_warnings,
|
|
1858
|
+
)
|
|
1859
|
+
finally:
|
|
1860
|
+
_SUPPRESS_GENE_SYNONYMS_CONSTRUCTOR_WARNING = previous
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"""
|
|
4
4
|
Plotting utilities for single-cell annotated data.
|
|
5
5
|
|
|
6
|
-
The `pl` namespace provides embedding, density, composition,
|
|
7
|
-
plotting helpers, along with colour palettes and Matplotlib styling
|
|
6
|
+
The `pl` namespace provides embedding, density, composition, distribution and
|
|
7
|
+
graph plotting helpers, along with colour palettes and Matplotlib styling
|
|
8
|
+
utilities.
|
|
8
9
|
"""
|
|
9
10
|
|
|
10
11
|
from typing import List as _List
|
|
11
12
|
|
|
12
13
|
from ._barplot import composition
|
|
13
|
-
from ._boxplot import boxplot
|
|
14
14
|
from ._colors import (
|
|
15
15
|
COLORS,
|
|
16
16
|
LIGHT_COLORS,
|
|
@@ -23,18 +23,21 @@ from ._colors import (
|
|
|
23
23
|
rgb2hex,
|
|
24
24
|
)
|
|
25
25
|
from ._density import cdf, density, ecdf_plot, kde_plot
|
|
26
|
+
from ._distribution import boxplot, distribution
|
|
26
27
|
from ._figure import set_default_axis, set_default_params
|
|
27
|
-
from ._graph import add_graph, draw_paga, paga, trajectory
|
|
28
|
+
from ._graph import add_graph, draw_paga, graph_overlay, paga, trajectory
|
|
28
29
|
from ._scatterplot import embedding, embedding_plot
|
|
29
30
|
|
|
30
31
|
__all__ = [
|
|
31
32
|
"embedding",
|
|
32
33
|
"embedding_plot",
|
|
34
|
+
"distribution",
|
|
33
35
|
"boxplot",
|
|
34
36
|
"composition",
|
|
35
37
|
"density",
|
|
36
38
|
"cdf",
|
|
37
39
|
"trajectory",
|
|
40
|
+
"graph_overlay",
|
|
38
41
|
"add_graph",
|
|
39
42
|
"paga",
|
|
40
43
|
"draw_paga",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import warnings
|
|
5
6
|
from collections.abc import Mapping as MappingABC
|
|
6
7
|
from pathlib import Path
|
|
7
8
|
from typing import (
|
|
@@ -151,7 +152,7 @@ def __add_points(
|
|
|
151
152
|
|
|
152
153
|
|
|
153
154
|
@anndata_or_mudata_checker
|
|
154
|
-
def
|
|
155
|
+
def distribution(
|
|
155
156
|
scdata: ScData, # type: ignore
|
|
156
157
|
obs: str,
|
|
157
158
|
groupby: Optional[str] = None,
|
|
@@ -179,7 +180,7 @@ def boxplot(
|
|
|
179
180
|
**kwargs: Any,
|
|
180
181
|
) -> Optional[Tuple[Figure, Axes, BoxplotReturn]]:
|
|
181
182
|
"""
|
|
182
|
-
Draw a
|
|
183
|
+
Draw a distribution plot for an observation-level variable.
|
|
183
184
|
|
|
184
185
|
Parameters
|
|
185
186
|
----------
|
|
@@ -498,3 +499,16 @@ def boxplot(
|
|
|
498
499
|
return None
|
|
499
500
|
else:
|
|
500
501
|
return fig, ax, bps
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
def boxplot(*args: Any, **kwargs: Any) -> Optional[Tuple[Figure, Axes, BoxplotReturn]]:
|
|
505
|
+
"""
|
|
506
|
+
Deprecated alias for `distribution`.
|
|
507
|
+
"""
|
|
508
|
+
|
|
509
|
+
warnings.warn(
|
|
510
|
+
"`bt.sct.pl.boxplot` is deprecated; use " "`bt.sct.pl.distribution` instead.",
|
|
511
|
+
DeprecationWarning,
|
|
512
|
+
stacklevel=2,
|
|
513
|
+
)
|
|
514
|
+
return distribution(*args, **kwargs)
|
|
@@ -28,13 +28,13 @@ from matplotlib.lines import Line2D
|
|
|
28
28
|
from mpl_toolkits.mplot3d import art3d
|
|
29
29
|
|
|
30
30
|
from .._typing import ScData, anndata_checker, anndata_or_mudata_checker
|
|
31
|
-
from ..tools import
|
|
31
|
+
from ..tools import extract_paga_graph
|
|
32
32
|
from ._colors import black
|
|
33
33
|
from ._scatterplot import Colors, embedding
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
@anndata_or_mudata_checker
|
|
37
|
-
def
|
|
37
|
+
def graph_overlay(
|
|
38
38
|
scdata: ScData, # type: ignore
|
|
39
39
|
graph_key: str = "epg",
|
|
40
40
|
ax: Optional[Axes] = None,
|
|
@@ -271,7 +271,7 @@ def trajectory(
|
|
|
271
271
|
)
|
|
272
272
|
fig, drawn_ax = cast(Tuple[Figure, Axes], result)
|
|
273
273
|
|
|
274
|
-
|
|
274
|
+
graph_overlay(
|
|
275
275
|
scdata,
|
|
276
276
|
graph_key=graph_key,
|
|
277
277
|
ax=drawn_ax,
|
|
@@ -350,7 +350,7 @@ def paga(
|
|
|
350
350
|
if ax is None:
|
|
351
351
|
ax = plt.gca()
|
|
352
352
|
|
|
353
|
-
paga_graph =
|
|
353
|
+
paga_graph = extract_paga_graph(
|
|
354
354
|
adata=adata, obs=obs, use_rep=use_rep, edges=edges, threshold=threshold
|
|
355
355
|
)
|
|
356
356
|
barycenters = {
|
|
@@ -385,6 +385,20 @@ def paga(
|
|
|
385
385
|
return ax
|
|
386
386
|
|
|
387
387
|
|
|
388
|
+
def add_graph(*args: Any, **kwargs: Any) -> Axes:
|
|
389
|
+
"""
|
|
390
|
+
Deprecated alias for `graph_overlay`.
|
|
391
|
+
"""
|
|
392
|
+
|
|
393
|
+
warnings.warn(
|
|
394
|
+
"`bt.sct.pl.add_graph` is deprecated; use "
|
|
395
|
+
"`bt.sct.pl.graph_overlay` instead.",
|
|
396
|
+
DeprecationWarning,
|
|
397
|
+
stacklevel=2,
|
|
398
|
+
)
|
|
399
|
+
return graph_overlay(*args, **kwargs)
|
|
400
|
+
|
|
401
|
+
|
|
388
402
|
def draw_paga(*args: Any, **kwargs: Any) -> Union[Axes, None]:
|
|
389
403
|
"""
|
|
390
404
|
Deprecated alias for `paga()`.
|
|
@@ -650,11 +650,11 @@ def embedding(
|
|
|
650
650
|
)
|
|
651
651
|
|
|
652
652
|
if draw_deprecated_graph or draw_deprecated_graph_labels:
|
|
653
|
-
from ._graph import
|
|
653
|
+
from ._graph import graph_overlay
|
|
654
654
|
|
|
655
655
|
_kwargs = {"linewidth": 2.5, "zorder": 10}
|
|
656
656
|
_kwargs.update({} if "graph" not in kwargs else kwargs["graph"])
|
|
657
|
-
|
|
657
|
+
graph_overlay(
|
|
658
658
|
scdata,
|
|
659
659
|
ax=ax,
|
|
660
660
|
n_components=component_number,
|
{bonesistools-1.2.3 → bonesistools-1.2.4}/src/bonesistools/sctools/preprocessing/__init__.py
RENAMED
|
@@ -13,21 +13,26 @@ from typing import Any as _Any
|
|
|
13
13
|
from typing import List as _List
|
|
14
14
|
|
|
15
15
|
from ..tools import regress_out as _regress_out
|
|
16
|
+
from ._duplicates import (
|
|
17
|
+
merge_duplicate_vars,
|
|
18
|
+
var_names_merge_duplicates,
|
|
19
|
+
)
|
|
16
20
|
from ._genename import (
|
|
17
21
|
convert_gene_identifiers,
|
|
18
22
|
standardize_gene_identifiers,
|
|
19
|
-
var_names_merge_duplicates,
|
|
20
23
|
)
|
|
21
24
|
from ._simple import (
|
|
22
25
|
filter_obs,
|
|
23
26
|
filter_var,
|
|
24
|
-
merge,
|
|
25
27
|
sort_anndata,
|
|
26
28
|
)
|
|
27
29
|
from ._transfer import (
|
|
30
|
+
merge,
|
|
28
31
|
transfer_layer,
|
|
29
32
|
transfer_obs_its,
|
|
30
33
|
transfer_obs_sti,
|
|
34
|
+
transfer_obs_to_integrated,
|
|
35
|
+
transfer_obs_to_specific,
|
|
31
36
|
)
|
|
32
37
|
|
|
33
38
|
__all__ = [
|
|
@@ -36,10 +41,13 @@ __all__ = [
|
|
|
36
41
|
"merge",
|
|
37
42
|
"sort_anndata",
|
|
38
43
|
"transfer_layer",
|
|
44
|
+
"transfer_obs_to_integrated",
|
|
45
|
+
"transfer_obs_to_specific",
|
|
39
46
|
"transfer_obs_sti",
|
|
40
47
|
"transfer_obs_its",
|
|
41
48
|
"convert_gene_identifiers",
|
|
42
49
|
"standardize_gene_identifiers",
|
|
50
|
+
"merge_duplicate_vars",
|
|
43
51
|
"var_names_merge_duplicates",
|
|
44
52
|
"regress_out",
|
|
45
53
|
]
|