exprmat 0.1.38__tar.gz → 0.1.40__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 (220) hide show
  1. {exprmat-0.1.38 → exprmat-0.1.40}/PKG-INFO +20 -4
  2. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/__init__.py +24 -9
  3. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/ansi.py +19 -0
  4. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/clustering/leiden.py +26 -8
  5. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/cnv/infercnv.py +10 -11
  6. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/configuration.py +9 -8
  7. exprmat-0.1.40/exprmat/data/cre.py +111 -0
  8. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/data/finders.py +16 -10
  9. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/data/geneset.py +4 -4
  10. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/descriptive/aucell.py +2 -2
  11. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/dynamics/parallel.py +7 -23
  12. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/grn/infergrn.py +3 -4
  13. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/utils.py +2 -4
  14. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/peaks/callpeak.py +131 -19
  15. exprmat-0.1.40/exprmat/peaks/coverage.py +159 -0
  16. exprmat-0.1.40/exprmat/peaks/footprint.py +152 -0
  17. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/peaks/idr/idr.py +0 -169
  18. exprmat-0.1.40/exprmat/peaks/linkage.py +534 -0
  19. exprmat-0.1.40/exprmat/peaks/motif.py +475 -0
  20. exprmat-0.1.40/exprmat/peaks/sequence.py +49 -0
  21. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/cnmf.py +11 -11
  22. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/cnv.py +3 -2
  23. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/gse.py +4 -3
  24. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/lr.py +3 -2
  25. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/palettes.py +81 -10
  26. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/sankey.py +2 -4
  27. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/track.py +190 -19
  28. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/utils.py +21 -8
  29. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/velocity.py +2 -1
  30. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/filter.py +7 -2
  31. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/linear.py +18 -5
  32. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/qc.py +2 -2
  33. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/sctransform/estimate.py +2 -2
  34. exprmat-0.1.40/exprmat/reader/conversions.py +85 -0
  35. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reader/experiment.py +341 -82
  36. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reader/matcher.py +7 -4
  37. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reader/spatial.py +2 -2
  38. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reader/static.py +219 -27
  39. exprmat-0.1.40/exprmat/reader/updater.py +83 -0
  40. exprmat-0.1.40/exprmat/reduction/__init__.py +234 -0
  41. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reduction/mde.py +16 -9
  42. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reduction/plot.py +6 -7
  43. exprmat-0.1.40/exprmat/reduction/scvi.py +85 -0
  44. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reduction/spectral.py +2 -3
  45. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/utils.py +84 -14
  46. {exprmat-0.1.38 → exprmat-0.1.40}/pyproject.toml +29 -5
  47. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/feature_count/mod.rs +3 -3
  48. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/genome.rs +2 -2
  49. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/preprocessing/import.rs +2 -2
  50. exprmat-0.1.38/exprmat/peaks/linkage.py +0 -19
  51. exprmat-0.1.38/exprmat/peaks/motif.py +0 -54
  52. exprmat-0.1.38/exprmat/peaks/sequence.py +0 -29
  53. exprmat-0.1.38/exprmat/reduction/__init__.py +0 -137
  54. {exprmat-0.1.38 → exprmat-0.1.40}/Cargo.lock +0 -0
  55. {exprmat-0.1.38 → exprmat-0.1.40}/Cargo.toml +0 -0
  56. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/clustering/__init__.py +0 -0
  57. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/clustering/cnmf.py +0 -0
  58. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/clustering/dbscan.py +0 -0
  59. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/clustering/kmeans.py +0 -0
  60. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/clustering/nmf.py +0 -0
  61. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/clustering/rogue.py +0 -0
  62. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/clustering/seriation.py +0 -0
  63. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/clustering/spectral.py +0 -0
  64. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/clustering/utils.py +0 -0
  65. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/cnv/__init__.py +0 -0
  66. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/cnv/cnvscore.py +0 -0
  67. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/data/__init__.py +0 -0
  68. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/data/cistarget.py +0 -0
  69. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/data/io.py +0 -0
  70. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/data/lr.py +0 -0
  71. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/data/presets.py +0 -0
  72. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/data/signature.py +0 -0
  73. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/data/tf.py +0 -0
  74. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/descriptive/__init__.py +0 -0
  75. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/descriptive/aggregate.py +0 -0
  76. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/descriptive/atac.py +0 -0
  77. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/descriptive/de.py +0 -0
  78. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/descriptive/gse.py +0 -0
  79. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/descriptive/kde.py +0 -0
  80. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/descriptive/recovery.py +0 -0
  81. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/descriptive/summary.py +0 -0
  82. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/descriptive/tcr.py +0 -0
  83. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/deseq/dataset.py +0 -0
  84. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/deseq/gridsearch.py +0 -0
  85. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/deseq/inference.py +0 -0
  86. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/deseq/preprocessing.py +0 -0
  87. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/deseq/stats.py +0 -0
  88. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/deseq/utils.py +0 -0
  89. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/dynamics/__init__.py +0 -0
  90. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/dynamics/generank.py +0 -0
  91. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/dynamics/linreg.py +0 -0
  92. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/dynamics/moments.py +0 -0
  93. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/dynamics/optimization.py +0 -0
  94. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/dynamics/preprocess.py +0 -0
  95. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/dynamics/pseudotime.py +0 -0
  96. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/dynamics/transition.py +0 -0
  97. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/dynamics/utils.py +0 -0
  98. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/dynamics/velocity.py +0 -0
  99. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/grn/__init__.py +0 -0
  100. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/grn/modules.py +0 -0
  101. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/grn/prune.py +0 -0
  102. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/grn/regressors.py +0 -0
  103. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/grn/utils.py +0 -0
  104. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/image/__init__.py +0 -0
  105. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/image/align.py +0 -0
  106. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/__init__.py +0 -0
  107. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/aggregate.py +0 -0
  108. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/method.py +0 -0
  109. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/methods/__init__.py +0 -0
  110. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/methods/cellchat.py +0 -0
  111. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/methods/cellphonedb.py +0 -0
  112. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/methods/connectome.py +0 -0
  113. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/methods/geomean.py +0 -0
  114. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/methods/logfc.py +0 -0
  115. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/methods/natmi.py +0 -0
  116. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/methods/rank_aggregate.py +0 -0
  117. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/methods/scseqcomm.py +0 -0
  118. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/methods/singlecellsignalr.py +0 -0
  119. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/pipeline.py +0 -0
  120. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/preprocess.py +0 -0
  121. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/lr/resources.py +0 -0
  122. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/peaks/__init__.py +0 -0
  123. /exprmat-0.1.38/exprmat/reader/peaks.py → /exprmat-0.1.40/exprmat/peaks/common.py +0 -0
  124. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/peaks/idr/__init__.py +0 -0
  125. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/peaks/idr/constants.py +0 -0
  126. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/peaks/idr/invcdf.pyx +0 -0
  127. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/peaks/idr/optimization.py +0 -0
  128. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/peaks/idr/utils.py +0 -0
  129. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/__init__.py +0 -0
  130. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/atac.py +0 -0
  131. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/A.pk +0 -0
  132. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/B.pk +0 -0
  133. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/C.pk +0 -0
  134. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/D.pk +0 -0
  135. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/E.pk +0 -0
  136. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/F.pk +0 -0
  137. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/G.pk +0 -0
  138. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/H.pk +0 -0
  139. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/I.pk +0 -0
  140. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/J.pk +0 -0
  141. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/K.pk +0 -0
  142. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/L.pk +0 -0
  143. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/M.pk +0 -0
  144. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/N.pk +0 -0
  145. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/O.pk +0 -0
  146. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/P.pk +0 -0
  147. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/Q.pk +0 -0
  148. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/R.pk +0 -0
  149. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/S.pk +0 -0
  150. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/T.pk +0 -0
  151. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/U.pk +0 -0
  152. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/V.pk +0 -0
  153. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/W.pk +0 -0
  154. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/X.pk +0 -0
  155. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/Y.pk +0 -0
  156. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/data/Z.pk +0 -0
  157. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/de.py +0 -0
  158. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/expression.py +0 -0
  159. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/sequence.py +0 -0
  160. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/plotting/summary.py +0 -0
  161. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/__init__.py +0 -0
  162. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/doublets/__init__.py +0 -0
  163. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/doublets/composite.py +0 -0
  164. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/doublets/scrublet.py +0 -0
  165. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/emptydrops.py +0 -0
  166. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/impute/__init__.py +0 -0
  167. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/impute/magic.py +0 -0
  168. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/integrate.py +0 -0
  169. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/normal.py +0 -0
  170. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/plot.py +0 -0
  171. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/sctransform/__init__.py +0 -0
  172. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/sctransform/ksmooth.py +0 -0
  173. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/sctransform/residual.py +0 -0
  174. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/sctransform/transform.py +0 -0
  175. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/sparse.py +0 -0
  176. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/preprocessing/uniform.py +0 -0
  177. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reader/__init__.py +0 -0
  178. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reader/metadata.py +0 -0
  179. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reduction/forceatlas.py +0 -0
  180. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reduction/nn.py +0 -0
  181. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reduction/outliers.py +0 -0
  182. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reduction/pca.py +0 -0
  183. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reduction/tsne.py +0 -0
  184. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/reduction/umap.py +0 -0
  185. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/trajectory/pcurve.py +0 -0
  186. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/transfer/__init__.py +0 -0
  187. {exprmat-0.1.38 → exprmat-0.1.40}/exprmat/transfer/atlas.py +0 -0
  188. {exprmat-0.1.38 → exprmat-0.1.40}/license +0 -0
  189. {exprmat-0.1.38 → exprmat-0.1.40}/readme.md +0 -0
  190. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/Cargo.toml +0 -0
  191. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/license +0 -0
  192. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/readme +0 -0
  193. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/src/call_peaks.rs +0 -0
  194. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/src/embedding.rs +0 -0
  195. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/src/export.rs +0 -0
  196. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/src/knn.rs +0 -0
  197. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/src/lib.rs +0 -0
  198. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/src/motif.rs +0 -0
  199. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/src/network.rs +0 -0
  200. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/src/preprocessing.rs +0 -0
  201. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/src/utils/anndata.rs +0 -0
  202. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2/src/utils.rs +0 -0
  203. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/Cargo.toml +0 -0
  204. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/embedding.rs +0 -0
  205. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/export.rs +0 -0
  206. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/feature_count/counter.rs +0 -0
  207. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/feature_count/data_iter.rs +0 -0
  208. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/feature_count/matrix.rs +0 -0
  209. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/lib.rs +0 -0
  210. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/motif.rs +0 -0
  211. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/network.rs +0 -0
  212. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/preprocessing/bam/flagstat.rs +0 -0
  213. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/preprocessing/bam/header.rs +0 -0
  214. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/preprocessing/bam/mark_duplicates.rs +0 -0
  215. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/preprocessing/bam.rs +0 -0
  216. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/preprocessing/mod.rs +0 -0
  217. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/preprocessing/qc.rs +0 -0
  218. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/utils/knn.rs +0 -0
  219. {exprmat-0.1.38 → exprmat-0.1.40}/snapatac2-core/src/utils/mod.rs +0 -0
  220. {exprmat-0.1.38 → exprmat-0.1.40}/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.38
