exprmat 0.1.40__tar.gz → 0.1.42__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.
Files changed (218) hide show
  1. {exprmat-0.1.40 → exprmat-0.1.42}/PKG-INFO +1 -1
  2. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/ansi.py +6 -4
  3. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/linear.py +3 -1
  4. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/qc.py +4 -4
  5. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reader/experiment.py +65 -16
  6. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reader/matcher.py +4 -4
  7. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reader/static.py +9 -3
  8. exprmat-0.1.42/exprmat/reader/updater.py +111 -0
  9. exprmat-0.1.42/exprmat/reduction/diffmap.py +73 -0
  10. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reduction/plot.py +8 -2
  11. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reduction/scvi.py +19 -21
  12. {exprmat-0.1.40 → exprmat-0.1.42}/pyproject.toml +1 -1
  13. exprmat-0.1.40/exprmat/reader/updater.py +0 -83
  14. {exprmat-0.1.40 → exprmat-0.1.42}/Cargo.lock +0 -0
  15. {exprmat-0.1.40 → exprmat-0.1.42}/Cargo.toml +0 -0
  16. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/__init__.py +0 -0
  17. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/clustering/__init__.py +0 -0
  18. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/clustering/cnmf.py +0 -0
  19. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/clustering/dbscan.py +0 -0
  20. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/clustering/kmeans.py +0 -0
  21. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/clustering/leiden.py +0 -0
  22. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/clustering/nmf.py +0 -0
  23. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/clustering/rogue.py +0 -0
  24. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/clustering/seriation.py +0 -0
  25. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/clustering/spectral.py +0 -0
  26. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/clustering/utils.py +0 -0
  27. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/cnv/__init__.py +0 -0
  28. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/cnv/cnvscore.py +0 -0
  29. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/cnv/infercnv.py +0 -0
  30. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/configuration.py +0 -0
  31. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/data/__init__.py +0 -0
  32. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/data/cistarget.py +0 -0
  33. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/data/cre.py +0 -0
  34. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/data/finders.py +0 -0
  35. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/data/geneset.py +0 -0
  36. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/data/io.py +0 -0
  37. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/data/lr.py +0 -0
  38. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/data/presets.py +0 -0
  39. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/data/signature.py +0 -0
  40. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/data/tf.py +0 -0
  41. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/descriptive/__init__.py +0 -0
  42. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/descriptive/aggregate.py +0 -0
  43. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/descriptive/atac.py +0 -0
  44. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/descriptive/aucell.py +0 -0
  45. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/descriptive/de.py +0 -0
  46. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/descriptive/gse.py +0 -0
  47. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/descriptive/kde.py +0 -0
  48. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/descriptive/recovery.py +0 -0
  49. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/descriptive/summary.py +0 -0
  50. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/descriptive/tcr.py +0 -0
  51. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/deseq/dataset.py +0 -0
  52. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/deseq/gridsearch.py +0 -0
  53. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/deseq/inference.py +0 -0
  54. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/deseq/preprocessing.py +0 -0
  55. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/deseq/stats.py +0 -0
  56. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/deseq/utils.py +0 -0
  57. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/dynamics/__init__.py +0 -0
  58. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/dynamics/generank.py +0 -0
  59. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/dynamics/linreg.py +0 -0
  60. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/dynamics/moments.py +0 -0
  61. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/dynamics/optimization.py +0 -0
  62. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/dynamics/parallel.py +0 -0
  63. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/dynamics/preprocess.py +0 -0
  64. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/dynamics/pseudotime.py +0 -0
  65. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/dynamics/transition.py +0 -0
  66. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/dynamics/utils.py +0 -0
  67. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/dynamics/velocity.py +0 -0
  68. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/grn/__init__.py +0 -0
  69. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/grn/infergrn.py +0 -0
  70. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/grn/modules.py +0 -0
  71. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/grn/prune.py +0 -0
  72. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/grn/regressors.py +0 -0
  73. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/grn/utils.py +0 -0
  74. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/image/__init__.py +0 -0
  75. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/image/align.py +0 -0
  76. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/__init__.py +0 -0
  77. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/aggregate.py +0 -0
  78. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/method.py +0 -0
  79. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/methods/__init__.py +0 -0
  80. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/methods/cellchat.py +0 -0
  81. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/methods/cellphonedb.py +0 -0
  82. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/methods/connectome.py +0 -0
  83. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/methods/geomean.py +0 -0
  84. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/methods/logfc.py +0 -0
  85. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/methods/natmi.py +0 -0
  86. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/methods/rank_aggregate.py +0 -0
  87. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/methods/scseqcomm.py +0 -0
  88. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/methods/singlecellsignalr.py +0 -0
  89. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/pipeline.py +0 -0
  90. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/preprocess.py +0 -0
  91. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/resources.py +0 -0
  92. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/lr/utils.py +0 -0
  93. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/__init__.py +0 -0
  94. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/callpeak.py +0 -0
  95. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/common.py +0 -0
  96. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/coverage.py +0 -0
  97. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/footprint.py +0 -0
  98. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/idr/__init__.py +0 -0
  99. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/idr/constants.py +0 -0
  100. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/idr/idr.py +0 -0
  101. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/idr/invcdf.pyx +0 -0
  102. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/idr/optimization.py +0 -0
  103. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/idr/utils.py +0 -0
  104. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/linkage.py +0 -0
  105. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/motif.py +0 -0
  106. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/peaks/sequence.py +0 -0
  107. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/__init__.py +0 -0
  108. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/atac.py +0 -0
  109. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/cnmf.py +0 -0
  110. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/cnv.py +0 -0
  111. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/A.pk +0 -0
  112. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/B.pk +0 -0
  113. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/C.pk +0 -0
  114. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/D.pk +0 -0
  115. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/E.pk +0 -0
  116. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/F.pk +0 -0
  117. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/G.pk +0 -0
  118. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/H.pk +0 -0
  119. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/I.pk +0 -0
  120. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/J.pk +0 -0
  121. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/K.pk +0 -0
  122. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/L.pk +0 -0
  123. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/M.pk +0 -0
  124. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/N.pk +0 -0
  125. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/O.pk +0 -0
  126. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/P.pk +0 -0
  127. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/Q.pk +0 -0
  128. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/R.pk +0 -0
  129. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/S.pk +0 -0
  130. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/T.pk +0 -0
  131. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/U.pk +0 -0
  132. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/V.pk +0 -0
  133. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/W.pk +0 -0
  134. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/X.pk +0 -0
  135. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/Y.pk +0 -0
  136. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/data/Z.pk +0 -0
  137. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/de.py +0 -0
  138. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/expression.py +0 -0
  139. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/gse.py +0 -0
  140. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/lr.py +0 -0
  141. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/palettes.py +0 -0
  142. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/sankey.py +0 -0
  143. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/sequence.py +0 -0
  144. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/summary.py +0 -0
  145. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/track.py +0 -0
  146. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/utils.py +0 -0
  147. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/plotting/velocity.py +0 -0
  148. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/__init__.py +0 -0
  149. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/doublets/__init__.py +0 -0
  150. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/doublets/composite.py +0 -0
  151. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/doublets/scrublet.py +0 -0
  152. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/emptydrops.py +0 -0
  153. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/filter.py +0 -0
  154. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/impute/__init__.py +0 -0
  155. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/impute/magic.py +0 -0
  156. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/integrate.py +0 -0
  157. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/normal.py +0 -0
  158. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/plot.py +0 -0
  159. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/sctransform/__init__.py +0 -0
  160. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/sctransform/estimate.py +0 -0
  161. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/sctransform/ksmooth.py +0 -0
  162. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/sctransform/residual.py +0 -0
  163. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/sctransform/transform.py +0 -0
  164. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/sparse.py +0 -0
  165. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/preprocessing/uniform.py +0 -0
  166. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reader/__init__.py +0 -0
  167. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reader/conversions.py +0 -0
  168. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reader/metadata.py +0 -0
  169. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reader/spatial.py +0 -0
  170. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reduction/__init__.py +0 -0
  171. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reduction/forceatlas.py +0 -0
  172. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reduction/mde.py +0 -0
  173. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reduction/nn.py +0 -0
  174. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reduction/outliers.py +0 -0
  175. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reduction/pca.py +0 -0
  176. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reduction/spectral.py +0 -0
  177. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reduction/tsne.py +0 -0
  178. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/reduction/umap.py +0 -0
  179. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/trajectory/pcurve.py +0 -0
  180. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/transfer/__init__.py +0 -0
  181. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/transfer/atlas.py +0 -0
  182. {exprmat-0.1.40 → exprmat-0.1.42}/exprmat/utils.py +0 -0
  183. {exprmat-0.1.40 → exprmat-0.1.42}/license +0 -0
  184. {exprmat-0.1.40 → exprmat-0.1.42}/readme.md +0 -0
  185. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/Cargo.toml +0 -0
  186. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/license +0 -0
  187. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/readme +0 -0
  188. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/src/call_peaks.rs +0 -0
  189. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/src/embedding.rs +0 -0
  190. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/src/export.rs +0 -0
  191. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/src/knn.rs +0 -0
  192. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/src/lib.rs +0 -0
  193. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/src/motif.rs +0 -0
  194. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/src/network.rs +0 -0
  195. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/src/preprocessing.rs +0 -0
  196. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/src/utils/anndata.rs +0 -0
  197. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2/src/utils.rs +0 -0
  198. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/Cargo.toml +0 -0
  199. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/embedding.rs +0 -0
  200. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/export.rs +0 -0
  201. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/feature_count/counter.rs +0 -0
  202. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/feature_count/data_iter.rs +0 -0
  203. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/feature_count/matrix.rs +0 -0
  204. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/feature_count/mod.rs +0 -0
  205. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/genome.rs +0 -0
  206. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/lib.rs +0 -0
  207. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/motif.rs +0 -0
  208. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/network.rs +0 -0
  209. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/preprocessing/bam/flagstat.rs +0 -0
  210. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/preprocessing/bam/header.rs +0 -0
  211. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/preprocessing/bam/mark_duplicates.rs +0 -0
  212. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/preprocessing/bam.rs +0 -0
  213. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/preprocessing/import.rs +0 -0
  214. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/preprocessing/mod.rs +0 -0
  215. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/preprocessing/qc.rs +0 -0
  216. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/utils/knn.rs +0 -0
  217. {exprmat-0.1.40 → exprmat-0.1.42}/snapatac2-core/src/utils/mod.rs +0 -0
  218. {exprmat-0.1.40 → exprmat-0.1.42}/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.40
