exprmat 0.1.36__tar.gz → 0.1.37__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.36 → exprmat-0.1.37}/PKG-INFO +2 -1
- exprmat-0.1.37/exprmat/peaks/sequence.py +29 -0
- exprmat-0.1.37/exprmat/plotting/data/A.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/B.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/C.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/D.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/E.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/F.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/G.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/H.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/I.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/J.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/K.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/L.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/M.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/N.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/O.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/P.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/Q.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/R.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/S.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/T.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/U.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/V.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/W.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/X.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/Y.pk +0 -0
- exprmat-0.1.37/exprmat/plotting/data/Z.pk +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/expression.py +2 -2
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/palettes.py +193 -73
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/sankey.py +1 -1
- exprmat-0.1.37/exprmat/plotting/sequence.py +291 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/utils.py +42 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/velocity.py +2 -3
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reader/experiment.py +4 -1
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reader/spatial.py +6 -6
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reader/static.py +12 -5
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reduction/plot.py +14 -23
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/utils.py +1 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/pyproject.toml +3 -2
- {exprmat-0.1.36 → exprmat-0.1.37}/Cargo.lock +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/Cargo.toml +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/ansi.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/clustering/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/clustering/cnmf.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/clustering/dbscan.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/clustering/kmeans.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/clustering/leiden.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/clustering/nmf.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/clustering/rogue.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/clustering/seriation.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/clustering/spectral.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/clustering/utils.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/cnv/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/cnv/cnvscore.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/cnv/infercnv.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/configuration.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/cistarget.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/delim.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/finders.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/geneset.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/gff.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/io.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/lr.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/presets.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/private.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/ranges.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/signature.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/data/tf.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/descriptive/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/descriptive/aggregate.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/descriptive/atac.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/descriptive/aucell.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/descriptive/de.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/descriptive/gse.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/descriptive/kde.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/descriptive/recovery.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/descriptive/summary.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/descriptive/tcr.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/deseq/dataset.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/deseq/gridsearch.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/deseq/inference.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/deseq/preprocessing.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/deseq/stats.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/deseq/utils.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/dynamics/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/dynamics/generank.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/dynamics/linreg.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/dynamics/moments.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/dynamics/optimization.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/dynamics/parallel.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/dynamics/preprocess.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/dynamics/pseudotime.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/dynamics/transition.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/dynamics/utils.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/dynamics/velocity.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/grn/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/grn/infergrn.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/grn/modules.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/grn/prune.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/grn/regressors.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/grn/utils.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/image/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/image/align.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/aggregate.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/method.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/methods/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/methods/cellchat.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/methods/cellphonedb.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/methods/connectome.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/methods/geomean.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/methods/logfc.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/methods/natmi.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/methods/rank_aggregate.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/methods/scseqcomm.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/methods/singlecellsignalr.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/pipeline.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/preprocess.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/resources.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/lr/utils.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/peaks/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/peaks/callpeak.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/peaks/idr/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/peaks/idr/constants.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/peaks/idr/idr.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/peaks/idr/invcdf.pyx +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/peaks/idr/optimization.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/peaks/idr/utils.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/atac.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/cnmf.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/cnv.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/de.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/gse.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/lr.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/summary.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/plotting/track.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/doublets/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/doublets/composite.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/doublets/scrublet.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/emptydrops.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/filter.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/impute/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/impute/magic.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/integrate.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/linear.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/normal.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/plot.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/qc.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/sctransform/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/sctransform/estimate.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/sctransform/ksmooth.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/sctransform/residual.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/sctransform/transform.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/sparse.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/preprocessing/uniform.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reader/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reader/matcher.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reader/metadata.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reader/peaks.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reduction/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reduction/forceatlas.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reduction/mde.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reduction/nn.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reduction/outliers.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reduction/pca.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reduction/spectral.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reduction/tsne.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/reduction/umap.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/trajectory/pcurve.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/transfer/__init__.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/exprmat/transfer/atlas.py +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/license +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/readme.md +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/Cargo.toml +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/license +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/readme +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/src/call_peaks.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/src/embedding.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/src/export.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/src/knn.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/src/lib.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/src/motif.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/src/network.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/src/preprocessing.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/src/utils/anndata.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2/src/utils.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/Cargo.toml +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/embedding.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/export.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/feature_count/counter.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/feature_count/data_iter.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/feature_count/matrix.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/feature_count/mod.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/genome.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/lib.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/motif.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/network.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/preprocessing/bam/flagstat.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/preprocessing/bam/header.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/preprocessing/bam/mark_duplicates.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/preprocessing/bam.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/preprocessing/import.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/preprocessing/mod.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/preprocessing/qc.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/utils/knn.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/snapatac2-core/src/utils/mod.rs +0 -0
- {exprmat-0.1.36 → exprmat-0.1.37}/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.37
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -74,6 +74,7 @@ Requires-Dist: pymemesuite
|
|
|
74
74
|
Requires-Dist: formulaic>=1.0.2
|
|
75
75
|
Requires-Dist: formulaic-contrasts>=0.2.0
|
|
76
76
|
Requires-Dist: cython
|
|
77
|
+
Requires-Dist: pyfastx
|
|
77
78
|
Requires-Dist: sphinx ; extra == 'dev'
|
|
78
79
|
Requires-Dist: twine ; extra == 'dev'
|
|
79
80
|
Requires-Dist: ipykernel ; extra == 'dev'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
import os
|
|
3
|
+
from rich.progress import track
|
|
4
|
+
from exprmat.data.finders import basepath
|
|
5
|
+
from exprmat.configuration import default
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def query_sequence(adata):
|
|
9
|
+
|
|
10
|
+
taxa = default['taxa.reference'][adata.uns['assembly']]
|
|
11
|
+
assembly = adata.uns['assembly']
|
|
12
|
+
|
|
13
|
+
genome = os.path.join(basepath, taxa, 'assemblies', assembly, 'genome.fa.gz')
|
|
14
|
+
import pyfastx
|
|
15
|
+
fa = pyfastx.Fasta(genome)
|
|
16
|
+
|
|
17
|
+
adata.var['strand.pos'] = 'N'
|
|
18
|
+
adata.var['strand.neg'] = 'N'
|
|
19
|
+
segments = adata.var[['chr', 'start', 'end']].copy().sort_values(['chr', 'start'])
|
|
20
|
+
chromosomes = segments['chr'].value_counts().index.tolist()
|
|
21
|
+
for chr in track(chromosomes, description = 'fetching chromosome ...'):
|
|
22
|
+
positions = []
|
|
23
|
+
subset = segments.loc[segments['chr'] == chr, :].copy()
|
|
24
|
+
for f, t in zip(subset['start'], subset['end']):
|
|
25
|
+
positions.append((f, t))
|
|
26
|
+
|
|
27
|
+
adata.var.loc[subset.index, 'strand.pos'] = fa.fetch(chr, positions, strand = '+')
|
|
28
|
+
adata.var.loc[subset.index, 'strand.neg'] = fa.fetch(chr, positions, strand = '-')
|
|
29
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -214,7 +214,7 @@ def volcano(
|
|
|
214
214
|
|
|
215
215
|
if isinstance(de_slot, str):
|
|
216
216
|
plots = st.rna_get_markers(
|
|
217
|
-
adata, de_slot = de_slot,
|
|
217
|
+
adata, None, de_slot = de_slot,
|
|
218
218
|
min_pct = min_pct, max_pct_reference = max_pct_reference,
|
|
219
219
|
min_lfc = min_lfc, max_lfc = max_lfc,
|
|
220
220
|
remove_zero_pval = remove_zero_pval
|
|
@@ -248,7 +248,7 @@ def volcano(
|
|
|
248
248
|
for p, f, nm in zip(sig_pvals, sig_fc, sig_names):
|
|
249
249
|
texts += [axes.text(f, p, nm, va = 'top', ha = 'center')]
|
|
250
250
|
|
|
251
|
-
adjust_text(texts)
|
|
251
|
+
# adjust_text(texts)
|
|
252
252
|
axes.scatter(sig_fc, sig_pvals, c = 'r', s = 10)
|
|
253
253
|
axes.grid(False)
|
|
254
254
|
|
|
@@ -49,7 +49,9 @@ from re import match
|
|
|
49
49
|
from typing import TYPE_CHECKING, TypeAlias, cast
|
|
50
50
|
from typing import ClassVar, Iterator
|
|
51
51
|
import numpy as np
|
|
52
|
+
|
|
52
53
|
from exprmat.ansi import error
|
|
54
|
+
from matplotlib.colors import Colormap
|
|
53
55
|
|
|
54
56
|
rgb_tuple = tuple[int, int, int] | tuple[int, int, int, float]
|
|
55
57
|
|
|
@@ -84,7 +86,7 @@ class color:
|
|
|
84
86
|
def from_rgb(cls, value: rgb_color):
|
|
85
87
|
raise NotImplementedError
|
|
86
88
|
|
|
87
|
-
def lighten(self, amount: float):
|
|
89
|
+
def lighten(self, amount: float) -> rgb_color:
|
|
88
90
|
rgb = self.to_rgb()
|
|
89
91
|
h, l, s = colorsys.rgb_to_hls(float(rgb.r)/255, float(rgb.g)/255, float(rgb.b)/255)
|
|
90
92
|
new_l = self.clamp(l + amount, 1)
|
|
@@ -94,6 +96,16 @@ class color:
|
|
|
94
96
|
rgb.b = round(b * 255)
|
|
95
97
|
return self.from_rgb(rgb)
|
|
96
98
|
|
|
99
|
+
def saturate(self, amount: float):
|
|
100
|
+
rgb = self.to_rgb()
|
|
101
|
+
h, l, s = colorsys.rgb_to_hls(float(rgb.r)/255, float(rgb.g)/255, float(rgb.b)/255)
|
|
102
|
+
new_s = self.clamp(s * amount, 1)
|
|
103
|
+
r, g, b = colorsys.hls_to_rgb(h, l, new_s)
|
|
104
|
+
rgb.r = round(r * 255)
|
|
105
|
+
rgb.g = round(g * 255)
|
|
106
|
+
rgb.b = round(b * 255)
|
|
107
|
+
return self.from_rgb(rgb)
|
|
108
|
+
|
|
97
109
|
@abstractmethod
|
|
98
110
|
def to_css(self) -> str:
|
|
99
111
|
raise NotImplementedError
|
|
@@ -1383,96 +1395,102 @@ TolRainbow = { 3: TolRainbow3, 4: TolRainbow4, 5: TolRainbow5, 6: TolRain
|
|
|
1383
1395
|
18: TolRainbow18, 19: TolRainbow19, 20: TolRainbow20, 21: TolRainbow21, 22: TolRainbow22, 23: TolRainbow23 }
|
|
1384
1396
|
|
|
1385
1397
|
brewer = {
|
|
1386
|
-
'
|
|
1387
|
-
'
|
|
1388
|
-
'
|
|
1389
|
-
'
|
|
1390
|
-
'
|
|
1391
|
-
'
|
|
1392
|
-
'
|
|
1393
|
-
'
|
|
1394
|
-
'
|
|
1395
|
-
'
|
|
1396
|
-
'
|
|
1397
|
-
'
|
|
1398
|
-
'
|
|
1399
|
-
'
|
|
1400
|
-
'
|
|
1401
|
-
'
|
|
1402
|
-
'
|
|
1403
|
-
'
|
|
1404
|
-
'
|
|
1405
|
-
'
|
|
1406
|
-
'
|
|
1407
|
-
'
|
|
1408
|
-
'
|
|
1409
|
-
'
|
|
1410
|
-
'
|
|
1411
|
-
'
|
|
1412
|
-
'
|
|
1413
|
-
'
|
|
1414
|
-
'
|
|
1415
|
-
'
|
|
1416
|
-
'
|
|
1417
|
-
'
|
|
1418
|
-
'
|
|
1419
|
-
'
|
|
1420
|
-
'
|
|
1398
|
+
'ylgn' : YlGn,
|
|
1399
|
+
'ylgnbu' : YlGnBu,
|
|
1400
|
+
'gnbu' : GnBu,
|
|
1401
|
+
'bugn' : BuGn,
|
|
1402
|
+
'pubugn' : PuBuGn,
|
|
1403
|
+
'pubu' : PuBu,
|
|
1404
|
+
'bupu' : BuPu,
|
|
1405
|
+
'rdpu' : RdPu,
|
|
1406
|
+
'purd' : PuRd,
|
|
1407
|
+
'orrd' : OrRd,
|
|
1408
|
+
'ylorrd' : YlOrRd,
|
|
1409
|
+
'ylorbr' : YlOrBr,
|
|
1410
|
+
'purples' : Purples,
|
|
1411
|
+
'blues' : Blues,
|
|
1412
|
+
'greens' : Greens,
|
|
1413
|
+
'oranges' : Oranges,
|
|
1414
|
+
'reds' : Reds,
|
|
1415
|
+
'greys' : Greys,
|
|
1416
|
+
'puor' : PuOr,
|
|
1417
|
+
'brbg' : BrBG,
|
|
1418
|
+
'prgn' : PRGn,
|
|
1419
|
+
'piyg' : PiYG,
|
|
1420
|
+
'rdbu' : RdBu,
|
|
1421
|
+
'rdgy' : RdGy,
|
|
1422
|
+
'rdylbu' : RdYlBu,
|
|
1423
|
+
'spectral' : Spectral,
|
|
1424
|
+
'rdylgn' : RdYlGn,
|
|
1425
|
+
'accent' : Accent,
|
|
1426
|
+
'dark2' : Dark2,
|
|
1427
|
+
'paired' : Paired,
|
|
1428
|
+
'pastel1' : Pastel1,
|
|
1429
|
+
'pastel2' : Pastel2,
|
|
1430
|
+
'set1' : Set1,
|
|
1431
|
+
'set2' : Set2,
|
|
1432
|
+
'set3' : Set3,
|
|
1421
1433
|
}
|
|
1422
1434
|
|
|
1423
1435
|
d3 = {
|
|
1424
|
-
'
|
|
1425
|
-
'
|
|
1426
|
-
'
|
|
1427
|
-
'
|
|
1436
|
+
'category10' : Category10,
|
|
1437
|
+
'category20' : Category20,
|
|
1438
|
+
'category20b' : Category20b,
|
|
1439
|
+
'category20c' : Category20c,
|
|
1428
1440
|
}
|
|
1429
1441
|
|
|
1430
1442
|
mpl = {
|
|
1431
|
-
'
|
|
1432
|
-
'
|
|
1433
|
-
'
|
|
1434
|
-
'
|
|
1435
|
-
'
|
|
1443
|
+
'magma' : Magma,
|
|
1444
|
+
'inferno' : Inferno,
|
|
1445
|
+
'plasma' : Plasma,
|
|
1446
|
+
'viridis' : Viridis,
|
|
1447
|
+
'cividis' : Cividis,
|
|
1436
1448
|
}
|
|
1437
1449
|
|
|
1438
1450
|
tol = {
|
|
1439
|
-
'
|
|
1440
|
-
'
|
|
1441
|
-
'
|
|
1442
|
-
'
|
|
1443
|
-
'
|
|
1444
|
-
'
|
|
1445
|
-
'
|
|
1446
|
-
'
|
|
1447
|
-
'
|
|
1448
|
-
'
|
|
1449
|
-
'
|
|
1450
|
-
'
|
|
1451
|
+
'bright': Bright,
|
|
1452
|
+
'highcontrast': HighContrast,
|
|
1453
|
+
'vibrant': Vibrant,
|
|
1454
|
+
'muted': Muted,
|
|
1455
|
+
'mediumcontrast': MediumContrast,
|
|
1456
|
+
'light': Light,
|
|
1457
|
+
'sunset': Sunset,
|
|
1458
|
+
'burd': BuRd,
|
|
1459
|
+
'tolprgn': TolPRGn,
|
|
1460
|
+
'tolylorbr': TolYlOrBr,
|
|
1461
|
+
'iridescent': Iridescent,
|
|
1462
|
+
'tolrainbow': TolRainbow,
|
|
1451
1463
|
}
|
|
1452
1464
|
|
|
1453
1465
|
colorblind = {
|
|
1454
|
-
'
|
|
1466
|
+
'colorblind' : Colorblind,
|
|
1455
1467
|
}
|
|
1456
1468
|
|
|
1457
1469
|
all_palettes = deepcopy(brewer)
|
|
1458
1470
|
all_palettes.update(d3)
|
|
1459
1471
|
all_palettes.update(tol)
|
|
1460
|
-
all_palettes['
|
|
1461
|
-
all_palettes['
|
|
1462
|
-
all_palettes['
|
|
1463
|
-
all_palettes['
|
|
1464
|
-
all_palettes['
|
|
1465
|
-
all_palettes['
|
|
1466
|
-
all_palettes['
|
|
1472
|
+
all_palettes['colorblind'] = Colorblind
|
|
1473
|
+
all_palettes['magma'] = Magma
|
|
1474
|
+
all_palettes['inferno'] = Inferno
|
|
1475
|
+
all_palettes['plasma'] = Plasma
|
|
1476
|
+
all_palettes['viridis'] = Viridis
|
|
1477
|
+
all_palettes['cividis'] = Cividis
|
|
1478
|
+
all_palettes['turbo'] = Turbo
|
|
1467
1479
|
|
|
1468
1480
|
small_palettes = deepcopy(all_palettes)
|
|
1469
|
-
del small_palettes['
|
|
1470
|
-
del small_palettes['
|
|
1471
|
-
del small_palettes['
|
|
1472
|
-
del small_palettes['
|
|
1473
|
-
del small_palettes['
|
|
1474
|
-
del small_palettes['
|
|
1475
|
-
del small_palettes['
|
|
1481
|
+
del small_palettes['greys'][256]
|
|
1482
|
+
del small_palettes['magma'][256]
|
|
1483
|
+
del small_palettes['inferno'][256]
|
|
1484
|
+
del small_palettes['plasma'][256]
|
|
1485
|
+
del small_palettes['viridis'][256]
|
|
1486
|
+
del small_palettes['cividis'][256]
|
|
1487
|
+
del small_palettes['turbo'][256]
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
def to_matplotlib(palette: palette) -> Colormap:
|
|
1491
|
+
from matplotlib.colors import ListedColormap
|
|
1492
|
+
return ListedColormap(palette)
|
|
1493
|
+
|
|
1476
1494
|
|
|
1477
1495
|
def linear_palette(palette: palette, n: int) -> palette:
|
|
1478
1496
|
'''
|
|
@@ -1598,6 +1616,7 @@ def varying_alpha_palette(
|
|
|
1598
1616
|
|
|
1599
1617
|
return palette
|
|
1600
1618
|
|
|
1619
|
+
|
|
1601
1620
|
def interp_palette(palette: palette, n: int) -> palette:
|
|
1602
1621
|
|
|
1603
1622
|
npalette = len(palette)
|
|
@@ -1636,6 +1655,31 @@ def cividis(n: int) -> palette:
|
|
|
1636
1655
|
def turbo(n: int) -> palette:
|
|
1637
1656
|
return linear_palette(Turbo256, n)
|
|
1638
1657
|
|
|
1658
|
+
def cmdiv_wyj(n: int) -> palette:
|
|
1659
|
+
return interp_palette(palette((
|
|
1660
|
+
rgb_color(78, 42, 135).to_hex(),
|
|
1661
|
+
rgb_color(162, 184, 198).to_hex(),
|
|
1662
|
+
rgb_color(176, 114, 103).to_hex(),
|
|
1663
|
+
rgb_color(143, 11, 9).to_hex()
|
|
1664
|
+
)), n = n)
|
|
1665
|
+
|
|
1666
|
+
def awared_darken(c: rgb_color, lighten = 0.3, saturate = 0.4):
|
|
1667
|
+
grayscale = 0.30 * c.r + 0.59 + c.g + 0.11 * c.b
|
|
1668
|
+
darken = (max(0, grayscale - 45) / 255.0) * 0.40
|
|
1669
|
+
return c.darken(darken).lighten(lighten).saturate(saturate)
|
|
1670
|
+
|
|
1671
|
+
def moddark(n: int) -> palette:
|
|
1672
|
+
return interp_palette(palette([
|
|
1673
|
+
awared_darken(rgb_color.from_hex_string(c), 0.1, 0.9).to_hex()
|
|
1674
|
+
for c in turbo(n)
|
|
1675
|
+
]), n = n)
|
|
1676
|
+
|
|
1677
|
+
def modlight(n: int) -> palette:
|
|
1678
|
+
return interp_palette(palette([
|
|
1679
|
+
awared_darken(rgb_color.from_hex_string(c), 0.4, 0.5).to_hex()
|
|
1680
|
+
for c in turbo(n)
|
|
1681
|
+
]), n = n)
|
|
1682
|
+
|
|
1639
1683
|
def grey(n: int) -> palette:
|
|
1640
1684
|
return linear_palette(Greys256, n)
|
|
1641
1685
|
|
|
@@ -1643,11 +1687,87 @@ def gray(n: int) -> palette:
|
|
|
1643
1687
|
return linear_palette(Greys256, n)
|
|
1644
1688
|
|
|
1645
1689
|
|
|
1690
|
+
def plot_colormap(p: palette, ax = None, figsize = (2, 2), dpi = 100, title = None):
|
|
1691
|
+
rgba_array = to_rgba_array(p)
|
|
1692
|
+
|
|
1693
|
+
import matplotlib.pyplot as plt
|
|
1694
|
+
if ax is None: fig, ax = plt.subplots(1, 1, figsize = figsize, dpi = dpi)
|
|
1695
|
+
else: fig = ax.figure
|
|
1696
|
+
|
|
1697
|
+
cs = []; xs = []; ys = []
|
|
1698
|
+
for i, rgb in enumerate(rgba_array):
|
|
1699
|
+
col = rgb_color(rgb[0], rgb[1], rgb[2]).to_hex()
|
|
1700
|
+
cs.append(col)
|
|
1701
|
+
xs.append(i)
|
|
1702
|
+
ys.append(0.3 * rgb[0] / 255 + 0.59 * rgb[1] / 255 + 0.11 * rgb[2] / 255)
|
|
1703
|
+
|
|
1704
|
+
ax.scatter(xs, ys, c = cs, s = 120)
|
|
1705
|
+
ax.set_ylim((0, 1))
|
|
1706
|
+
ax.set_xlim((-1, len(cs)))
|
|
1707
|
+
ax.set_xticks([])
|
|
1708
|
+
ax.set_yticks([])
|
|
1709
|
+
|
|
1710
|
+
if title: ax.set_xlabel(title)
|
|
1711
|
+
return fig
|
|
1712
|
+
|
|
1713
|
+
|
|
1714
|
+
def demo_colormap(ncols = 6, dpi = 100):
|
|
1715
|
+
|
|
1716
|
+
import matplotlib.pyplot as plt
|
|
1717
|
+
n_features = len(all_palettes)
|
|
1718
|
+
nrows = n_features // ncols
|
|
1719
|
+
if n_features % ncols != 0: nrows += 1
|
|
1720
|
+
fig, axes = plt.subplots(nrows, ncols, dpi = dpi, figsize = (ncols * 1.45, nrows * 1.6))
|
|
1721
|
+
|
|
1722
|
+
for i, feat in enumerate(list(all_palettes.keys())):
|
|
1723
|
+
if len(axes.shape) == 2:
|
|
1724
|
+
plot_colormap(
|
|
1725
|
+
get_palette(feat, 256),
|
|
1726
|
+
axes[i // ncols, i % ncols],
|
|
1727
|
+
title = feat
|
|
1728
|
+
)
|
|
1729
|
+
elif len(axes.shape) == 1:
|
|
1730
|
+
plot_colormap(get_palette(feat, 256), axes[i], title = feat)
|
|
1731
|
+
|
|
1732
|
+
for icol in range(ncols):
|
|
1733
|
+
for irow in range(nrows):
|
|
1734
|
+
if len(axes.shape) == 2:
|
|
1735
|
+
axes[irow, icol].set_xticks([])
|
|
1736
|
+
axes[irow, icol].set_yticks([])
|
|
1737
|
+
else:
|
|
1738
|
+
axes[icol].set_xticks([])
|
|
1739
|
+
axes[icol].set_yticks([])
|
|
1740
|
+
|
|
1741
|
+
fig.tight_layout()
|
|
1742
|
+
return fig
|
|
1743
|
+
|
|
1744
|
+
|
|
1646
1745
|
def to_rgba_array(palette: palette):
|
|
1647
1746
|
rgba_array = np.empty((len(palette), 4), dtype=np.uint8)
|
|
1648
1747
|
|
|
1649
1748
|
for i, color in enumerate(palette):
|
|
1650
1749
|
rgba = named_color.from_string(color)
|
|
1651
|
-
rgba_array[i] = (rgba.r, rgba.g, rgba.b, rgba.a*255)
|
|
1750
|
+
rgba_array[i] = (rgba.r, rgba.g, rgba.b, rgba.a * 255)
|
|
1652
1751
|
|
|
1653
1752
|
return rgba_array
|
|
1753
|
+
|
|
1754
|
+
|
|
1755
|
+
def get_palette_tuple(name, n):
|
|
1756
|
+
|
|
1757
|
+
if name not in all_palettes.keys():
|
|
1758
|
+
error(f'can not find a palette named `{name}`.')
|
|
1759
|
+
|
|
1760
|
+
if isinstance(all_palettes[name], dict):
|
|
1761
|
+
if n in all_palettes[name].keys():
|
|
1762
|
+
return all_palettes[name][n]
|
|
1763
|
+
else: return interp_palette(all_palettes[name][list(all_palettes[name].keys())[-1]], n)
|
|
1764
|
+
else: return interp_palette(all_palettes[name], n)
|
|
1765
|
+
|
|
1766
|
+
|
|
1767
|
+
def get_palette(name, n):
|
|
1768
|
+
return list(get_palette_tuple(name, n))
|
|
1769
|
+
|
|
1770
|
+
# custom palettes
|
|
1771
|
+
all_palettes['cmdiv_wyj'] = cmdiv_wyj(256)
|
|
1772
|
+
all_palettes['modlight'] = modlight(256)
|
|
1773
|
+
all_palettes['moddark'] = moddark(256)
|
|
@@ -26,7 +26,7 @@ def check_data_matches_labels(labels, data, side):
|
|
|
26
26
|
def sankey(
|
|
27
27
|
left, right, left_weights = None, right_weights = None,
|
|
28
28
|
colors = None, left_labels = None, right_labels = None,
|
|
29
|
-
aspect = 4, right_colors = False, cmap = '
|
|
29
|
+
aspect = 4, right_colors = False, cmap = 'turbo',
|
|
30
30
|
fontsize = 9, figsize = (4, 4), ax = None
|
|
31
31
|
):
|
|
32
32
|
|