3
+ Version: 0.1.40
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -42,7 +42,6 @@ Requires-Dist: metacells
42
42
  Requires-Dist: sh
43
43
  Requires-Dist: networkx
44
44
  Requires-Dist: palantir
45
- Requires-Dist: rich
46
45
  Requires-Dist: adjusttext
47
46
  Requires-Dist: h5py
48
47
  Requires-Dist: cytoolz
@@ -55,10 +54,9 @@ Requires-Dist: hdbscan
55
54
  Requires-Dist: graphtools
56
55
  Requires-Dist: bincsync>=0.3.0
57
56
  Requires-Dist: pybigwig
57
+ Requires-Dist: spatialdata
58
58
  Requires-Dist: loompy
59
- Requires-Dist: squidpy
60
59
  Requires-Dist: zarr
61
- Requires-Dist: spatialdata-io
62
60
  Requires-Dist: scikit-image
63
61
  Requires-Dist: spatial-image
64
62
  Requires-Dist: multiscale-spatial-image
@@ -74,11 +72,29 @@ Requires-Dist: formulaic>=1.0.2
74
72
  Requires-Dist: formulaic-contrasts>=0.2.0
75
73
  Requires-Dist: cython
76
74
  Requires-Dist: pyfastx
75
+ Requires-Dist: genomicranges
76
+ Requires-Dist: rustworkx
77
+ Requires-Dist: xgboost
78
+ Requires-Dist: dask-expr>=2.0
77
79
  Requires-Dist: sphinx ; extra == 'dev'