3
+ Version: 0.1.42
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -1,6 +1,7 @@
1
1
 
2
2
  import re
3
3
  import os
4
+ import sys
4
5
 
5
6
  from functools import partial
6
7
  from tqdm import tqdm
@@ -91,12 +92,12 @@ def common_length(string: str, limit: int) -> str:
91
92
  return x_str
92
93
 
93
94
  elif len(string) + cn_length > limit:
94
- x_str = string[-(limit - 4):]
95
+ x_str = string[-(limit - 3):]
95
96
  cn = len(re.findall(cn_re, x_str))
96
- while cn + len(x_str) > limit - 4:
97
+ while cn + len(x_str) > limit - 3:
97
98
  x_str = x_str[1:]
98
99
  cn = len(re.findall(cn_re, x_str))
99
- return '... ' + x_str
100
+ return '.. ' + x_str
100
101
 
101
102
  else: return ('{:<' + str(limit - cn_length) + '}').format(string)
102
103
 
@@ -161,7 +162,8 @@ def cyan(x): return '\033[36m' + x + '\033[0m'
161
162
  progress_styles = {
162
163
  'ncols': 80,
163
164
  'ascii': '-━',
164
- 'bar_format': ' {bar} {desc:20} {n:5d} / {total:<5d} ({elapsed} < {remaining})'
165
+ 'bar_format': ' {bar} {desc:20} {n:5d} / {total:<5d} ({elapsed} < {remaining})',
166
+ 'file': sys.stderr
165
167
  }
