exprmat 0.1.27__tar.gz → 0.1.29__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.
- {exprmat-0.1.27 → exprmat-0.1.29}/PKG-INFO +3 -2
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/__init__.py +53 -29
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/finders.py +1 -1
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/descriptive/kde.py +6 -3
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/expression.py +1 -1
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/track.py +52 -2
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reader/experiment.py +5 -6
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/utils.py +22 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/pyproject.toml +3 -2
- {exprmat-0.1.27 → exprmat-0.1.29}/Cargo.lock +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/Cargo.toml +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/ansi.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/clustering/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/clustering/cnmf.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/clustering/dbscan.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/clustering/kmeans.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/clustering/leiden.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/clustering/nmf.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/clustering/rogue.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/clustering/seriation.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/clustering/spectral.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/clustering/utils.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/cnv/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/cnv/cnvscore.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/cnv/infercnv.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/configuration.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/cistarget.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/delim.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/geneset.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/gff.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/io.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/lr.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/presets.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/private.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/ranges.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/signature.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/data/tf.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/descriptive/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/descriptive/aggregate.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/descriptive/atac.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/descriptive/aucell.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/descriptive/de.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/descriptive/gse.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/descriptive/recovery.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/descriptive/summary.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/descriptive/tcr.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/dynamics/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/dynamics/generank.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/dynamics/linreg.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/dynamics/moments.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/dynamics/optimization.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/dynamics/parallel.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/dynamics/preprocess.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/dynamics/pseudotime.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/dynamics/transition.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/dynamics/utils.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/dynamics/velocity.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/grn/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/grn/infergrn.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/grn/modules.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/grn/prune.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/grn/regressors.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/grn/utils.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/aggregate.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/method.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/methods/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/methods/cellchat.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/methods/cellphonedb.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/methods/connectome.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/methods/geomean.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/methods/logfc.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/methods/natmi.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/methods/rank_aggregate.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/methods/scseqcomm.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/methods/singlecellsignalr.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/pipeline.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/preprocess.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/resources.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/lr/utils.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/atac.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/cnmf.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/cnv.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/de.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/gse.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/lr.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/palettes.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/sankey.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/summary.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/utils.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/plotting/velocity.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/doublets/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/doublets/composite.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/doublets/scrublet.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/emptydrops.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/filter.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/impute/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/impute/magic.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/integrate.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/linear.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/normal.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/plot.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/qc.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/sctransform/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/sctransform/estimate.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/sctransform/ksmooth.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/sctransform/residual.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/sctransform/transform.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/sparse.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/preprocessing/uniform.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reader/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reader/matcher.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reader/metadata.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reader/peaks.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reader/static.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reduction/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reduction/forceatlas.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reduction/mde.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reduction/nn.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reduction/outliers.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reduction/pca.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reduction/plot.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reduction/spectral.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reduction/tsne.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/reduction/umap.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/trajectory/pcurve.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/transfer/__init__.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/exprmat/transfer/atlas.py +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/license +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/readme.md +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/Cargo.toml +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/license +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/readme +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/src/call_peaks.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/src/embedding.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/src/export.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/src/knn.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/src/lib.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/src/motif.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/src/network.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/src/preprocessing.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/src/utils/anndata.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2/src/utils.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/Cargo.toml +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/embedding.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/export.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/feature_count/counter.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/feature_count/data_iter.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/feature_count/matrix.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/feature_count/mod.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/genome.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/lib.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/motif.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/network.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/preprocessing/bam/flagstat.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/preprocessing/bam/header.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/preprocessing/bam/mark_duplicates.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/preprocessing/bam.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/preprocessing/import.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/preprocessing/mod.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/preprocessing/qc.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/utils/knn.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/utils/mod.rs +0 -0
- {exprmat-0.1.27 → exprmat-0.1.29}/snapatac2-core/src/utils/similarity.rs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: exprmat
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.29
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -54,7 +54,8 @@ Requires-Dist: multiprocessing-on-dill
|
|
|
54
54
|
Requires-Dist: pysam
|
|
55
55
|
Requires-Dist: hdbscan
|
|
56
56
|
Requires-Dist: graphtools
|
|
57
|
-
Requires-Dist: bincsync
|
|
57
|
+
Requires-Dist: bincsync>=0.3.0
|
|
58
|
+
Requires-Dist: pybigwig
|
|
58
59
|
Requires-Dist: sphinx ; extra == 'dev'
|
|
59
60
|
Requires-Dist: sphinx-rtd-theme ; extra == 'dev'
|
|
60
61
|
Requires-Dist: twine ; extra == 'dev'
|
|
@@ -8,22 +8,19 @@ import importlib.metadata
|
|
|
8
8
|
import mudata as mu
|
|
9
9
|
import anndata as ad
|
|
10
10
|
import scanpy as sc
|
|
11
|
+
import pathlib
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
from exprmat.
|
|
14
|
-
from exprmat.reader.experiment import experiment, load_experiment
|
|
15
|
-
from exprmat.reader.metadata import metadata, load_metadata
|
|
16
|
-
import exprmat.configuration as config
|
|
17
|
-
from exprmat.ansi import warning
|
|
13
|
+
from exprmat.configuration import default as config
|
|
14
|
+
from exprmat.ansi import warning, info
|
|
18
15
|
|
|
19
16
|
mu.set_options(pull_on_update = False)
|
|
20
|
-
|
|
17
|
+
|
|
21
18
|
|
|
22
19
|
DATABASE_SETUP_MESSAGE = """
|
|
23
20
|
The exprmat package do not come with a included database after version 0.1.25,
|
|
24
21
|
due to the extensive size of the reference data. You need to setup the database
|
|
25
|
-
and configure it properly with configuration file `
|
|
26
|
-
current working directory
|
|
22
|
+
and configure it properly with configuration file `.exprmatrc` under your
|
|
23
|
+
user root or current working directory
|
|
27
24
|
|
|
28
25
|
For more guide on how to setup the database folder, and more information about
|
|
29
26
|
what the database includes, see <https://github.com/yang-z-03/exprmat>
|
|
@@ -31,31 +28,56 @@ what the database includes, see <https://github.com/yang-z-03/exprmat>
|
|
|
31
28
|
|
|
32
29
|
# load configuration
|
|
33
30
|
PERFORM_DATABASE_CHECK = True
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
default_finders = [
|
|
32
|
+
'exprmat.config',
|
|
33
|
+
'.exprmat.config',
|
|
34
|
+
'.exprmatrc',
|
|
35
|
+
os.path.join(str(pathlib.Path.home()), 'exprmat.config'),
|
|
36
|
+
os.path.join(str(pathlib.Path.home()), '.exprmat.config'),
|
|
37
|
+
os.path.join(str(pathlib.Path.home()), '.exprmatrc')
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
for finder in default_finders:
|
|
41
|
+
if os.path.exists(finder):
|
|
42
|
+
info(f'load configuration from {finder}')
|
|
43
|
+
with open(finder, 'r') as f:
|
|
44
|
+
import json
|
|
45
|
+
workspace_config = json.load(f)
|
|
46
|
+
config.update(workspace_config)
|
|
47
|
+
break
|
|
48
|
+
|
|
49
|
+
basepath = config['data']
|
|
39
50
|
|
|
51
|
+
# core method exports
|
|
52
|
+
from exprmat.utils import setup_styles
|
|
53
|
+
from exprmat.reader.experiment import experiment, load_experiment
|
|
54
|
+
from exprmat.reader.metadata import metadata, load_metadata
|
|
40
55
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
setup_styles()
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def version_db():
|
|
60
|
+
dbpath = config['data']
|
|
44
61
|
version_file = os.path.join(dbpath, '.bsync', 'current')
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
62
|
+
|
|
63
|
+
if not os.path.exists(version_file):
|
|
64
|
+
db_ver = None
|
|
48
65
|
else:
|
|
49
66
|
with open(version_file, 'r') as vf:
|
|
50
67
|
db_ver = vf.read().strip()
|
|
51
|
-
if db_ver != importlib.metadata.version("exprmat"):
|
|
52
|
-
pkg_ver = importlib.metadata.version("exprmat")
|
|
53
|
-
warning('the exprmat database version ({db_ver}) is not compatible with package version ({pkg_ver})')
|
|
54
|
-
db_setup = False
|
|
55
68
|
|
|
56
|
-
|
|
57
|
-
|
|
69
|
+
return db_ver
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
# perform database integrity check.
|
|
73
|
+
if PERFORM_DATABASE_CHECK:
|
|
74
|
+
db_ver = version_db()
|
|
75
|
+
if db_ver is None:
|
|
76
|
+
warning('the database is not installed.')
|
|
58
77
|
print(DATABASE_SETUP_MESSAGE)
|
|
78
|
+
elif db_ver != importlib.metadata.version("exprmat"):
|
|
79
|
+
warning('the database version do not match the package version')
|
|
80
|
+
warning(f'db version: {db_ver} package version: {importlib.metadata.version("exprmat")}')
|
|
59
81
|
|
|
60
82
|
|
|
61
83
|
def version():
|
|
@@ -65,11 +87,13 @@ def version():
|
|
|
65
87
|
from exprmat.ansi import info, error, format_file_size
|
|
66
88
|
|
|
67
89
|
ver_string = importlib.metadata.version("exprmat")
|
|
90
|
+
db_ver = version_db()
|
|
91
|
+
|
|
68
92
|
MAJOR, MINOR, REVISION = [int(x) for x in ver_string.split('.')]
|
|
69
|
-
info(f'exprmat {MAJOR}.{MINOR}.{REVISION}')
|
|
93
|
+
info(f'exprmat {MAJOR}.{MINOR}.{REVISION} / exprmat-db {db_ver if db_ver is not None else "(Not installed)"}')
|
|
70
94
|
info(f'os: {os.name} ({sys.platform}) platform version: {platform.release()}')
|
|
71
95
|
info(f'current working directory: {os.getcwd()}')
|
|
72
|
-
info(f'current database directory: {config
|
|
96
|
+
info(f'current database directory: {config["data"]} ({db_ver if db_ver is not None else "(Not found)"})')
|
|
73
97
|
memory()
|
|
74
98
|
return (MAJOR, MINOR, REVISION)
|
|
75
99
|
|
|
@@ -86,7 +110,7 @@ def memory():
|
|
|
86
110
|
|
|
87
111
|
setwd = os.chdir
|
|
88
112
|
getwd = os.getcwd
|
|
89
|
-
def locate_data(dir): config.
|
|
113
|
+
def locate_data(dir): config.update_config('data', dir)
|
|
90
114
|
|
|
91
115
|
|
|
92
116
|
__all__ = [
|
|
@@ -100,9 +100,12 @@ def density(
|
|
|
100
100
|
cat_mask = adata.obs[groupby] == cat
|
|
101
101
|
embed_x = adata.obsm[f"{basis}"][cat_mask, components[0]]
|
|
102
102
|
embed_y = adata.obsm[f"{basis}"][cat_mask, components[1]]
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
n, = embed_x.shape
|
|
104
|
+
if n <= 5:
|
|
105
|
+
density_values[cat_mask] = 1 / n
|
|
106
|
+
else:
|
|
107
|
+
dens_embed = kde(embed_x, embed_y)
|
|
108
|
+
density_values[cat_mask] = dens_embed
|
|
106
109
|
|
|
107
110
|
adata.obs[density_covariate] = density_values
|
|
108
111
|
|
|
@@ -83,7 +83,7 @@ def initialize_tracks(
|
|
|
83
83
|
fmtstring = 'Gb'
|
|
84
84
|
|
|
85
85
|
xticklabels = [
|
|
86
|
-
str(x * scaler)
|
|
86
|
+
str(x * scaler).replace('.0', '')
|
|
87
87
|
for x in range(xticksfrom, xticksto + 1)]
|
|
88
88
|
xticklabels[-1] = xticklabels[-1] + ' ' + fmtstring
|
|
89
89
|
lastax.set_xticklabels(xticklabels)
|
|
@@ -255,8 +255,12 @@ def gene_track(
|
|
|
255
255
|
if show_gene_name:
|
|
256
256
|
ens = gtable['ensembl'].tolist()
|
|
257
257
|
dname = gtable['gene'].tolist()
|
|
258
|
-
if name in ens: displayname = dname[ens.index(name)]
|
|
258
|
+
if name in ens: displayname = dname[ens.index(name)] \
|
|
259
|
+
if str(ens.index(name)) != 'nan' else name
|
|
259
260
|
|
|
261
|
+
if displayname == 'nan':
|
|
262
|
+
displayname = ''
|
|
263
|
+
|
|
260
264
|
ntranscript = len(gene[gene['type'] == 'transcript'])
|
|
261
265
|
if ntranscript > 1: displayname += f' ({ntranscript})'
|
|
262
266
|
text = ax.text(max(requested_x, xfrom), requested_y + 0.25, displayname, verticalalignment = 'center')
|
|
@@ -435,6 +439,30 @@ def coverage_track_from_bam(
|
|
|
435
439
|
return coverage_track(ax, xfrom, xto, xticks, depth[['x', 'y']], color, xlabel, ylabel, show_x_axis)
|
|
436
440
|
|
|
437
441
|
|
|
442
|
+
def coverage_track_from_bigwig(
|
|
443
|
+
ax, bigwig, xfrom, xto, chrm, xticks, ncpus = 4,
|
|
444
|
+
color = 'blue', xlabel = None, ylabel = None, show_x_axis = True
|
|
445
|
+
):
|
|
446
|
+
'''
|
|
447
|
+
Examples
|
|
448
|
+
--------
|
|
449
|
+
>>> coverage_track_from_bam(
|
|
450
|
+
>>> axes[3], './fc.bigwig',
|
|
451
|
+
>>> xfrom, xto, chr_bam, xticks, ncpus = 4, xlabel = None, ylabel = 'WT',
|
|
452
|
+
>>> show_x_axis = True
|
|
453
|
+
>>> )
|
|
454
|
+
'''
|
|
455
|
+
import pyBigWig
|
|
456
|
+
from exprmat.ansi import error, warning
|
|
457
|
+
import os
|
|
458
|
+
import pandas
|
|
459
|
+
|
|
460
|
+
bw = pyBigWig.open(bigwig)
|
|
461
|
+
if not bw.chroms(chrm): error(f'specified chromosome {chrm} do not exist in the bigwig file.')
|
|
462
|
+
depth = pandas.DataFrame({'x': [x for x in range(xfrom, xto)], 'y': bw.values(chrm, xfrom, xto)})
|
|
463
|
+
return coverage_track(ax, xfrom, xto, xticks, depth[['x', 'y']], color, xlabel, ylabel, show_x_axis)
|
|
464
|
+
|
|
465
|
+
|
|
438
466
|
def architecture(assembly, figsize = (4, 8), dpi = 100, cby = 'assembly'):
|
|
439
467
|
'''
|
|
440
468
|
Examples
|
|
@@ -537,4 +565,26 @@ def genes(
|
|
|
537
565
|
from exprmat.ansi import error
|
|
538
566
|
error('must specify a range or a gene name flanking.')
|
|
539
567
|
return None
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
def whereis(assembly, where, upstream = 10000, downstream = 10000):
|
|
571
|
+
|
|
572
|
+
from exprmat.configuration import default as cfg
|
|
573
|
+
from exprmat.data.finders import get_genome
|
|
574
|
+
|
|
575
|
+
gtable = get_genome(cfg['taxa.reference'][assembly.lower()])
|
|
576
|
+
ens = gtable['ensembl'].tolist()
|
|
577
|
+
name = gtable['gene'].tolist()
|
|
578
|
+
|
|
579
|
+
if where in ens:
|
|
580
|
+
geneattr = gtable.iloc[ens.index(where), :].copy()
|
|
581
|
+
elif where in name:
|
|
582
|
+
geneattr = gtable.iloc[name.index(where), :].copy()
|
|
583
|
+
else: geneattr = gtable[where, :].copy()
|
|
584
|
+
|
|
585
|
+
chr = geneattr['.seqid']
|
|
586
|
+
xfrom = geneattr['.start'] - upstream
|
|
587
|
+
xto = geneattr['.end'] + downstream
|
|
588
|
+
|
|
589
|
+
return chr, xfrom, xto
|
|
540
590
|
|
|
@@ -71,7 +71,7 @@ class experiment:
|
|
|
71
71
|
|
|
72
72
|
attempt_path = os.path.join(dump, i_mod, i_sample + '.h5ad')
|
|
73
73
|
if os.path.exists(attempt_path):
|
|
74
|
-
if not
|
|
74
|
+
if not i_mod in self.modalities.keys(): self.modalities[i_mod] = {}
|
|
75
75
|
self.modalities[i_mod][i_sample] = sc.read_h5ad(attempt_path)
|
|
76
76
|
warning(f'load pre-exisiting file `{i_mod}/{i_sample}.h5ad`.')
|
|
77
77
|
continue
|
|
@@ -534,7 +534,7 @@ class experiment:
|
|
|
534
534
|
self, run_on_samples, func,
|
|
535
535
|
run_on_splits = False, split_key = None, split_selection = None, **kwargs
|
|
536
536
|
):
|
|
537
|
-
self.plot_for_modality(
|
|
537
|
+
return self.plot_for_modality(
|
|
538
538
|
'rna', run_on_samples, func,
|
|
539
539
|
run_on_splits, split_key, split_selection, **kwargs
|
|
540
540
|
)
|
|
@@ -543,7 +543,7 @@ class experiment:
|
|
|
543
543
|
self, run_on_samples, func,
|
|
544
544
|
run_on_splits = False, split_key = None, split_selection = None, **kwargs
|
|
545
545
|
):
|
|
546
|
-
self.plot_for_modality(
|
|
546
|
+
return self.plot_for_modality(
|
|
547
547
|
'atac', run_on_samples, func,
|
|
548
548
|
run_on_splits, split_key, split_selection, **kwargs
|
|
549
549
|
)
|
|
@@ -552,17 +552,16 @@ class experiment:
|
|
|
552
552
|
self, run_on_samples, func,
|
|
553
553
|
run_on_splits = False, split_key = None, split_selection = None, **kwargs
|
|
554
554
|
):
|
|
555
|
-
self.plot_for_modality(
|
|
555
|
+
return self.plot_for_modality(
|
|
556
556
|
'atac.cp', run_on_samples, func,
|
|
557
557
|
run_on_splits, split_key, split_selection, **kwargs
|
|
558
558
|
)
|
|
559
559
|
|
|
560
|
-
|
|
561
560
|
def plot_for_atac_gene_activity(
|
|
562
561
|
self, run_on_samples, func,
|
|
563
562
|
run_on_splits = False, split_key = None, split_selection = None, **kwargs
|
|
564
563
|
):
|
|
565
|
-
self.plot_for_modality(
|
|
564
|
+
return self.plot_for_modality(
|
|
566
565
|
'atac.g', run_on_samples, func,
|
|
567
566
|
run_on_splits, split_key, split_selection, **kwargs
|
|
568
567
|
)
|
|
@@ -368,6 +368,28 @@ seurat_to_10x <- function(srat, outdir) {
|
|
|
368
368
|
sparse <- Matrix(srat @ assays $ RNA @ counts, sparse = T)
|
|
369
369
|
writeMM(sparse, file = paste(outdir, 'matrix.mtx', sep = '/'))
|
|
370
370
|
}
|
|
371
|
+
|
|
372
|
+
spmatrix_to_mtx <- function(sp, outdir) {
|
|
373
|
+
features <- data.frame(
|
|
374
|
+
ensembl = rownames(sp),
|
|
375
|
+
gene = rownames(sp),
|
|
376
|
+
tag = "Gene Expression"
|
|
377
|
+
)
|
|
378
|
+
|
|
379
|
+
write(
|
|
380
|
+
x = colnames(sp),
|
|
381
|
+
file = paste(outdir, 'barcodes.tsv', sep = '/')
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
write.table(
|
|
385
|
+
x = features,
|
|
386
|
+
file = paste(outdir, 'features.tsv', sep = '/'),
|
|
387
|
+
sep = "\t", quote = FALSE, col.names = FALSE, row.names = FALSE
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
require(Matrix)
|
|
391
|
+
writeMM(sp, file = paste(outdir, 'matrix.mtx', sep = '/'))
|
|
392
|
+
}
|
|
371
393
|
'''
|
|
372
394
|
|
|
373
395
|
|
|
@@ -18,7 +18,7 @@ description = "exprmat: Routines for expression matrices"
|
|
|
18
18
|
readme = "readme.md"
|
|
19
19
|
license = {file = "license"}
|
|
20
20
|
requires-python = ">=3.9, <3.13"
|
|
21
|
-
version = "0.1.
|
|
21
|
+
version = "0.1.29"
|
|
22
22
|
authors = [
|
|
23
23
|
{name = "Zheng Yang", email = "xornent@outlook.com"}
|
|
24
24
|
]
|
|
@@ -80,7 +80,8 @@ dependencies = [
|
|
|
80
80
|
'pysam',
|
|
81
81
|
'hdbscan',
|
|
82
82
|
'graphtools',
|
|
83
|
-
'bincsync'
|
|
83
|
+
'bincsync >= 0.3.0',
|
|
84
|
+
'pyBigWig'
|
|
84
85
|
]
|
|
85
86
|
|
|
86
87
|
[project.optional-dependencies]
|
|
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
|
|
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
|
|
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
|