78
80
  Requires-Dist: twine ; extra == 'dev'
79
81
  Requires-Dist: ipykernel ; extra == 'dev'
80
82
  Requires-Dist: ipytree ; extra == 'dev'
83
+ Requires-Dist: cudf-cu12==25.8.* ; extra == 'cuda12'
84
+ Requires-Dist: dask-cudf-cu12==25.8.* ; extra == 'cuda12'
85
+ Requires-Dist: cuml-cu12==25.8.* ; extra == 'cuda12'
86
+ Requires-Dist: cugraph-cu12==25.8.* ; extra == 'cuda12'
87
+ Requires-Dist: nx-cugraph-cu12==25.8.* ; extra == 'cuda12'
88
+ Requires-Dist: cuxfilter-cu12==25.8.* ; extra == 'cuda12'
89
+ Requires-Dist: cucim-cu12==25.8.* ; extra == 'cuda12'
90
+ Requires-Dist: pylibraft-cu12==25.8.* ; extra == 'cuda12'
91
+ Requires-Dist: raft-dask-cu12==25.8.* ; extra == 'cuda12'
92
+ Requires-Dist: cuvs-cu12==25.8.* ; extra == 'cuda12'
93
+ Requires-Dist: nx-cugraph-cu12==25.8.* ; extra == 'cuda12'
94
+ Requires-Dist: cupy-cuda12x ; extra == 'cuda12'
95
+ Requires-Dist: rapids-singlecell ; extra == 'cuda12'
81
96
  Provides-Extra: dev
97
+ Provides-Extra: cuda12
82
98
  License-File: license
83
99
  Summary: exprmat: Routines for expression matrices
84
100
  Author-email: Zheng Yang <xornent@outlook.com>
@@ -1,10 +1,19 @@
1
1
 
2
+ # the file specification, defined as the earlieast version to handle
3
+ # current file standard. (revision number). specification versions are not
4
+ # continuous. historically taken [1, 39]
5
+
6
+ SPECIFICATION = 39
7
+
8
+ import importlib.metadata
9
+ ver_string = importlib.metadata.version("exprmat")
10
+ MAJOR, MINOR, REVISION = [int(x) for x in ver_string.split('.')]
11
+
2
12
  import os
3
13
  os.environ['OPENBLAS_NUM_THREADS'] = '1'
4
14
  os.environ['GOTO_NUM_THREADS'] = '1'
5
15
  os.environ['OMP_NUM_THREADS'] = '1'
6
16
 
7
- import importlib.metadata
8
17
  import mudata as mu
9
18
  import anndata as ad
10
19
  import scanpy as sc
@@ -56,9 +65,11 @@ except ImportError:
56
65
  info('compilation finished.')
57
66
 
58
67
 
59
- from exprmat.configuration import default as config
68
+ from exprmat.configuration import Configuration as configuration
60
69
  from exprmat.ansi import warning, info