166
168
 
167
169
  pprog = partial(tqdm, **progress_styles)
@@ -68,7 +68,9 @@ def normalize_total(
68
68
  if target_total is None:
69
69
  target_total = np.mean(tots_use)
70
70
 
71
- b = np.array(float(target_total) / tots_use.T)[0]
71
+ b = np.array(float(target_total) / tots_use.T)
72
+ if len(b.shape) == 2: b = b[0]
73
+
72
74
  if not sp.issparse(E):
73
75
  # this will densify the matrix, causing incredibly large memory comsumption
74
76
  # when treating with an sparse matrix.
@@ -129,9 +129,9 @@ def rna_qc(
129
129
  elif outlier_mode == 'tukey':
130
130
  umi_lower, umi_upper = tukey(adata.obs['n.umi'].to_numpy(), n = outlier_n)
131
131
  elif isinstance(outlier_mode, int):
132
- umi_lower, umi_upper = 200, 100000
132
+ umi_lower, umi_upper = 200, 2147483646
133
133
  max_genes = outlier_mode
134
- else: umi_lower, umi_upper = 200, 100000
134
+ else: umi_lower, umi_upper = 200, 2147483646
135
135
 
136
136
  f_obs = \
137
137
  (adata.obs['n.umi'] <= umi_upper) & \
@@ -152,10 +152,10 @@ def rna_qc(
152
152
 
153
153
  doublet_failed = False
154
154
  if doublet_method == 'scrublet':
155
- try:
155
+ # try:
156
156
  scrublet_init(subset, random_state = 42)
157
157
  scrublet(subset)
158
- except: doublet_failed = True
158
+ # except: doublet_failed = True
159
159
 
160
160
  adata.obs['filter'] = f_obs
161
161
  adata.obs['score.doublet'] = 0.0
@@ -25,11 +25,11 @@ import os
25
25
  from exprmat.reader.metadata import metadata, load_metadata
26
26
  from exprmat.data.finders import get_genome
27
27
  from exprmat.reader.matcher import (
28
- read_mtx_rna, read_h5ad_rna, read_table_rna,
28
+ read_mtx_rna, read_h5ad_rna, read_table_rna, read_h5_rna,
29
29
  parse_tcr_10x, attach_splice_reads_mtx, attach_splice_reads_loom
30
30
  )
31
31
  from exprmat.reader.matcher import attach_tcr
32
- from exprmat.ansi import warning, info, error, red, green
32
+ from exprmat.ansi import warning, info, error, red, green, pprog
33
33
  from exprmat import config as cfg
34
34
  import exprmat.reader.static as st
35
35
  import exprmat as em
@@ -44,10 +44,6 @@ class experiment:
44
44
  dump = '.', subset = None,
45
45
  version = em.SPECIFICATION
46
46
  ):
47
-
48
- from exprmat.reader.updater import update
49
- version = update(meta, modalities, mudata, version)
50
-
51
47
  # TODO: we support rna only at present.
52
48
  table = meta.dataframe.to_dict(orient = 'list')
53
49
  self.mudata = mudata
@@ -100,21 +96,41 @@ class experiment:
100
96
  # we automatically infer from the given location names to select
101
97
  # the correct way of loading samples:
102
98
 
103
- if i_loc.endswith('.tsv.gz') or i_loc.endswith('.csv.gz') or \
104
- i_loc.endswith('.tsv') or i_loc.endswith('.csv'):
99
+ if i_loc.endswith('.tsv.gz') or i_loc.endswith('.tsv'):
105
100
 
106
101
  self.modalities['rna'][i_sample] = read_table_rna(
107
102
  src = i_loc, metadata = meta, sample = i_sample,
108
- raw = False, default_taxa = i_taxa, eccentric = eccentric
103
+ raw = False, default_taxa = i_taxa, eccentric = eccentric, sep = '\t'
104
+ )
105
+
106
+ elif i_loc.endswith('.csv.gz') or i_loc.endswith('.csv'):
107
+
108
+ self.modalities['rna'][i_sample] = read_table_rna(
109
+ src = i_loc, metadata = meta, sample = i_sample,
110
+ raw = False, default_taxa = i_taxa, eccentric = eccentric, sep = ','
111
+ )
112
+
113
+ elif i_loc.endswith('.ssv.gz') or i_loc.endswith('.ssv'):
114
+
115
+ self.modalities['rna'][i_sample] = read_table_rna(
116
+ src = i_loc, metadata = meta, sample = i_sample,
117
+ raw = False, default_taxa = i_taxa, eccentric = eccentric, sep = ' '
109
118
  )
110
119
 
111
- elif i_loc.endswith('.h5') or i_loc.endswith('.h5ad'):
120
+ elif i_loc.endswith('.h5ad'):
112
121
 
113
122
  self.modalities['rna'][i_sample] = read_h5ad_rna(
114
123
  src = i_loc, metadata = meta, sample = i_sample,
115
124
  raw = False, default_taxa = i_taxa
116
125
  )
117
126
 
127
+ elif i_loc.endswith('.h5'):
128
+
129
+ self.modalities['rna'][i_sample] = read_h5_rna(
130
+ src = i_loc, metadata = meta, sample = i_sample,
131
+ raw = False, default_taxa = i_taxa, eccentric = eccentric
132
+ )
133
+
118
134
  else:
119
135
  self.modalities['rna'][i_sample] = read_mtx_rna(
120
136
  src = i_loc, prefix = '', metadata = meta, sample = i_sample,
@@ -265,6 +281,15 @@ class experiment:
265
281
  else: warning(f'sample {i_sample} have no supported modalities')
266
282
 
267
283
 
284
+ self.metadata.dataframe = self.metadata.dataframe.loc[
285
+ self.metadata.dataframe['modality'] != 'rna.splicing', :
286
+ ].copy()
287
+
288
+ self.metadata.dataframe = self.metadata.dataframe.loc[
289
+ self.metadata.dataframe['modality'] != 'rna.tcr', :
290
+ ].copy()
291
+
292
+
268
293
  # attaching bulk datasets.
269
294
 
270
295
  for i_mod in ['rna-bulk', 'atac-bulk']:
@@ -894,6 +919,8 @@ class experiment:
894
919
  p.imap_unordered(partial_task, args),
895
920
  total = len(args), desc = 'processing anndata'
896
921
  ))
922
+
923
+ p.close()
897
924
 
898
925
  results = {}
899
926
  for data, key, out in output:
@@ -1434,6 +1461,9 @@ class experiment:
1434
1461
 
1435
1462
  def run_rna_umap(self, run_on_samples = False, **kwargs):
1436
1463
  self.do_for_rna(run_on_samples, st.rna_umap, **kwargs)
1464
+
1465
+ def run_rna_diffmap(self, run_on_samples = False, **kwargs):
1466
+ self.do_for_rna(run_on_samples, st.rna_diffmap, **kwargs)
1437
1467
 
1438
1468
  def run_rna_mde(self, run_on_samples = False, **kwargs):
1439
1469
  self.do_for_rna(run_on_samples, st.rna_mde, **kwargs)
@@ -2292,7 +2322,7 @@ class experiment:
2292
2322
 
2293
2323
  def __repr__(self):
2294
2324
 
2295
- from exprmat.ansi import green, cyan, red, yellow
2325
+ from exprmat.ansi import green, cyan, red, yellow, common_length
2296
2326
 
2297
2327
  def print_anndata(adata: ad.AnnData):
2298
2328
  print(yellow('annotated data'), 'of size', adata.n_obs, '×', adata.n_vars)
@@ -2376,6 +2406,7 @@ class experiment:
2376
2406
  print(red('[*]'), 'composed of samples:')
2377
2407
  len_mod = 2
2378
2408
  len_batch = 2
2409
+ len_sample = 2
2379
2410
 
2380
2411
  for i_loc, i_sample, i_batch, i_grp, i_mod, i_taxa in zip(
2381
2412
  self.metadata.dataframe['location'],
@@ -2387,6 +2418,10 @@ class experiment:
2387
2418
  ):
2388
2419
  if len(i_mod) > len_mod: len_mod = len(i_mod)
2389
2420
  if len(i_batch) > len_batch: len_batch = len(i_batch)
2421
+ if len(i_sample) > len_sample: len_sample = len(i_sample)
2422
+
2423
+ if len_batch > 30: len_batch = 30
2424
+ if len_sample > 30: len_sample = 30
2390
2425
 
2391
2426
  for i_loc, i_sample, i_batch, i_grp, i_mod, i_taxa in zip(
2392
2427
  self.metadata.dataframe['location'],
@@ -2406,8 +2441,12 @@ class experiment:
2406
2441
  p_sample = i_sample if len(i_sample) < 30 else i_sample[:27] + ' ..'
2407
2442
  p_batch = i_batch if len(i_batch) < 30 else i_batch[:27] + ' ..'
2408
2443
  print(
2409
- f' {p_sample:30}', cyan(f'{i_mod:13}'), yellow(f'{i_taxa:4}'),
2410
- f'batch {green(f"{p_batch:12}")}',
2444
+ ' ',
2445
+ common_length(i_sample, len_sample), ' ',
2446
+ cyan(common_length(i_mod, len_mod)),
2447
+ yellow(f'{i_taxa:4}'), ' ',
2448
+ f'batch {green(common_length(i_batch, len_batch))}', ' ',
2449
+ 'of size',
2411
2450
  red('dataset not loaded') if not loaded else
2412
2451
  f'{green(str(self.modalities[i_mod][i_sample].n_obs))} × ' +
2413
2452
  f'{yellow(str(self.modalities[i_mod][i_sample].n_vars))}'
@@ -2439,9 +2478,22 @@ def load_experiment(direc, load_samples = True, load_subset = None):
2439
2478
  # read individual modality and sample
2440
2479
  meta = load_metadata(os.path.join(direc, 'metadata.tsv'))
2441
2480
 
2481
+ # load specification
2482
+ version = load_experiment_specification(direc)
2483
+
2484
+ # update the object to the newest version
2485
+ from exprmat.reader.updater import update
2486
+ version = update(meta, direc, version)
2487
+
2488
+ meta.dataframe = meta.dataframe.loc[
2489
+ ['.' not in x for x in meta.dataframe['modality']], :
2490
+ ].copy()
2491
+
2442
2492
  modalities = {}
2443
2493
  if load_samples:
2494
+ prog = pprog(desc = 'loading samples', total = len(meta.dataframe['sample']))
2444
2495
  for modal, samp in zip(meta.dataframe['modality'], meta.dataframe['sample']):
2496
+ prog.update()
2445
2497
  if '.' in modal: continue
2446
2498
  attempt = os.path.join(direc, modal, samp + '.h5ad')
2447
2499
  if os.path.exists(attempt):
@@ -2459,9 +2511,6 @@ def load_experiment(direc, load_samples = True, load_subset = None):
2459
2511
  if os.path.exists(os.path.join(direc, 'subsets', load_subset + '.h5mu')):
2460
2512
  mdata = mu.read_h5mu(os.path.join(direc, 'subsets', load_subset + '.h5mu'))
2461
2513
 
2462
- # load specification
2463
- version = load_experiment_specification(direc)
2464
-
2465
2514
  expr = experiment(
2466
2515
  meta = meta,
2467
2516
  mudata = mdata,
@@ -310,7 +310,7 @@ def read_mtx_rna(
310
310
 
311
311
 
312
312
  def read_h5_rna(
313
- path: str,
313
+ src: str,
314
314
  metadata: metadata, sample: str, raw: bool = False,
315
315
  default_taxa = 'mmu', eccentric = None, suppress_filter = False,
316
316
  ):
@@ -318,7 +318,7 @@ def read_h5_rna(
318
318
  warnings.filterwarnings('ignore')
319
319
 
320
320
  adata = sc.read_10x_h5(
321
- path, gex_only = True
321
+ src, gex_only = True
322
322
  )
323
323
 
324
324
  adata.var_names = adata.var['gene_ids'].tolist()
@@ -346,7 +346,7 @@ def read_h5_rna(
346
346
  def read_table_rna(
347
347
  src: str,
348
348
  metadata: metadata, sample: str, raw: bool = False,
349
- default_taxa = 'mmu', eccentric = None
349
+ default_taxa = 'mmu', eccentric = None, sep = '\t'
350
350
  ):
351
351
  '''
352
352
  Read from compressed or plain text tables.
@@ -374,7 +374,7 @@ def read_table_rna(
374
374
 
375
375
  # in csv/tsv texts, genes are rows and cells are columns.
376
376
  adata = sc.read_text(
377
- src, delimiter = '\t', first_column_names = True, dtype = 'float32'
377
+ src, delimiter = sep, first_column_names = True, dtype = 'float32'
378
378
  ).T
379
379
 
380
380
  if eccentric is not None:
@@ -182,16 +182,17 @@ def rna_scvi(
182
182
  # save the model
183
183
  import os
184
184
  if sample_name == 'integrated':
185
- attempt = os.path.join(savepath, 'scvi')
186
- else: attempt = os.path.join(savepath, 'rna', 'scvi', sample_name)
185
+ attempt = os.path.join(savepath, 'scvi', key_added)
186
+ else: attempt = os.path.join(savepath, 'rna', 'scvi', sample_name, key_added)
187
187
 
188
188
  os.makedirs(attempt, exist_ok = True)
189
189
  model.save(attempt, overwrite = True)
190
190
  adata.obsm[key_added] = latent
191
191
 
192
192
  adata.uns[key_added] = {
193
- 'model': savepath,
193
+ 'model': attempt,
194
194
  'n_latent': n_comps,
195
+ 'batch_key': batch,
195
196
  'type': 'scvi'
196
197
  }
197
198
 
@@ -232,6 +233,11 @@ def rna_umap(adata, sample_name, **kwargs):
232
233
  run_umap(adata, **kwargs)
233
234
 
234
235
 
236
+ def rna_diffmap(adata, sample_name, **kwargs):
237
+ from exprmat.reduction.diffmap import run_diffmap
238
+ run_diffmap(adata, **kwargs)
239
+
240
+
235
241
  def rna_mde(adata, sample_name, data = 'pca', key_added = 'mde', **kwargs):
236
242
  from exprmat.reduction.mde import mde
237
243
  emb = mde(adata.obsm[data], **kwargs)
@@ -0,0 +1,111 @@
1
+
2
+ import os
3
+ import h5py
4
+ from anndata.io import read_elem, write_elem
5
+
6
+ import exprmat as em
7
+ from exprmat.ansi import error, warning, info
8
+
9
+ VERSION_CHECKPOINT = [1, em.SPECIFICATION]
10
+
11
+
12
+ def update(meta, dump, version):
13
+
14
+ # current version
15
+ if version == em.SPECIFICATION: return version
16
+
17
+ # valid version
18
+ elif version in VERSION_CHECKPOINT:
19
+ ckpt = VERSION_CHECKPOINT.index(version)
20
+ for taskid in range(ckpt, len(VERSION_CHECKPOINT) - 1):
21
+ task = UPDATE_TASK[taskid]
22
+ info(f'updating experiment dump from {version} to {VERSION_CHECKPOINT[taskid + 1]} ...')
23
+
24
+ # update samples
25
+ for irow in range(len(meta.dataframe)):
26
+ metadata = meta.dataframe.iloc[irow, :].copy()
27
+ if '.' in metadata['modality']: continue
28
+ info(f'updating sample ./{metadata["modality"]}/{metadata["sample"]} ...')
29
+ task(metadata['modality'], os.path.join(dump, metadata["modality"], metadata["sample"] + '.h5ad'))
30
+
31
+ # update subsets
32
+ if os.path.exists(os.path.join(dump, 'subsets')):
33
+ for subset in os.listdir(os.path.join(dump, 'subsets')):
34
+ if not subset.endswith('.h5mu'): continue
35
+ if subset.startswith('.'): continue
36
+ info(f'updating subset {subset.replace(".h5mu", "")} ...')
37
+ task('subset', os.path.join(dump, 'subsets', subset))
38
+
39
+ if os.path.exists(os.path.join(dump, 'integrated.h5mu')):
40
+ info(f'updating integrated dataset ...')
41
+ task('integrated', os.path.join(dump, 'integrated.h5mu'))
42
+
43
+
44
+ return VERSION_CHECKPOINT[taskid + 1]
45
+
46
+ # invalid version
47
+ else: error(f'illegal version specification of experiment dump: [{version}]')
48
+
49
+
50
+ def update_39(mod, fpath):
51
+
52
+ def update_rna_var(table):
53
+ if 'ensembl' in table.columns:
54
+ import pandas as pd
55
+ obsn = table[['ensembl']].copy()
56
+ taxa = obsn.index.tolist()[0].split(':')[1]
57
+ from exprmat.data.finders import get_genome
58
+ gtable = get_genome(taxa)
59
+ gtable.index = gtable['id'].tolist()
60
+ obsn = obsn.join(gtable, on = 'ensembl', how = 'left')
61
+ assert len(obsn) == len(table)
62
+ del obsn['ensembl']
63
+
64
+ old_columns = [
65
+ '.seqid', '.source', '.type', '.start', '.end', '.score', '.strand', '.phase',
66
+ 'biotype', 'source', 'gene', 'description', 'ensembl', 'uid', 'version', 'len.mean',
67
+ 'len.median', 'len.cds', '.ucsc'
68
+ ]
69
+
70
+ for o in old_columns:
71
+ if o in table.columns: del table[o]
72
+ return pd.concat([obsn, table], axis = 1)
73
+
74
+ def update_atac_var(table):
75
+ return table.rename(columns = {
76
+ '.seqid': 'chr',
77
+ '.start': 'start',
78
+ '.end': 'end',
79
+ }, inplace = False)
80
+
81
+
82
+ file = h5py.File(fpath, 'r+')
83
+
84
+ if mod in ['subset', 'integrated']:
85
+ for m in list(file['mod'].keys()):
86
+ if m in ['rna', 'rnasp-b', 'rnasp-c', 'rnasp-s', 'atac-g']:
87
+ table = read_elem(file['mod'][m]['var'])
88
+ table = update_rna_var(table)
89
+ write_elem(file['mod'][m], 'var', table)
90
+
91
+ elif m in ['atac', 'atac-p']:
92
+ table = read_elem(file['mod'][m]['var'])
93
+ table = update_atac_var(table)
94
+ write_elem(file['mod'][m], 'var', table)
95
+
96
+ if mod in ['rna', 'rnasp-b', 'rnasp-c', 'rnasp-s', 'atac-g']:
97
+ table = read_elem(file['var'])
98
+ table = update_rna_var(table)
99
+ write_elem(file, 'var', table)
100
+
101
+ elif mod in ['atac', 'atac-p']:
102
+ table = read_elem(file['var'])
103
+ table = update_atac_var(table)
104
+ write_elem(file, 'var', table)
105
+
106
+ file.close()
107
+
108
+
109
+ UPDATE_TASK = [
110
+ update_39
111
+ ]
@@ -0,0 +1,73 @@
1
+
2
+
3
+ def run_diffmap(
4
+ adata, *, neighbors_key = None, key_added = 'diffmap',
5
+ n_comps = 3, sort = 'decrease', density_normalize = True,
6
+ use_gpu = False
7
+ ):
8
+
9
+ if use_gpu:
10
+
11
+ import cupy as cp
12
+ from cupyx.scipy import sparse
13
+ from cupyx.scipy.sparse import linalg
14
+ from scipy.sparse import issparse
15
+
16
+ if neighbors_key:
17
+ connectivities = adata.obsp[adata.uns[neighbors_key]['connectivities_key']]
18
+ else: connectivities = adata.obsp["connectivities"]
19
+
20
+ if issparse(connectivities):
21
+ W = sparse.csr_matrix(connectivities, dtype = cp.float32)
22
+ else: W = cp.asarray(connectivities)
23
+
24
+ if density_normalize:
25
+ # q[i] is an estimate for the sampling density at point i
26
+ # it's also the degree of the underlying graph
27
+ q = cp.asarray(W.sum(axis=0))
28
+ if not sparse.issparse(W): Q = cp.diag(1.0 / q)
29
+ else: Q = sparse.spdiags(1.0 / q, 0, W.shape[0], W.shape[0])
30
+ K = Q @ W @ Q
31
+
32
+ else: K = W
33
+
34
+ # z[i] is the square root of the row sum of K
35
+ z = cp.sqrt(cp.asarray(K.sum(axis=0)))
36
+
37
+ if not sparse.issparse(K): Z = cp.diag(1.0 / z)
38
+ else: Z = sparse.spdiags(1.0 / z, 0, K.shape[0], K.shape[0])
39
+ matrix = Z @ K @ Z
40
+
41
+ if n_comps == 0: evals, evecs = linalg.eigsh(matrix)
42
+
43
+ else:
44
+ n_comps = min(matrix.shape[0] - 1, n_comps)
45
+ # ncv = max(2 * n_comps + 1, int(np.sqrt(matrix.shape[0])))
46
+ ncv = None
47
+ which = "LM" if sort == "decrease" else "SM"
48
+ # it pays off to increase the stability with a bit more precision
49
+ matrix = matrix.astype(cp.float64)
50
+ evals, evecs = linalg.eigsh(matrix, k=n_comps, which=which, ncv=ncv)
51
+ evals, evecs = evals.astype(cp.float32), evecs.astype(cp.float32)
52
+
53
+ if sort == "decrease":
54
+ evals = evals[::-1]
55
+ evecs = evecs[:, ::-1]
56
+
57
+ adata.uns[key_added] = evals.get()
58
+ adata.obsm[key_added] = evecs.get()
59
+ del W, Q, Z, K, evals, evecs, matrix, z
60
+
61
+ else:
62
+
63
+ import scanpy as sc
64
+ sc.tl.diffmap(
65
+ adata, n_comps = n_comps,
66
+ neighbors_key = neighbors_key
67
+ )
68
+
69
+ adata.obsm[key_added] = adata.obsm['X_diffmap']
70
+ del adata.obsm['X_diffmap']
71
+
72
+ adata.uns[key_added] = adata.uns['diffmap_evals']
73
+ del adata.uns['diffmap_evals']
@@ -58,6 +58,7 @@ class index_object_handler:
58
58
 
59
59
  def embedding_atlas(
60
60
  adata, basis, color,
61
+ embedding_dims = [0, 1],
61
62
  hue_order = None,
62
63
  title = None, figsize = (4, 4), ax = None,
63
64
  cmap = 'turbo', cmap_reverse = False, cmap_lower = '#000000',
@@ -76,6 +77,10 @@ def embedding_atlas(
76
77
 
77
78
  cvs = ds.Canvas(plot_width = int(figsize[0] * dpi * res_factor), plot_height = int(figsize[1] * dpi * res_factor))
78
79
  embedding = adata.obsm[basis]
80
+ if isinstance(embedding, pd.DataFrame):
81
+ embedding = embedding.iloc[:, embedding_dims].copy()
82
+ else: embedding = embedding[:, embedding_dims].copy()
83
+
79
84
  df = pd.DataFrame(embedding, columns=['x', 'y'])
80
85
 
81
86
  if color in adata.obs.columns:
@@ -287,7 +292,7 @@ def embedding_atlas(
287
292
 
288
293
  def embedding(
289
294
  adata, basis, color,
290
- slot = 'X',
295
+ slot = 'X', embedding_dims = [0, 1],
291
296
 
292
297
  # query plotting options
293
298
  ptsize = 8,
@@ -343,7 +348,8 @@ def embedding(
343
348
  embedding = basis.data
344
349
  elif isinstance(basis, np.matrix) or isinstance(basis, np.ndarray):
345
350
  embedding = basis
346
-
351
+
352
+ embedding = embedding[:, embedding_dims].copy()
347
353
  df = pd.DataFrame(embedding, columns = ['x', 'y'])
348
354
 
349
355
  if color in adata.obs.columns:
@@ -57,29 +57,27 @@ def scvi(
57
57
  )
58
58
 
59
59
  import warnings
60
- import contextlib
61
60
  with warnings.catch_warnings():
62
61
  warnings.simplefilter('ignore')
63
- with contextlib.redirect_stderr(None):
64
- model.train(
65
- max_epochs = max_epochs,
66
- accelerator = accelerator,
67
- devices = devices,
68
- train_size = train_size,
69
- validation_size = validation_size,
70
- shuffle_set_split = shuffle_set_split,
71
- load_sparse_tensor = load_sparse_tensor,
72
- batch_size = batch_size,
73
- early_stopping = early_stopping,
74
- datasplitter_kwargs = datasplitter_kwargs,
75
- plan_kwargs = plan_kwargs,
76
- datamodule = datamodule,
77
- enable_progress_bar = enable_progress_bar,
78
- progress_bar_refresh_rate = progress_bar_refresh_rate,
79
- simple_progress_bar = simple_progress_bar,
80
- logger = logger,
81
- log_every_n_steps = log_every_n_steps,
82
- )
62
+ model.train(
63
+ max_epochs = max_epochs,
64
+ accelerator = accelerator,
65
+ devices = devices,
66
+ train_size = train_size,
67
+ validation_size = validation_size,
68
+ shuffle_set_split = shuffle_set_split,
69
+ load_sparse_tensor = load_sparse_tensor,
70
+ batch_size = batch_size,
71
+ early_stopping = early_stopping,
72
+ datasplitter_kwargs = datasplitter_kwargs,
73
+ plan_kwargs = plan_kwargs,
74
+ datamodule = datamodule,
75
+ enable_progress_bar = enable_progress_bar,
76
+ progress_bar_refresh_rate = progress_bar_refresh_rate,
77
+ simple_progress_bar = simple_progress_bar,
78
+ logger = logger,
79
+ log_every_n_steps = log_every_n_steps,
80
+ )
83
81
 
84
82
  latent = model.get_latent_representation()
85
83
  return model, latent
@@ -20,7 +20,7 @@ description = "exprmat: Routines for expression matrices"
20
20
  readme = "readme.md"
21
21
  license = {file = "license"}
22
22
  requires-python = ">=3.9, <3.13"
23
- version = "0.1.40"
23
+ version = "0.1.42"
24
24
  authors = [
25
25
  {name = "Zheng Yang", email = "xornent@outlook.com"}
26
26
  ]