exprmat 0.1.49__tar.gz → 0.1.51__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.49 → exprmat-0.1.51}/PKG-INFO +108 -5
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/__init__.py +30 -2
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/ansi.py +45 -21
- exprmat-0.1.51/exprmat/data/icnet.py +74 -0
- exprmat-0.1.51/exprmat/lr/icnet/__init__.py +100 -0
- exprmat-0.1.51/exprmat/lr/icnet/construction.py +270 -0
- exprmat-0.1.51/exprmat/lr/icnet/importance.py +159 -0
- exprmat-0.1.51/exprmat/lr/icnet/ligand.py +333 -0
- exprmat-0.1.51/exprmat/lr/icnet/metrics.py +90 -0
- exprmat-0.1.51/exprmat/lr/icnet/pagerank.py +124 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/expression.py +4 -4
- exprmat-0.1.51/exprmat/plotting/icnet.py +28 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/utils.py +2 -2
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/velocity.py +2 -1
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reader/experiment.py +351 -308
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reader/static.py +20 -2
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/utils.py +4 -0
- exprmat-0.1.51/license +674 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/pyproject.toml +2 -2
- exprmat-0.1.51/readme.md +164 -0
- exprmat-0.1.49/license +0 -0
- exprmat-0.1.49/readme.md +0 -62
- {exprmat-0.1.49 → exprmat-0.1.51}/Cargo.lock +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/Cargo.toml +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/clustering/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/clustering/cnmf.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/clustering/dbscan.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/clustering/gating.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/clustering/kmeans.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/clustering/leiden.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/clustering/nmf.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/clustering/rogue.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/clustering/sc3.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/clustering/seriation.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/clustering/spectral.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/clustering/utils.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/cnv/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/cnv/cnvscore.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/cnv/infercnv.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/configuration.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/data/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/data/cistarget.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/data/cre.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/data/finders.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/data/geneset.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/data/io.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/data/lr.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/data/orthologs.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/data/presets.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/data/signature.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/data/tf.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/deconv/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/deconv/deconv.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/deconv/simulation.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/descriptive/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/descriptive/aggregate.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/descriptive/atac.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/descriptive/aucell.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/descriptive/de.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/descriptive/gse.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/descriptive/kde.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/descriptive/recovery.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/descriptive/summary.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/descriptive/tcr.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/deseq/dataset.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/deseq/gridsearch.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/deseq/inference.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/deseq/preprocessing.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/deseq/stats.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/deseq/utils.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/dynamics/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/dynamics/generank.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/dynamics/linreg.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/dynamics/moments.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/dynamics/optimization.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/dynamics/parallel.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/dynamics/preprocess.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/dynamics/pseudotime.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/dynamics/transition.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/dynamics/utils.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/dynamics/velocity.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/grn/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/grn/infergrn.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/grn/modules.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/grn/prune.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/grn/regressors.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/grn/utils.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/image/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/image/align.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/aggregate.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/method.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/methods/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/methods/cellchat.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/methods/cellphonedb.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/methods/connectome.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/methods/geomean.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/methods/logfc.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/methods/natmi.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/methods/rank_aggregate.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/methods/scseqcomm.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/methods/singlecellsignalr.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/pipeline.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/preprocess.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/resources.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/lr/utils.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/metacell/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/metacell/engine.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/metacell/model.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/metacell/utils.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/callpeak.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/common.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/coverage.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/footprint.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/idr/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/idr/constants.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/idr/idr.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/idr/invcdf.pyx +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/idr/optimization.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/idr/utils.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/linkage.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/motif.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/peaks/sequence.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/atac.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/cnmf.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/cnv.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/A.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/B.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/C.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/D.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/E.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/F.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/G.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/H.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/I.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/J.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/K.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/L.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/M.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/N.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/O.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/P.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/Q.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/R.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/S.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/T.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/U.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/V.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/W.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/X.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/Y.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/data/Z.pk +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/de.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/gse.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/lr.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/milestone.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/palettes.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/sankey.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/sequence.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/summary.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/track.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/plotting/trajectory.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/doublets/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/doublets/composite.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/doublets/scrublet.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/emptydrops.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/filter.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/impute/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/impute/magic.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/integrate.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/linear.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/normal.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/plot.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/qc.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/sctransform/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/sctransform/estimate.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/sctransform/ksmooth.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/sctransform/residual.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/sctransform/transform.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/sparse.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/preprocessing/uniform.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reader/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reader/conversions.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reader/matcher.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reader/metadata.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reader/spatial.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reader/updater.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reduction/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reduction/diffmap.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reduction/forceatlas.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reduction/mde.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reduction/nn.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reduction/outliers.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reduction/pca.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reduction/plot.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reduction/scvi.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reduction/spectral.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reduction/tsne.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/reduction/umap.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/trajectory/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/trajectory/cytotrace.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/trajectory/elpi.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/trajectory/pcurve.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/trajectory/pseudotime.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/trajectory/root.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/trajectory/trace.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/transfer/__init__.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/exprmat/transfer/atlas.py +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/Cargo.toml +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/license +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/readme +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/src/call_peaks.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/src/embedding.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/src/export.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/src/knn.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/src/lib.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/src/motif.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/src/network.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/src/preprocessing.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/src/utils/anndata.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2/src/utils.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/Cargo.toml +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/embedding.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/export.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/feature_count/counter.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/feature_count/data_iter.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/feature_count/matrix.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/feature_count/mod.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/genome.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/lib.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/motif.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/network.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/preprocessing/bam/flagstat.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/preprocessing/bam/header.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/preprocessing/bam/mark_duplicates.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/preprocessing/bam.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/preprocessing/import.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/preprocessing/mod.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/preprocessing/qc.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/utils/knn.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/snapatac2-core/src/utils/mod.rs +0 -0
- {exprmat-0.1.49 → exprmat-0.1.51}/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.51
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -101,7 +101,7 @@ Provides-Extra: cuda12
|
|
|
101
101
|
License-File: license
|
|
102
102
|
Summary: exprmat: Routines for expression matrices
|
|
103
103
|
Author-email: Zheng Yang <xornent@outlook.com>
|
|
104
|
-
Requires-Python: >=3.
|
|
104
|
+
Requires-Python: >=3.10, <3.13
|
|
105
105
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
106
106
|
Project-URL: Repository, https://github.com/yang-z-03/exprmat
|
|
107
107
|
|
|
@@ -150,20 +150,123 @@ options:
|
|
|
150
150
|
--version VERSION The version to fetch from remote.
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
Suppose you are installing the database version `0.1.
|
|
153
|
+
Suppose you are installing the database version `0.1.50` to `~/database`.
|
|
154
154
|
|
|
155
155
|
```bash
|
|
156
156
|
# enter the intended path of installation
|
|
157
157
|
cd ~/database
|
|
158
158
|
|
|
159
|
-
# download the version 0.1.
|
|
159
|
+
# download the version 0.1.50 of database distribution
|
|
160
160
|
# you must download the same version of the database with the package. the database
|
|
161
161
|
# and package content are published strictly synchronically.
|
|
162
162
|
bsync-fetch --id <your-id> --secret <your-api-secret> \
|
|
163
163
|
--bucket exprmat-data --endpoint oss-cn-wuhan-lr.aliyuncs.com \
|
|
164
|
-
--version 0.1.
|
|
164
|
+
--version 0.1.50
|
|
165
165
|
```
|
|
166
166
|
|
|
167
167
|
The authentication tokens passed to `--id` and `--secret` is provided by the
|
|
168
168
|
Alibaba Cloud service (See the [Documentation](https://help.aliyun.com/zh/ram/user-guide/create-an-accesskey-pair)
|
|
169
169
|
for details)
|
|
170
|
+
|
|
171
|
+
### Licensing
|
|
172
|
+
|
|
173
|
+
The original part of the source code is licensed under GNU GPLv3.
|
|
174
|
+
|
|
175
|
+
```
|
|
176
|
+
exprmat - Routines to manipulate expression matrices
|
|
177
|
+
Copyright (C) 2025 - 2026 Zheng Yang (杨政) <xornent@outlook.com>
|
|
178
|
+
|
|
179
|
+
exprmat is free software and comes with ABSOLUTELY NO WARRANTY.
|
|
180
|
+
You are welcome to redistribute it under certain conditions.
|
|
181
|
+
You should have received a copy of the GNU General Public License
|
|
182
|
+
version 3 along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
183
|
+
|
|
184
|
+
The GNU General Public License does not permit incorporating
|
|
185
|
+
your program into proprietary programs.
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
I acknowledge the following author(s) for modifying and integrating their work
|
|
189
|
+
in the form of source code to this package.
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
parts of the source code under /preprocessing comes from the scanpy project.
|
|
193
|
+
|
|
194
|
+
BSD 3-Clause License. For full text of the license, see
|
|
195
|
+
<https://opensource.org/license/BSD-3-clause>
|
|
196
|
+
Copyright (c) 2025 scverse®
|
|
197
|
+
Copyright (c) 2017 F. Alexander Wolf, P. Angerer, Theis Lab
|
|
198
|
+
|
|
199
|
+
function embedding_atlas (file /reduction/plot.py) comes from the omicverse project.
|
|
200
|
+
|
|
201
|
+
GNU GPLv3. (same as this project)
|
|
202
|
+
Copyright (c) 2024 112 Lab
|
|
203
|
+
|
|
204
|
+
most of the code from /snapatac2 and /snapatac2-core comes from the SnapATAC
|
|
205
|
+
project, including the rust build system and the compiled binaries.
|
|
206
|
+
|
|
207
|
+
The MIT license. For full text of the license, see
|
|
208
|
+
<https://opensource.org/license/MIT>
|
|
209
|
+
Copyright (c) 2022-2024 Kai Zhang
|
|
210
|
+
|
|
211
|
+
file /clustering/sc3.py comes from the sc3s project.
|
|
212
|
+
|
|
213
|
+
GNU GPLv3. (same as this project)
|
|
214
|
+
Copyright (c) Quah, F.X. and Hemberg, M. and contributors.
|
|
215
|
+
|
|
216
|
+
file /clustering/nmf.py comes from cNMF project.
|
|
217
|
+
|
|
218
|
+
The MIT license
|
|
219
|
+
Copyright (c) 2019 Dylan Kotliar
|
|
220
|
+
|
|
221
|
+
directory /cnv comes from infercnvpy project.
|
|
222
|
+
|
|
223
|
+
BSD 3-Clause License
|
|
224
|
+
Copyright (c) 2022, Gregor Sturm
|
|
225
|
+
|
|
226
|
+
directory /deconv comes from the TAPE project.
|
|
227
|
+
|
|
228
|
+
GNU GPLv3. (same as this project)
|
|
229
|
+
Copyright (c) The contributors.
|
|
230
|
+
|
|
231
|
+
directory /metacell comes from the MetaQ project.
|
|
232
|
+
|
|
233
|
+
MIT License
|
|
234
|
+
Copyright (c) 2024 XLearning Group
|
|
235
|
+
|
|
236
|
+
directory /grn comes from the scenicplus project.
|
|
237
|
+
|
|
238
|
+
Academic Non-commercial Software License Agreement.
|
|
239
|
+
For full text of the license, see <https://github.com/aertslab/scenicplus>
|
|
240
|
+
Copyright (c) The contributors.
|
|
241
|
+
|
|
242
|
+
directory /lr (but not /lr/icnet) comes from the lianapy project
|
|
243
|
+
|
|
244
|
+
BSD 3-Clause License
|
|
245
|
+
Copyright (c) 2025, Daniel Dimitrov
|
|
246
|
+
|
|
247
|
+
directory /peaks/idr.py comes from the idr project
|
|
248
|
+
|
|
249
|
+
GNU GPLv2. For copyright details, see <https://github.com/nboley/idr>
|
|
250
|
+
Copyright (c) The contributors
|
|
251
|
+
|
|
252
|
+
function diffmap comes from the pydiffmap project
|
|
253
|
+
|
|
254
|
+
MIT License
|
|
255
|
+
Copyright (c) 2018 Ralf Banisch, Erik Henning Thiede, Zofia Trstanova
|
|
256
|
+
|
|
257
|
+
principle tree fitting and trajectory analysis comes from the scFates project
|
|
258
|
+
|
|
259
|
+
BSD 3-Clause License
|
|
260
|
+
Copyright (c) 2020, Louis Faure
|
|
261
|
+
|
|
262
|
+
file /trajectory/cytotrace.py comes from the CytoTRACE2 project
|
|
263
|
+
|
|
264
|
+
Stanford Non-commercial Software License Agreement
|
|
265
|
+
Copyright (c) The contributors.
|
|
266
|
+
|
|
267
|
+
rna velocity fitting comes from the scvelo project
|
|
268
|
+
|
|
269
|
+
BSD 3-Clause License
|
|
270
|
+
Copyright (c) 2018, Theis Lab
|
|
271
|
+
```
|
|
272
|
+
|
|
@@ -82,7 +82,7 @@ due to the extensive size of the reference data. You need to setup the database
|
|
|
82
82
|
and configure it properly with configuration file `.exprmatrc` under your
|
|
83
83
|
user root or current working directory
|
|
84
84
|
|
|
85
|
-
For more guide on how to
|
|
85
|
+
For more guide on how to install the database, and more information about
|
|
86
86
|
what the database includes, see <https://github.com/yang-z-03/exprmat>
|
|
87
87
|
"""
|
|
88
88
|
|
|
@@ -112,7 +112,7 @@ basepath = config['data']
|
|
|
112
112
|
|
|
113
113
|
# core method exports
|
|
114
114
|
from exprmat.utils import setup_styles, savefig
|
|
115
|
-
from exprmat.ansi import pprog, pproga, info, error, warning
|
|
115
|
+
from exprmat.ansi import pprog, pproga, info, error, warning, default_logger, logger
|
|
116
116
|
from exprmat.reader.experiment import experiment, load_experiment
|
|
117
117
|
from exprmat.reader.metadata import metadata, load_metadata
|
|
118
118
|
import exprmat.reader.static as st
|
|
@@ -192,6 +192,22 @@ def memory():
|
|
|
192
192
|
info(f'virtual memory: {format_file_size(virtual)}')
|
|
193
193
|
|
|
194
194
|
|
|
195
|
+
def license():
|
|
196
|
+
print(f'''
|
|
197
|
+
exprmat {ver_string} - Routines to manipulate expression matrices
|
|
198
|
+
Copyright (C) 2025 - 2026 Zheng Yang (杨政) <xornent@outlook.com>
|
|
199
|
+
|
|
200
|
+
exprmat is free software and comes with ABSOLUTELY NO WARRANTY.
|
|
201
|
+
You are welcome to redistribute it under certain conditions.
|
|
202
|
+
You should have received a copy of the GNU General Public License
|
|
203
|
+
version 3 along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
204
|
+
|
|
205
|
+
The GNU General Public License does not permit incorporating
|
|
206
|
+
your program into proprietary programs.
|
|
207
|
+
''')
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
195
211
|
setwd = os.chdir
|
|
196
212
|
getwd = os.getcwd
|
|
197
213
|
|
|
@@ -200,6 +216,17 @@ import tqdm
|
|
|
200
216
|
tqdm.tqdm(disable = True, total = 0)
|
|
201
217
|
|
|
202
218
|
|
|
219
|
+
# show version info after any install or update of the database.
|
|
220
|
+
# this always synchronizes with the package update.
|
|
221
|
+
|
|
222
|
+
try:
|
|
223
|
+
fd = os.open(os.path.join(basepath, '.license'), os.O_CREAT | os.O_EXCL | os.O_WRONLY)
|
|
224
|
+
with os.fdopen(fd, "w") as f: f.write("shown")
|
|
225
|
+
license()
|
|
226
|
+
|
|
227
|
+
except FileExistsError: pass
|
|
228
|
+
|
|
229
|
+
|
|
203
230
|
__all__ = [
|
|
204
231
|
# exposed external namespace
|
|
205
232
|
'np', 'mu', 'ad', 'sc', 'pd',
|
|
@@ -219,6 +246,7 @@ __all__ = [
|
|
|
219
246
|
'version_db'
|
|
220
247
|
'cuda',
|
|
221
248
|
'memory',
|
|
249
|
+
'license',
|
|
222
250
|
'setwd',
|
|
223
251
|
'getwd',
|
|
224
252
|
'pprog',
|
|
@@ -7,7 +7,48 @@ from functools import partial
|
|
|
7
7
|
from tqdm import tqdm
|
|
8
8
|
from tqdm.auto import tqdm as tqdma
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
class logger:
|
|
12
|
+
|
|
13
|
+
silent = False
|
|
14
|
+
|
|
15
|
+
def __init__(self, silent: bool = False) -> None:
|
|
16
|
+
self.silent = silent
|
|
17
|
+
|
|
18
|
+
def error(self, text: str, error = None) -> None:
|
|
19
|
+
|
|
20
|
+
if self.silent:
|
|
21
|
+
if error: raise Exception(text) from error
|
|
22
|
+
else: raise Exception(text)
|
|
23
|
+
|
|
24
|
+
fore_red()
|
|
25
|
+
print('[error]', end = ' ')
|
|
26
|
+
ansi_reset()
|
|
27
|
+
print(text)
|
|
28
|
+
|
|
29
|
+
if error is None: raise Exception(text)
|
|
30
|
+
else: raise Exception(text) from error
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def warning(self, text: str) -> None:
|
|
34
|
+
if self.silent: return
|
|
35
|
+
fore_yellow()
|
|
36
|
+
print('[!]', end = ' ')
|
|
37
|
+
ansi_reset()
|
|
38
|
+
print(text)
|
|
39
|
+
ansi_reset()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def info(self, text: str) -> None:
|
|
43
|
+
if self.silent: return
|
|
44
|
+
fore_cyan()
|
|
45
|
+
print('[i]', end = ' ')
|
|
46
|
+
ansi_reset()
|
|
47
|
+
print(text)
|
|
48
|
+
ansi_reset()
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
default_logger = logger()
|
|
11
52
|
|
|
12
53
|
|
|
13
54
|
def fore_black() -> None:
|
|
@@ -114,32 +155,15 @@ def format_file_size(size):
|
|
|
114
155
|
|
|
115
156
|
|
|
116
157
|
def error(text: str, error = None) -> None:
|
|
117
|
-
|
|
118
|
-
fore_red()
|
|
119
|
-
print('[error]', end = ' ')
|
|
120
|
-
ansi_reset()
|
|
121
|
-
print(text)
|
|
122
|
-
|
|
123
|
-
if error is None: raise Exception(text)
|
|
124
|
-
else: raise Exception(text) from error
|
|
158
|
+
default_logger.error(text, error)
|
|
125
159
|
|
|
126
160
|
|
|
127
161
|
def warning(text: str) -> None:
|
|
128
|
-
|
|
129
|
-
fore_yellow()
|
|
130
|
-
print('[!]', end = ' ')
|
|
131
|
-
ansi_reset()
|
|
132
|
-
print(text)
|
|
133
|
-
ansi_reset()
|
|
162
|
+
default_logger.warning(text)
|
|
134
163
|
|
|
135
164
|
|
|
136
165
|
def info(text: str) -> None:
|
|
137
|
-
|
|
138
|
-
fore_cyan()
|
|
139
|
-
print('[i]', end = ' ')
|
|
140
|
-
ansi_reset()
|
|
141
|
-
print(text)
|
|
142
|
-
ansi_reset()
|
|
166
|
+
default_logger.info(text)
|
|
143
167
|
|
|
144
168
|
|
|
145
169
|
def clear():
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
|
|
2
|
+
from exprmat import basepath
|
|
3
|
+
import pandas as pd
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def get_gene_regulatory_network(taxa):
|
|
8
|
+
return pd.read_feather(os.path.join(basepath, taxa, 'icnet', 'gene-regulatory.feather'))
|
|
9
|
+
|
|
10
|
+
def get_lr_network(taxa):
|
|
11
|
+
return pd.read_feather(os.path.join(basepath, taxa, 'icnet', 'ligand-receptors.feather'))
|
|
12
|
+
|
|
13
|
+
def get_signaling_network(taxa):
|
|
14
|
+
return pd.read_feather(os.path.join(basepath, taxa, 'icnet', 'signaling.feather'))
|
|
15
|
+
|
|
16
|
+
def get_gene_regulatory_weights(taxa, version = 'v2'):
|
|
17
|
+
return pd.read_feather(os.path.join(basepath, taxa, 'icnet', version, 'gene-regulatory.feather'))
|
|
18
|
+
|
|
19
|
+
def get_lr_weights(taxa, version = 'v2'):
|
|
20
|
+
return pd.read_feather(os.path.join(basepath, taxa, 'icnet', version, 'lr-significance.feather'))
|
|
21
|
+
|
|
22
|
+
def get_ligand_target_matrix(taxa, version = 'v2'):
|
|
23
|
+
return pd.read_feather(os.path.join(basepath, taxa, 'icnet', version, 'ligand-target.feather'))
|
|
24
|
+
|
|
25
|
+
def get_ligand_tf_matrix(taxa, version = 'v2'):
|
|
26
|
+
return pd.read_feather(os.path.join(basepath, taxa, 'icnet', version, 'ligand-tf.feather'))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_weighted_ligand_target_links(ligand, geneset, ligand_target_matrix, n = 250):
|
|
30
|
+
import numpy as np
|
|
31
|
+
ltm_series = ligand_target_matrix[ligand]
|
|
32
|
+
data = np.array(ltm_series.values)
|
|
33
|
+
flat = data.flatten('C')
|
|
34
|
+
indices = np.argsort(flat)[-n:]
|
|
35
|
+
|
|
36
|
+
# retrieve indices
|
|
37
|
+
# rows are targets and columns are ligands.
|
|
38
|
+
ligs = []
|
|
39
|
+
targs = []
|
|
40
|
+
weights = []
|
|
41
|
+
for i in indices:
|
|
42
|
+
row = i // len(ligand)
|
|
43
|
+
col = i % len(ligand)
|
|
44
|
+
target = ligand_target_matrix.index[row]
|
|
45
|
+
if target in geneset:
|
|
46
|
+
ligs.append(ligand[col])
|
|
47
|
+
targs.append(ligand_target_matrix.index[row])
|
|
48
|
+
weights.append(flat[i])
|
|
49
|
+
|
|
50
|
+
return pd.DataFrame({
|
|
51
|
+
'ligand': ligs,
|
|
52
|
+
'target': targs,
|
|
53
|
+
'weight': weights
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def get_weighted_ligand_receptor_links(
|
|
58
|
+
best_upstream_ligands, expressed_receptors,
|
|
59
|
+
lr_network, weighted_networks_lr_sig
|
|
60
|
+
):
|
|
61
|
+
lr_network = lr_network.drop_duplicates(subset = ['from', 'to'])
|
|
62
|
+
weighted_networks_lr = pd.merge(weighted_networks_lr_sig, lr_network, on = ['from', 'to'])
|
|
63
|
+
|
|
64
|
+
lr_network_top = lr_network[
|
|
65
|
+
(lr_network['from'].isin(best_upstream_ligands)) &
|
|
66
|
+
(lr_network['to'].isin(expressed_receptors))
|
|
67
|
+
].drop_duplicates(subset = ['from','to'])
|
|
68
|
+
best_upstream_receptors = lr_network_top['to'].unique()
|
|
69
|
+
|
|
70
|
+
lr_network_top_df_long = weighted_networks_lr[
|
|
71
|
+
(weighted_networks_lr['from'].isin(best_upstream_ligands)) &
|
|
72
|
+
(weighted_networks_lr['to'].isin(best_upstream_receptors))]
|
|
73
|
+
|
|
74
|
+
return lr_network_top_df_long
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
|
|
2
|
+
from exprmat.data.icnet import (
|
|
3
|
+
get_gene_regulatory_network,
|
|
4
|
+
get_gene_regulatory_weights,
|
|
5
|
+
get_ligand_target_matrix,
|
|
6
|
+
get_ligand_tf_matrix,
|
|
7
|
+
get_lr_network,
|
|
8
|
+
get_lr_weights,
|
|
9
|
+
get_signaling_network,
|
|
10
|
+
get_weighted_ligand_receptor_links,
|
|
11
|
+
get_weighted_ligand_target_links
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
from exprmat.lr.icnet.importance import predict_ligand_activities
|
|
15
|
+
from exprmat import info, error
|
|
16
|
+
import numpy as np
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def nichenet(
|
|
20
|
+
adata,
|
|
21
|
+
taxa,
|
|
22
|
+
receiver, # you must specify the receiver cells
|
|
23
|
+
sender = None,
|
|
24
|
+
identity = 'cell.type',
|
|
25
|
+
foreground = None,
|
|
26
|
+
background = None,
|
|
27
|
+
expression_threshold = 0.001,
|
|
28
|
+
ncpus = 1,
|
|
29
|
+
key_added = 'nichenet'
|
|
30
|
+
):
|
|
31
|
+
ltm = get_ligand_target_matrix(taxa)
|
|
32
|
+
|
|
33
|
+
if background:
|
|
34
|
+
background = list(set(background))
|
|
35
|
+
info(f'using user-specified background gene set of size {len(background)}')
|
|
36
|
+
|
|
37
|
+
else: background = adata.var['gene'].tolist()
|
|
38
|
+
background = list(set(background).intersection(set(ltm.index.tolist())))
|
|
39
|
+
info(f'background gene set constructed with size {len(background)}')
|
|
40
|
+
|
|
41
|
+
if foreground:
|
|
42
|
+
foreground = list(set(foreground))
|
|
43
|
+
info(f'using user-specified foreground gene set of size {len(foreground)}')
|
|
44
|
+
else: error('foreground gene set must be specified')
|
|
45
|
+
|
|
46
|
+
expressed_genes = adata.var['gene'].loc[
|
|
47
|
+
np.array((adata.X.sum(0) / adata.X.shape[0]) > expression_threshold)[0]].tolist()
|
|
48
|
+
rec = adata[[x in receiver for x in adata.obs[identity]], :]
|
|
49
|
+
target_expressed_genes = rec.var['gene'].loc[np.array(
|
|
50
|
+
(rec.X.sum(0) / rec.X.shape[0]) > expression_threshold)[0]].tolist()
|
|
51
|
+
|
|
52
|
+
lr_network = get_lr_network(taxa)
|
|
53
|
+
all_receptors = lr_network['to'].unique().tolist()
|
|
54
|
+
expressed_receptors = list(set(all_receptors).intersection(set(target_expressed_genes)))
|
|
55
|
+
potential_ligands = [x for x, y in zip(lr_network['from'], lr_network['to']) if y in expressed_genes]
|
|
56
|
+
|
|
57
|
+
if sender:
|
|
58
|
+
send = adata[[x in sender for x in adata.obs[identity]], :]
|
|
59
|
+
sender_expressed_genes = send.var['gene'].loc[np.array(
|
|
60
|
+
(send.X.sum(0) / send.X.shape[0]) > expression_threshold)[0]].tolist()
|
|
61
|
+
potential_ligands = list(set(potential_ligands).intersection(set(sender_expressed_genes)))
|
|
62
|
+
info(f'{len(potential_ligands)} potential ligands filtered by sender cells expression')
|
|
63
|
+
else:
|
|
64
|
+
potential_ligands = list(set(potential_ligands))
|
|
65
|
+
info(f'using {len(potential_ligands)}(all) potential ligands')
|
|
66
|
+
|
|
67
|
+
info(f'using {len(expressed_receptors)} expressed receptors in receivers')
|
|
68
|
+
|
|
69
|
+
ligact = predict_ligand_activities(
|
|
70
|
+
geneset = foreground,
|
|
71
|
+
background_expressed_genes = background,
|
|
72
|
+
ligand_target_matrix = ltm.values,
|
|
73
|
+
ligand_names = ltm.columns.tolist(),
|
|
74
|
+
target_names = ltm.index.tolist(),
|
|
75
|
+
potential_ligands = potential_ligands,
|
|
76
|
+
ncpus = ncpus
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
adata.uns[key_added] = {
|
|
80
|
+
'foreground': foreground,
|
|
81
|
+
'background': background,
|
|
82
|
+
'taxa': taxa,
|
|
83
|
+
'activities': ligact.sort_values(['aupr.adj'], ascending = False)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
pass
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def nichenet_infer_targets(adata, key_nichenet, ligands = 10, n_targets = 250):
|
|
90
|
+
|
|
91
|
+
nnet = adata.uns[key_nichenet]
|
|
92
|
+
ltm = get_ligand_target_matrix(nnet['taxa'])
|
|
93
|
+
ltl = get_weighted_ligand_target_links(
|
|
94
|
+
ligand = ligands if isinstance(ligands, list) else nnet['activities'].head(ligands)['ligand'].tolist(),
|
|
95
|
+
geneset = nnet['foreground'],
|
|
96
|
+
ligand_target_matrix = ltm,
|
|
97
|
+
n = n_targets
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
adata.uns[key_nichenet]['ligand_targets'] = ltl
|