61
70
 
71
+ config = configuration()
72
+
62
73
  mu.set_options(pull_on_update = False)
63
74
  Image.MAX_IMAGE_PIXELS = config['max.image']
64
75
 
@@ -98,9 +109,11 @@ basepath = config['data']
98
109
 
99
110
  # core method exports
100
111
  from exprmat.utils import setup_styles
112
+ from exprmat.ansi import error, warning, info, pprog, pproga
101
113
  from exprmat.reader.experiment import experiment, load_experiment
102
114
  from exprmat.reader.metadata import metadata, load_metadata
103
115
 
116
+
104
117
  setup_styles()
105
118
 
106
119
 
@@ -129,8 +142,8 @@ if PERFORM_DATABASE_CHECK:
129
142
 
130
143
 
131
144
  def cuda():
132
-
133
145
  import torch
146
+ from exprmat.utils import supports_tensorcore
134
147
  info(f'PyTorch version: {torch.__version__}')
135
148
  info(f'GPU acceleration availability: {"YES" if torch.cuda.is_available() else "NO"}')
136
149
  if torch.cuda.is_available():
@@ -144,7 +157,7 @@ def cuda():
144
157
  info(f'[{i}] {torch.cuda.get_device_name(i)} {"*" if torch.cuda.current_device() == i else ""}')
145
158
  info(f' CUDA capability: {torch.cuda.get_device_capability(i)}')
146
159
  info(f' Installed VRAM (GiB): {total_mem:.2f} GiB')
147
- info(f' Supporting TensorCore: {"YES" if torch.cuda.get_device_properties(0).major >= 7 else "NO"}')
160
+ info(f' Supporting TensorCore: {"YES" if supports_tensorcore() else "NO"}')
148
161
  info(f' Current dedicated memory: {dedicated_mem:.2f} / {total_mem:.2f} GiB ({100 * dedicated_mem / total_mem:.1f}%)')
149
162
 
150
163
 
@@ -154,10 +167,7 @@ def version():
154
167
  import platform
155
168
  from exprmat.ansi import info, error, format_file_size
156
169
 
157
- ver_string = importlib.metadata.version("exprmat")
158
170
  db_ver = version_db()
159
-
160
- MAJOR, MINOR, REVISION = [int(x) for x in ver_string.split('.')]
161
171
  info(f'exprmat {MAJOR}.{MINOR}.{REVISION} / exprmat-db {db_ver if db_ver is not None else "(Not installed)"}')
162
172
  info(f'os: {os.name} ({sys.platform}) platform version: {platform.release()}')
163
173
  info(f'loaded configuration from {finder}')
@@ -179,7 +189,6 @@ def memory():
179
189
 
180
190
  setwd = os.chdir
181
191
  getwd = os.getcwd
182
- def locate_data(dir): config.update_config('data', dir)
183
192
 
184
193
 
185
194
  __all__ = [
@@ -190,6 +199,12 @@ __all__ = [
190
199
  'load_metadata',
191
200
  'version',
192
201
  'memory',
202
+ 'cuda',
193
203
  'setwd',
194
- 'getwd'
204
+ 'getwd',
205
+ 'error',
206
+ 'warning',
207
+ 'info',
208
+ 'pprog',
209
+ 'pproga'
195
210
  ]
@@ -2,6 +2,12 @@
2
2
  import re
3
3
  import os
4
4
 
5
+ from functools import partial
6
+ from tqdm import tqdm
7
+ from tqdm.auto import tqdm as tqdma
8
+
9
+ SILENT = False
10
+
5
11
 
6
12
  def fore_black() -> None:
7
13
  print('\033[30m', end = '')
@@ -107,6 +113,7 @@ def format_file_size(size):
107
113
 
108
114
 
109
115
  def error(text: str, error = None) -> None:
116
+ if SILENT: raise Exception(text) from error
110
117
  fore_red()
111
118
  print('[error]', end = ' ')
112
119
  ansi_reset()
@@ -117,6 +124,7 @@ def error(text: str, error = None) -> None:
117
124
 
118
125
 
119
126
  def warning(text: str) -> None:
127
+ if SILENT: return
120
128
  fore_yellow()
121
129
  print('[!]', end = ' ')
122
130
  ansi_reset()
@@ -125,6 +133,7 @@ def warning(text: str) -> None:
125
133
 
126
134
 
127
135
  def info(text: str) -> None:
136
+ if SILENT: return
128
137
  fore_cyan()
129
138
  print('[i]', end = ' ')
130
139
  ansi_reset()
@@ -147,3 +156,13 @@ def yellow(x): return '\033[33m' + x + '\033[0m'
147
156
  def blue(x): return '\033[34m' + x + '\033[0m'
148
157
  def purple(x): return '\033[35m' + x + '\033[0m'
149
158
  def cyan(x): return '\033[36m' + x + '\033[0m'
159
+
160
+
161
+ progress_styles = {
162
+ 'ncols': 80,
163
+ 'ascii': '-━',
164
+ 'bar_format': ' {bar} {desc:20} {n:5d} / {total:<5d} ({elapsed} < {remaining})'
165
+ }
166
+
167
+ pprog = partial(tqdm, **progress_styles)
168
+ pproga = partial(tqdma, **progress_styles)
@@ -18,6 +18,8 @@ def leiden(
18
18
  neighbors_key: str | None = None,
19
19
  obsp: str | None = None,
20
20
  flavor = 'igraph',
21
+ use_gpu = False,
22
+ theta = 1,
21
23
  ** clustering_args,
22
24
  ) -> ad.AnnData | None:
23
25
  '''
@@ -86,11 +88,27 @@ def leiden(
86
88
  passes arguments to the `partition_type`) or `igraph.Graph.community_leiden` from `igraph`.
87
89
  '''
88
90
 
89
- return sc.tl.leiden(
90
- adata, resolution = resolution,
91
- restrict_to = restrict_to, random_state = random_state,
92
- key_added = key_added, adjacency = adjacency, directed = directed,
93
- use_weights = use_weights, n_iterations = n_iterations,
94
- partition_type = partition_type, neighbors_key = neighbors_key,
95
- copy = False, flavor = flavor, **clustering_args
96
- )
91
+ if use_gpu:
92
+ import rapids_singlecell as rsc
93
+ return rsc.tl.leiden(
94
+ adata, resolution = resolution,
95
+ restrict_to = restrict_to, random_state = random_state,
96
+ key_added = key_added, adjacency = adjacency,
97
+ use_weights = use_weights,
98
+ # the n_iterations in igraph takes -1, 0, 1 and 2 as magic numbers
99
+ # not real number of iterations. indeed, the gpu implementation
100
+ # supports only real iterations, by default 200.
101
+ n_iterations = n_iterations if n_iterations > 2 else 200,
102
+ neighbors_key = neighbors_key, theta = theta,
103
+ copy = False
104
+ )
105
+
106
+ else:
107
+ return sc.tl.leiden(
108
+ adata, resolution = resolution,
109
+ restrict_to = restrict_to, random_state = random_state,
110
+ key_added = key_added, adjacency = adjacency, directed = directed,
111
+ use_weights = use_weights, n_iterations = n_iterations,
112
+ partition_type = partition_type, neighbors_key = neighbors_key,
113
+ copy = False, flavor = flavor, **clustering_args
114
+ )
@@ -10,10 +10,9 @@ import scipy.ndimage
10
10
  import scipy.sparse
11
11
  from anndata import AnnData
12
12
  from scanpy import logging
13
- from tqdm.auto import tqdm
14
13
  from tqdm.contrib.concurrent import process_map
15
14
 
16
- from exprmat.ansi import error, warning, info
15
+ from exprmat.ansi import error, warning, info, pproga
17
16
  from exprmat.utils import ensure_array
18
17
 
19
18
 
@@ -80,7 +79,7 @@ def infercnv(
80
79
  exclude_chromosomes
81
80
  List of chromosomes to exclude. The default is to exclude genosomes.
82
81
  For list of all available chromosomes in the dataset, you should manually check
83
- the adata.var['.seqid'] column, when you are not using the pre-built genome annotations.
82
+ the adata.var['chr'] column, when you are not using the pre-built genome annotations.
84
83
 
85
84
  chunksize
86
85
  Process dataset in chunks of cells. This allows to run infercnv on
@@ -113,16 +112,16 @@ def infercnv(
113
112
 
114
113
  if not adata.var_names.is_unique:
115
114
  error('ensure your var_names are unique.')
116
- if {'.seqid', '.start', '.end'} - set(adata.var.columns) != set():
117
- warning('ensure your var table contains ".seqid", ".start", and ".end"')
115
+ if {'chr', 'start', 'end'} - set(adata.var.columns) != set():
116
+ warning('ensure your var table contains "chr", "start", and "end"')
118
117
  warning('this should be automatically queried for you if you specify a legal taxa name.')
119
118
  error('otherwise, you should parse the gff and configure these information yourself.')
120
119
 
121
- var_mask = adata.var['.seqid'].isnull()
120
+ var_mask = adata.var['chr'].isnull()
122
121
  if np.sum(var_mask):
123
122
  warning(f'skipped {np.sum(var_mask)} genes because they don\'t have a genomic position annotated.') # type: ignore
124
123
  if exclude_chromosomes is not None:
125
- var_mask = var_mask | adata.var['.seqid'].isin(exclude_chromosomes)
124
+ var_mask = var_mask | adata.var['chr'].isin(exclude_chromosomes)
126
125
 
127
126
  valid_annot_adata = adata[:, ~ var_mask]
128
127
  reference = get_reference_cells(adata, reference_key, reference_cat, reference)[:, ~ var_mask]
@@ -131,7 +130,7 @@ def infercnv(
131
130
  if scipy.sparse.issparse(expr):
132
131
  expr = expr.tocsr()
133
132
 
134
- var = valid_annot_adata.var.loc[:, ['.seqid', '.start', '.end']]
133
+ var = valid_annot_adata.var.loc[:, ['chr', 'start', 'end']]
135
134
  chr_pos, chunks, convolved_dfs = zip(
136
135
  *process_map(
137
136
  infercnv_proc,
@@ -143,7 +142,7 @@ def infercnv(
143
142
  itertools.repeat(step),
144
143
  itertools.repeat(dynamic_threshold),
145
144
  itertools.repeat(calculate_gene_values),
146
- tqdm_class=tqdm,
145
+ tqdm_class = pproga,
147
146
  max_workers=cpu_count() if n_jobs is None else n_jobs,
148
147
  ),
149
148
  strict=False,
@@ -341,7 +340,7 @@ def running_mean_by_chr(
341
340
  and genomic position. This is a row in the plotted chromosome CNV matrix.
342
341
  '''
343
342
 
344
- chromosomes = natural_sort([x for x in var['.seqid'].unique() if x != 'MT'])
343
+ chromosomes = natural_sort([x for x in var['chr'].unique() if x != 'MT'])
345
344
  running_means = [
346
345
  running_mean_chr(
347
346
  chr, expr, var, window_size, step, calculate_gene_values
@@ -361,7 +360,7 @@ def running_mean_by_chr(
361
360
 
362
361
  def running_mean_chr(chr, expr, var, window_size, step, calculate_gene_values):
363
362
 
364
- genes = var.loc[var['.seqid'] == chr].sort_values('.start').index.values
363
+ genes = var.loc[var['chr'] == chr].sort_values('start').index.values
365
364
  tmp_x = expr[:, var.index.get_indexer(genes)]
366
365
  x_conv, convolved_gene_values = running_mean(
367
366
  tmp_x, n = window_size, step = step,
@@ -17,25 +17,29 @@ class Configuration:
17
17
  'Ubuntu',
18
18
  'Verdana'
19
19
  ]
20
-
21
- self.config['backend'] = 'TkAgg'
20
+
21
+ self.config['plotting.flavor'] = 'light'
22
+ self.config['plotting.backend'] = 'TkAgg'
22
23
  self.config['data'] = os.path.join(os.path.dirname(__file__), 'data')
23
24
 
24
25
  # target taxa
25
26
 
26
27
  self.config['taxa.reference'] = {
27
- 'mm10': 'mmu', # alias of grcm38
28
+ 'mm10': 'mmu', # the slightly modified version from ucsc based on grcm38
28
29
  'grcm39': 'mmu',
29
30
  'grcm38': 'mmu',
30
31
 
31
- 'hg19': 'hsa', # alias of grch37
32
+ 'hg19': 'hsa', # the slightly modified version from ucsc based on grch37
32
33
  'grch37': 'hsa',
33
34
  'grch38': 'hsa',
35
+
36
+ 'dm6': 'dme'
34
37
  }
35
38
 
36
39
  self.config['default.assembly'] = {
37
40
  'mmu': 'grcm39',
38
- 'hsa': 'grch38'
41
+ 'hsa': 'grch38',
42
+ 'dme': 'dm6'
39
43
  }
40
44
 
41
45
  self.config['max.image'] = int(10000 * 50000)
@@ -53,6 +57,3 @@ class Configuration:
53
57
 
54
58
  def update_config(self, conf_name, value):
55
59
  self.config[conf_name] = value
56
-
57
-
58
- default = Configuration()
@@ -0,0 +1,111 @@
1
+
2
+ import os
3
+ import pandas as pd
4
+ import pickle
5
+ import numpy as np
6
+ import lightmotif
7
+
8
+ from exprmat.data.finders import basepath
9
+ from exprmat.ansi import error, warning, info
10
+
11
+ with open(os.path.join(basepath, 'shared', 'motifs.pkl'), 'rb') as f:
12
+ motif_tree = pickle.load(f)
13
+
14
+ pssm_table = {}
15
+ transcription_factor_bindings = {}
16
+ motif_subsets = {}
17
+
18
+
19
+ def get_motifs(subset = 'all'):
20
+ if subset == 'all': return motif_tree
21
+ elif subset in motif_subsets.keys(): return motif_subsets[subset]
22
+ else:
23
+ subtree = {}
24
+ for key in motif_tree.keys():
25
+ items = {}
26
+ for mot in motif_tree[key].keys():
27
+ if motif_tree[key][mot]['source'] == subset:
28
+ items[mot] = motif_tree[key][mot]
29
+ subtree[key] = items
30
+ motif_subsets[subset] = subtree
31
+ return motif_subsets[subset]
32
+
33
+
34
+ def get_transcription_factor_binding_motifs(taxa):
35
+
36
+ if not taxa in transcription_factor_bindings.keys():
37
+ transcription_factor_bindings[taxa] = \
38
+ pd.read_feather(os.path.join(basepath, taxa, 'tf', 'transcription-factors.feather'))
39
+
40
+ return transcription_factor_bindings[taxa]
41
+
42
+
43
+ def search_transcription_factor(taxa, factor, subset = 'all'):
44
+
45
+ tfbindings = get_transcription_factor_binding_motifs(taxa)
46
+ if factor in tfbindings['symbol'].tolist():
47
+ row = tfbindings['symbol'].tolist().index(factor)
48
+ row = tfbindings.iloc[row, :].copy()
49
+ metaclust = row['metacluster'].split(' ')
50
+ motifs = row['motif'].split(' ')
51
+
52
+ table = get_motifs(subset)
53
+ pairs = []
54
+ for mc in metaclust:
55
+ for mot in motifs:
56
+ if mot in table[mc].keys():
57
+ pairs.append((mc, mot))
58
+
59
+ return pairs
60
+
61
+ else: error(f'could not find transcription factor {factor} in taxa {taxa}.')
62
+
63
+
64
+ def plot_sequence_logo(motif, fig_height = 1, fig_width_per_base = 0.2, dpi = 100):
65
+
66
+ from exprmat.plotting.sequence import sequence_logo
67
+ motifs = get_motifs()
68
+ if isinstance(motif, tuple):
69
+ return sequence_logo(
70
+ np.array(motifs[motif[0]][motif[1]]['ppm'].T, dtype = np.float32),
71
+ ppm = True, y_format = 'bits', dpi = dpi,
72
+ fig_height = fig_height, fig_width_per_base = fig_width_per_base
73
+ )
74
+
75
+ elif isinstance(motif, str):
76
+ for mc in motifs.keys():
77
+ if motif in motifs[mc].keys():
78
+ return sequence_logo(
79
+ np.array(motifs[mc][motif]['ppm'].T, dtype = np.float32),
80
+ ppm = True, y_format = 'bits', dpi = dpi,
81
+ fig_height = fig_height, fig_width_per_base = fig_width_per_base
82
+ )
83
+
84
+
85
+ def motif_to_tuple(motif):
86
+ motifs = get_motifs()
87
+ for mc in motifs.keys():
88
+ if motif in motifs[mc].keys():
89
+ return (mc, motif)
90
+ error(f'could not find motif {motif}')
91
+
92
+
93
+ def to_pssm(motif, eps = 0.01):
94
+
95
+ if isinstance(motif, str): motif = motif_to_tuple(motif)
96
+ if motif[1] in pssm_table.keys(): return pssm_table[motif[1]]
97
+
98
+ motifs = get_motifs()
99
+ integral = np.array(motifs[motif[0]][motif[1]]['ppm'].T * 100000, dtype = np.int32)
100
+
101
+ # original order: acgt.
102
+ pwm = lightmotif.CountMatrix({
103
+ 'A': integral[:, 0].tolist(),
104
+ 'C': integral[:, 1].tolist(),
105
+ 'T': integral[:, 3].tolist(),
106
+ 'G': integral[:, 2].tolist(),
107
+ }).normalize(eps)
108
+
109
+ pssm = pwm.log_odds()
110
+ pssm_table[motif[1]] = pssm
111
+ return pssm
@@ -3,7 +3,7 @@ import os
3
3
  import pandas
4
4
  from exprmat import basepath
5
5
  from exprmat.ansi import warning, info
6
- from exprmat.configuration import default as cfg
6
+ from exprmat import config as cfg
7
7
 
8
8
  genome = {}
9
9
 
@@ -28,23 +28,28 @@ def get_genome(taxa):
28
28
 
29
29
  if taxa not in genome.keys(): genome[taxa] = {}
30
30
  if 'genes' in genome[taxa].keys(): return genome[taxa]['genes']
31
- genome[taxa]['genes'] = pandas.read_table(
32
- os.path.join(basepath, f'{taxa}', 'genome.tsv.gz'),
33
- # set low memory to false to allow correct adjustment to mixed dtype.
34
- index_col = '.ugene', dtype = {'.seqid': str}, low_memory = False
31
+ genome[taxa]['genes'] = pandas.read_feather(
32
+ os.path.join(basepath, f'{taxa}', 'genome.feather')
35
33
  )
36
34
 
35
+ genome[taxa]['genes'].index = genome[taxa]['genes']['uid'].tolist()
37
36
  return genome[taxa]['genes']
38
37
 
39
38
 
40
- def get_genome_size(assembly):
39
+ def get_genome_size(assembly, as_dataframe = False):
41
40
 
42
41
  import json
43
42
  taxa = cfg['taxa.reference'][assembly.lower()]
44
43
  path = os.path.join(basepath, taxa, 'assemblies', assembly.lower(), 'size.json')
45
44
  with open(path, 'r', encoding = 'utf-8') as f:
46
45
  sizes = json.load(f)
47
- return sizes
46
+
47
+ if as_dataframe: return pandas.DataFrame({
48
+ 'seqname': sizes.keys(),
49
+ 'len': [sizes[k] for k in sizes.keys()]
50
+ })
51
+
52
+ else: return sizes
48
53
 
49
54
 
50
55
  def get_genome_gff_fname(assembly):
@@ -80,12 +85,13 @@ def get_genome_ranges(assembly, fname, as_grange = False):
80
85
  taxa = cfg['taxa.reference'][assembly.lower()]
81
86
  path = os.path.join(basepath, taxa, 'assemblies', assembly.lower(), f'{fname}.feather')
82
87
  feather = pandas.read_feather(path)
88
+ feather = feather.loc[feather['end'] - feather['start'] > 0, :].copy()
83
89
 
84
90
  if as_grange:
85
91
  import genomicranges
86
92
  return genomicranges.GenomicRanges.from_pandas(
87
- feather[['ucsc', 'start', 'end', 'strand', 'gene']].rename(
88
- columns = {'ucsc': 'seqnames', 'start': 'starts', 'end': 'ends'}
93
+ feather[['chr', 'start', 'end', 'strand', 'gene']].rename(
94
+ columns = {'chr': 'seqnames', 'start': 'starts', 'end': 'ends'}
89
95
  ))
90
96
  else: return feather
91
97
 
@@ -185,7 +191,7 @@ def get_mapper_ensembl(taxa):
185
191
  else:
186
192
 
187
193
  gtable = get_genome(taxa)
188
- ensembl_list = gtable[['ensembl']].values.transpose()[0].tolist()
194
+ ensembl_list = gtable[['id']].values.transpose()[0].tolist()
189
195
  id_list = gtable.index.tolist()
190
196
  ensembl_finder = {}
191
197
 
@@ -4,7 +4,7 @@ import pandas
4
4
  import numpy as np
5
5
 
6
6
  from exprmat.ansi import warning, info
7
- from exprmat.configuration import default as cfg
7
+ from exprmat import config as cfg
8
8
  from exprmat.data.finders import basepath, genome, get_genome
9
9
 
10
10
 
@@ -59,13 +59,13 @@ def translate_id(taxa, genes, idfrom = 'entrez', idto = 'ugene', keep_nones = Tr
59
59
 
60
60
  # construct multi-platform convertion table.
61
61
  gtable = get_genome(taxa)
62
- gtable = gtable[['ensembl', 'gene']].copy()
62
+ gtable = gtable[['id', 'gene']].copy()
63
63
  gtable['ugene'] = gtable.index.tolist()
64
- gtable.index = gtable['ensembl'].tolist()
64
+ gtable.index = gtable['id'].tolist()
65
65
  gtable['uppercase'] = gtable['gene'].str.upper().tolist()
66
66
 
67
67
  # deduplicate
68
- gtable = gtable.loc[~ gtable['ensembl'].duplicated(), :].copy()
68
+ gtable = gtable.loc[~ gtable['id'].duplicated(), :].copy()
69
69
  gtable['ugene'] = taxa + ':' + gtable['ugene']
70
70
 
71
71
  entrez = pandas.read_table(
@@ -9,7 +9,7 @@ import numpy as np
9
9
  import pandas as pd
10
10
  from boltons.iterutils import chunked
11
11
  from exprmat.descriptive.recovery import enrich_cells
12
- from rich.progress import track
12
+ from exprmat import pprog
13
13
 
14
14
  # to reduce the memory footprint of a ranking matrix we use unsigned 32bit
15
15
  # integers which provides a range from 0 through 4,294,967,295. this should be
@@ -96,7 +96,7 @@ def aucell4r(
96
96
  module.noweights() if noweights else module,
97
97
  auc_threshold = auc_threshold,
98
98
  )
99
- for module in track(signatures, description = 'auc')
99
+ for module in pprog(signatures, desc = 'auc')
100
100
  ]
101
101
  ).unstack("regulon")
102
102
  aucs.columns = aucs.columns.droplevel(0)
@@ -3,11 +3,10 @@ import os
3
3
  from multiprocessing import Manager
4
4
  from threading import Thread
5
5
  from joblib import delayed, Parallel
6
- from rich.progress import TextColumn, BarColumn, TimeRemainingColumn, TimeElapsedColumn
7
6
 
8
7
  import numpy as np
9
8
  from scipy.sparse import issparse, spmatrix
10
- from exprmat.ansi import error, warning, info
9
+ from exprmat.ansi import error, warning, info, pprog
11
10
 
12
11
 
13
12
  def get_n_jobs(n_jobs):
@@ -67,10 +66,10 @@ def parallelize(
67
66
  Whether to show a progress bar.
68
67
  """
69
68
 
70
- if show_progress_bar: from rich.progress import Progress as progress
69
+ if show_progress_bar: progress = pprog
71
70
  else: progress = None
72
71
 
73
- def update(pbar, task, queue, n_total):
72
+ def update(pbar, queue, n_total):
74
73
 
75
74
  n_finished = 0
76
75
  while n_finished < n_total:
@@ -83,32 +82,17 @@ def parallelize(
83
82
  assert res in (None, (1, None), 1) # (None, 1) means only 1 job
84
83
  if res == (1, None):
85
84
  n_finished += 1
86
- if pbar is not None: pbar.advance(task, advance = 1)
85
+ if pbar is not None: pbar.update(1)
87
86
  elif res is None: n_finished += 1
88
- elif pbar is not None: pbar.advance(task, advance = 1)
89
-
90
- if pbar is not None:
91
- pbar.stop()
87
+ elif pbar is not None: pbar.update(1)
92
88
 
93
89
 
94
90
  def wrapper(*args, **kwargs):
95
91
 
96
92
  if pass_queue and show_progress_bar:
97
- pbar = None if progress is None else progress(
98
- TextColumn("[progress.description]"),
99
- BarColumn(),
100
- TextColumn("[progress.percentage]{task.percentage:>4.1f}%"),
101
- TimeRemainingColumn(),
102
- TimeElapsedColumn()
103
- )
104
-
105
- pbartask = None
106
- if pbar is not None:
107
- pbartask = pbar.add_task(description = "", total = col_len)
108
- pbar.start()
109
-
93
+ pbar = None if progress is None else progress(total = col_len)
110
94
  queue = Manager().Queue()
111
- thread = Thread(target = update, args = (pbar, pbartask, queue, len(collections)))
95
+ thread = Thread(target = update, args = (pbar, queue, len(collections)))
112
96
  thread.start()
113
97
 
114
98
  else: pbar, queue, thread = None, None, None