singlet 0.4__tar.gz → 1.2.0__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 (444) hide show
  1. singlet-1.2.0/LICENSE +21 -0
  2. singlet-1.2.0/MANIFEST.in +31 -0
  3. singlet-1.2.0/PKG-INFO +277 -0
  4. singlet-1.2.0/README.md +183 -0
  5. singlet-1.2.0/include/singlet/pileup/pz_reader.h +757 -0
  6. singlet-1.2.0/include/singlet/pileup/pz_writer.h +752 -0
  7. singlet-1.2.0/include/singlet/pz2/detail/api.h +675 -0
  8. singlet-1.2.0/include/singlet/pz2/detail/codec2.h +89 -0
  9. singlet-1.2.0/include/singlet/pz2/detail/common.h +144 -0
  10. singlet-1.2.0/include/singlet/pz2/detail/container.h +156 -0
  11. singlet-1.2.0/include/singlet/pz2/detail/isa.h +139 -0
  12. singlet-1.2.0/include/singlet/pz2/detail/rans1.h +290 -0
  13. singlet-1.2.0/include/singlet/pz2/detail/rans1_avx2.h +275 -0
  14. singlet-1.2.0/include/singlet/pz2/detail/rans1_avx512.h +253 -0
  15. singlet-1.2.0/include/singlet/pz2/detail/rans1_dec.h +239 -0
  16. singlet-1.2.0/include/singlet/pz2/detail/rans1_enc.h +351 -0
  17. singlet-1.2.0/include/singlet/pz2/detail/sha256.h +153 -0
  18. singlet-1.2.0/include/singlet/pz2/detail/simd.h +27 -0
  19. singlet-1.2.0/include/singlet/pz2/detail/values.h +68 -0
  20. singlet-1.2.0/include/singlet/pz2/pz2.h +402 -0
  21. singlet-1.2.0/pyproject.toml +162 -0
  22. singlet-1.2.0/python/README.md +206 -0
  23. singlet-1.2.0/python/singlet/__init__.py +505 -0
  24. singlet-1.2.0/python/singlet/__main__.py +76 -0
  25. singlet-1.2.0/python/singlet/_aggregate.py +79 -0
  26. singlet-1.2.0/python/singlet/_ambient_rna_score.py +143 -0
  27. singlet-1.2.0/python/singlet/_annotate.py +49 -0
  28. singlet-1.2.0/python/singlet/_annotate_cell_types.py +141 -0
  29. singlet-1.2.0/python/singlet/_augur_prioritize.py +201 -0
  30. singlet-1.2.0/python/singlet/_auth.py +48 -0
  31. singlet-1.2.0/python/singlet/_batch_evaluation.py +236 -0
  32. singlet-1.2.0/python/singlet/_catalog.py +712 -0
  33. singlet-1.2.0/python/singlet/_cca.py +326 -0
  34. singlet-1.2.0/python/singlet/_cell_communication.py +300 -0
  35. singlet-1.2.0/python/singlet/_cell_cycle.py +184 -0
  36. singlet-1.2.0/python/singlet/_cell_cycle_regression.py +161 -0
  37. singlet-1.2.0/python/singlet/_cell_distances.py +150 -0
  38. singlet-1.2.0/python/singlet/_cell_level_de.py +180 -0
  39. singlet-1.2.0/python/singlet/_cell_type_proportions.py +112 -0
  40. singlet-1.2.0/python/singlet/_cluster_stability.py +196 -0
  41. singlet-1.2.0/python/singlet/_coexpression_modules.py +239 -0
  42. singlet-1.2.0/python/singlet/_combat.py +192 -0
  43. singlet-1.2.0/python/singlet/_composition_analysis.py +282 -0
  44. singlet-1.2.0/python/singlet/_concat.py +174 -0
  45. singlet-1.2.0/python/singlet/_connectivity_score.py +134 -0
  46. singlet-1.2.0/python/singlet/_consensus_clustering.py +215 -0
  47. singlet-1.2.0/python/singlet/_correlation.py +131 -0
  48. singlet-1.2.0/python/singlet/_cross_species_correlation.py +172 -0
  49. singlet-1.2.0/python/singlet/_cv_resolution.py +90 -0
  50. singlet-1.2.0/python/singlet/_de.py +260 -0
  51. singlet-1.2.0/python/singlet/_dendrogram.py +129 -0
  52. singlet-1.2.0/python/singlet/_denoise.py +102 -0
  53. singlet-1.2.0/python/singlet/_describe.py +90 -0
  54. singlet-1.2.0/python/singlet/_differential_abundance.py +410 -0
  55. singlet-1.2.0/python/singlet/_differential_test.py +220 -0
  56. singlet-1.2.0/python/singlet/_diffmap.py +89 -0
  57. singlet-1.2.0/python/singlet/_doublet_score_hybrid.py +235 -0
  58. singlet-1.2.0/python/singlet/_downsample.py +90 -0
  59. singlet-1.2.0/python/singlet/_dpt.py +79 -0
  60. singlet-1.2.0/python/singlet/_draw_graph.py +165 -0
  61. singlet-1.2.0/python/singlet/_embedding_density.py +95 -0
  62. singlet-1.2.0/python/singlet/_enrichr.py +195 -0
  63. singlet-1.2.0/python/singlet/_entropy_score.py +143 -0
  64. singlet-1.2.0/python/singlet/_export_df.py +146 -0
  65. singlet-1.2.0/python/singlet/_fate_probabilities.py +261 -0
  66. singlet-1.2.0/python/singlet/_filter.py +170 -0
  67. singlet-1.2.0/python/singlet/_filter_de.py +120 -0
  68. singlet-1.2.0/python/singlet/_find_all_markers.py +328 -0
  69. singlet-1.2.0/python/singlet/_gene_activity_score.py +141 -0
  70. singlet-1.2.0/python/singlet/_gene_correlation_network.py +186 -0
  71. singlet-1.2.0/python/singlet/_gene_importance.py +163 -0
  72. singlet-1.2.0/python/singlet/_gene_module_score.py +205 -0
  73. singlet-1.2.0/python/singlet/_gene_set_enrichment.py +203 -0
  74. singlet-1.2.0/python/singlet/_gene_set_variation.py +314 -0
  75. singlet-1.2.0/python/singlet/_gene_space_embedding.py +147 -0
  76. singlet-1.2.0/python/singlet/_gene_trend_clustering.py +190 -0
  77. singlet-1.2.0/python/singlet/_harmony.py +352 -0
  78. singlet-1.2.0/python/singlet/_hotspot_genes.py +224 -0
  79. singlet-1.2.0/python/singlet/_hvg.py +157 -0
  80. singlet-1.2.0/python/singlet/_hvg_cell_ranger.py +131 -0
  81. singlet-1.2.0/python/singlet/_hvg_seurat.py +197 -0
  82. singlet-1.2.0/python/singlet/_ica.py +125 -0
  83. singlet-1.2.0/python/singlet/_identify_bipotent_cells.py +151 -0
  84. singlet-1.2.0/python/singlet/_infer_grn.py +238 -0
  85. singlet-1.2.0/python/singlet/_ingest.py +146 -0
  86. singlet-1.2.0/python/singlet/_integrity.py +191 -0
  87. singlet-1.2.0/python/singlet/_io.py +315 -0
  88. singlet-1.2.0/python/singlet/_knn_impute.py +126 -0
  89. singlet-1.2.0/python/singlet/_leiden.py +191 -0
  90. singlet-1.2.0/python/singlet/_loader.py +1211 -0
  91. singlet-1.2.0/python/singlet/_louvain.py +79 -0
  92. singlet-1.2.0/python/singlet/_magic.py +154 -0
  93. singlet-1.2.0/python/singlet/_marker_overlap.py +89 -0
  94. singlet-1.2.0/python/singlet/_marker_specificity.py +214 -0
  95. singlet-1.2.0/python/singlet/_metacell.py +135 -0
  96. singlet-1.2.0/python/singlet/_metrics.py +119 -0
  97. singlet-1.2.0/python/singlet/_mnn.py +159 -0
  98. singlet-1.2.0/python/singlet/_morans_i.py +189 -0
  99. singlet-1.2.0/python/singlet/_multiome_factor_analysis.py +165 -0
  100. singlet-1.2.0/python/singlet/_neighbors.py +143 -0
  101. singlet-1.2.0/python/singlet/_nmf.py +94 -0
  102. singlet-1.2.0/python/singlet/_nmf_serve.py +21 -0
  103. singlet-1.2.0/python/singlet/_normalize.py +109 -0
  104. singlet-1.2.0/python/singlet/_optimal_transport.py +162 -0
  105. singlet-1.2.0/python/singlet/_paga.py +124 -0
  106. singlet-1.2.0/python/singlet/_palantir_pseudotime.py +225 -0
  107. singlet-1.2.0/python/singlet/_pca.py +134 -0
  108. singlet-1.2.0/python/singlet/_perturbation_signature.py +167 -0
  109. singlet-1.2.0/python/singlet/_phate.py +209 -0
  110. singlet-1.2.0/python/singlet/_phenograph.py +312 -0
  111. singlet-1.2.0/python/singlet/_plot.py +459 -0
  112. singlet-1.2.0/python/singlet/_plot_embedding.py +273 -0
  113. singlet-1.2.0/python/singlet/_plot_genes_in_groups.py +170 -0
  114. singlet-1.2.0/python/singlet/_plot_heatmap.py +178 -0
  115. singlet-1.2.0/python/singlet/_plot_markers.py +218 -0
  116. singlet-1.2.0/python/singlet/_plot_matrix.py +169 -0
  117. singlet-1.2.0/python/singlet/_plot_paga.py +218 -0
  118. singlet-1.2.0/python/singlet/_plot_ranking.py +124 -0
  119. singlet-1.2.0/python/singlet/_plot_scatter.py +206 -0
  120. singlet-1.2.0/python/singlet/_plot_stacked_violin.py +183 -0
  121. singlet-1.2.0/python/singlet/_plot_tracks.py +177 -0
  122. singlet-1.2.0/python/singlet/_predict_cell_type.py +160 -0
  123. singlet-1.2.0/python/singlet/_pseudobulk.py +124 -0
  124. singlet-1.2.0/python/singlet/_qc.py +154 -0
  125. singlet-1.2.0/python/singlet/_qc_summary.py +166 -0
  126. singlet-1.2.0/python/singlet/_query.py +47 -0
  127. singlet-1.2.0/python/singlet/_rank_genes.py +114 -0
  128. singlet-1.2.0/python/singlet/_recipes.py +111 -0
  129. singlet-1.2.0/python/singlet/_regress.py +110 -0
  130. singlet-1.2.0/python/singlet/_reprogramming_score.py +98 -0
  131. singlet-1.2.0/python/singlet/_restricted.py +363 -0
  132. singlet-1.2.0/python/singlet/_scale.py +90 -0
  133. singlet-1.2.0/python/singlet/_scanorama_integrate.py +240 -0
  134. singlet-1.2.0/python/singlet/_score.py +142 -0
  135. singlet-1.2.0/python/singlet/_scrublet.py +114 -0
  136. singlet-1.2.0/python/singlet/_sparse_pca.py +122 -0
  137. singlet-1.2.0/python/singlet/_spatial.py +110 -0
  138. singlet-1.2.0/python/singlet/_spectral_clustering.py +107 -0
  139. singlet-1.2.0/python/singlet/_splicing_ratio.py +119 -0
  140. singlet-1.2.0/python/singlet/_subcluster.py +81 -0
  141. singlet-1.2.0/python/singlet/_subsample.py +79 -0
  142. singlet-1.2.0/python/singlet/_subsample_balanced.py +130 -0
  143. singlet-1.2.0/python/singlet/_topic_model.py +105 -0
  144. singlet-1.2.0/python/singlet/_trajectory_genes.py +217 -0
  145. singlet-1.2.0/python/singlet/_transfer_labels.py +228 -0
  146. singlet-1.2.0/python/singlet/_transforms.py +147 -0
  147. singlet-1.2.0/python/singlet/_tsne.py +81 -0
  148. singlet-1.2.0/python/singlet/_umap.py +148 -0
  149. singlet-1.2.0/python/singlet/_variance_partition.py +156 -0
  150. singlet-1.2.0/python/singlet/_variational_inference.py +144 -0
  151. singlet-1.2.0/python/singlet/_velocity_pseudotime.py +196 -0
  152. singlet-1.2.0/python/singlet/_versions.py +81 -0
  153. singlet-1.2.0/python/singlet/_weighted_nearest_neighbors.py +236 -0
  154. singlet-1.2.0/python/singlet/_wishart.py +95 -0
  155. singlet-1.2.0/python/singlet/atlas/__init__.py +24 -0
  156. singlet-1.2.0/python/singlet/atlas/client.py +35 -0
  157. singlet-1.2.0/python/singlet/bundle.py +2257 -0
  158. singlet-1.2.0/python/singlet/celllabels/__init__.py +42 -0
  159. singlet-1.2.0/python/singlet/celllabels/ancestry.py +273 -0
  160. singlet-1.2.0/python/singlet/celllabels/celltype.py +481 -0
  161. singlet-1.2.0/python/singlet/celllabels/data/cellguide.json.gz +0 -0
  162. singlet-1.2.0/python/singlet/celllabels/data/cl.json.gz +0 -0
  163. singlet-1.2.0/python/singlet/celllabels/data/human_mouse.tsv.gz +0 -0
  164. singlet-1.2.0/python/singlet/celllabels/evaluate.py +145 -0
  165. singlet-1.2.0/python/singlet/celllabels/guide.py +511 -0
  166. singlet-1.2.0/python/singlet/celllabels/io.py +258 -0
  167. singlet-1.2.0/python/singlet/celllabels/output.py +211 -0
  168. singlet-1.2.0/python/singlet/celllabels/pipeline.py +141 -0
  169. singlet-1.2.0/python/singlet/celllabels/sex.py +149 -0
  170. singlet-1.2.0/python/singlet/convert.py +33 -0
  171. singlet-1.2.0/python/singlet/data/catalog_v1.parquet +0 -0
  172. singlet-1.2.0/python/singlet/data/sample_index.parquet +0 -0
  173. singlet-1.2.0/python/singlet/data/whitelists/737K-april-2014.txt +737280 -0
  174. singlet-1.2.0/python/singlet/data/whitelists/bd_cls1.txt +97 -0
  175. singlet-1.2.0/python/singlet/data/whitelists/bd_cls2.txt +97 -0
  176. singlet-1.2.0/python/singlet/data/whitelists/bd_cls3.txt +97 -0
  177. singlet-1.2.0/python/singlet/data/whitelists/indrop_bc1.txt +384 -0
  178. singlet-1.2.0/python/singlet/data/whitelists/indrop_bc2.txt +384 -0
  179. singlet-1.2.0/python/singlet/data/whitelists/microwell_bc1_bare.txt +96 -0
  180. singlet-1.2.0/python/singlet/data/whitelists/quartzseq2_bc.txt +1536 -0
  181. singlet-1.2.0/python/singlet/data/whitelists/scirna3_rt_bc.txt +326 -0
  182. singlet-1.2.0/python/singlet/data/whitelists/splitseq_bc_rd1.txt +192 -0
  183. singlet-1.2.0/python/singlet/data/whitelists/splitseq_bc_rd2.txt +96 -0
  184. singlet-1.2.0/python/singlet/data/whitelists/splitseq_bc_rd3.txt +96 -0
  185. singlet-1.2.0/python/singlet/derive/__init__.py +44 -0
  186. singlet-1.2.0/python/singlet/derive/gene_counts.py +44 -0
  187. singlet-1.2.0/python/singlet/derive/gene_full.py +31 -0
  188. singlet-1.2.0/python/singlet/derive/pseudobulk.py +46 -0
  189. singlet-1.2.0/python/singlet/derive/psi.py +30 -0
  190. singlet-1.2.0/python/singlet/derive/usa.py +40 -0
  191. singlet-1.2.0/python/singlet/features/__init__.py +5 -0
  192. singlet-1.2.0/python/singlet/features/data/abundance_human.parquet +0 -0
  193. singlet-1.2.0/python/singlet/features/data/abundance_mouse.parquet +0 -0
  194. singlet-1.2.0/python/singlet/features/data/cell_cycle.json +1 -0
  195. singlet-1.2.0/python/singlet/features/data/hallmark.json +1 -0
  196. singlet-1.2.0/python/singlet/features/genesets.py +139 -0
  197. singlet-1.2.0/python/singlet/features/io.py +114 -0
  198. singlet-1.2.0/python/singlet/features/output.py +193 -0
  199. singlet-1.2.0/python/singlet/features/pipeline.py +103 -0
  200. singlet-1.2.0/python/singlet/features/rank.py +190 -0
  201. singlet-1.2.0/python/singlet/features/registry.py +251 -0
  202. singlet-1.2.0/python/singlet/fetch.py +289 -0
  203. singlet-1.2.0/python/singlet/find.py +253 -0
  204. singlet-1.2.0/python/singlet/gpu/__init__.py +113 -0
  205. singlet-1.2.0/python/singlet/gpu/_coreutil.py +61 -0
  206. singlet-1.2.0/python/singlet/gpu/abundance/__init__.py +17 -0
  207. singlet-1.2.0/python/singlet/gpu/abundance/milo.py +249 -0
  208. singlet-1.2.0/python/singlet/gpu/ase/__init__.py +13 -0
  209. singlet-1.2.0/python/singlet/gpu/ase/daesc.py +160 -0
  210. singlet-1.2.0/python/singlet/gpu/atac/__init__.py +13 -0
  211. singlet-1.2.0/python/singlet/gpu/atac/chromvar.py +187 -0
  212. singlet-1.2.0/python/singlet/gpu/cna/__init__.py +13 -0
  213. singlet-1.2.0/python/singlet/gpu/cna/numbat.py +212 -0
  214. singlet-1.2.0/python/singlet/gpu/comm/__init__.py +17 -0
  215. singlet-1.2.0/python/singlet/gpu/comm/cellchat.py +278 -0
  216. singlet-1.2.0/python/singlet/gpu/de/__init__.py +22 -0
  217. singlet-1.2.0/python/singlet/gpu/de/pseudobulk.py +324 -0
  218. singlet-1.2.0/python/singlet/gpu/disease/__init__.py +17 -0
  219. singlet-1.2.0/python/singlet/gpu/disease/scdrs.py +238 -0
  220. singlet-1.2.0/python/singlet/gpu/enrichment/__init__.py +26 -0
  221. singlet-1.2.0/python/singlet/gpu/enrichment/aucell.py +264 -0
  222. singlet-1.2.0/python/singlet/gpu/enrichment/gsea.py +296 -0
  223. singlet-1.2.0/python/singlet/gpu/enrichment/progeny.py +129 -0
  224. singlet-1.2.0/python/singlet/gpu/enrichment/score_genes.py +231 -0
  225. singlet-1.2.0/python/singlet/gpu/enrichment/ssgsea.py +160 -0
  226. singlet-1.2.0/python/singlet/gpu/eqtl/__init__.py +13 -0
  227. singlet-1.2.0/python/singlet/gpu/eqtl/nebula.py +190 -0
  228. singlet-1.2.0/python/singlet/gpu/fate/__init__.py +29 -0
  229. singlet-1.2.0/python/singlet/gpu/fate/cellrank2.py +239 -0
  230. singlet-1.2.0/python/singlet/gpu/fate/cospar.py +239 -0
  231. singlet-1.2.0/python/singlet/gpu/fate/palantir.py +251 -0
  232. singlet-1.2.0/python/singlet/gpu/generative/__init__.py +14 -0
  233. singlet-1.2.0/python/singlet/gpu/generative/discrete_diffusion.py +216 -0
  234. singlet-1.2.0/python/singlet/gpu/grn/__init__.py +13 -0
  235. singlet-1.2.0/python/singlet/gpu/grn/granie.py +225 -0
  236. singlet-1.2.0/python/singlet/gpu/integrate/__init__.py +20 -0
  237. singlet-1.2.0/python/singlet/gpu/integrate/bbknn.py +310 -0
  238. singlet-1.2.0/python/singlet/gpu/integrate/harmony.py +244 -0
  239. singlet-1.2.0/python/singlet/gpu/io/__init__.py +28 -0
  240. singlet-1.2.0/python/singlet/gpu/io/donor.py +182 -0
  241. singlet-1.2.0/python/singlet/gpu/io/loader.py +288 -0
  242. singlet-1.2.0/python/singlet/gpu/lineage/__init__.py +22 -0
  243. singlet-1.2.0/python/singlet/gpu/lineage/mt.py +300 -0
  244. singlet-1.2.0/python/singlet/gpu/network/__init__.py +17 -0
  245. singlet-1.2.0/python/singlet/gpu/network/hdwgcna.py +200 -0
  246. singlet-1.2.0/python/singlet/gpu/perturbation/__init__.py +13 -0
  247. singlet-1.2.0/python/singlet/gpu/perturbation/perturb_graph.py +209 -0
  248. singlet-1.2.0/python/singlet/gpu/preprocess/__init__.py +29 -0
  249. singlet-1.2.0/python/singlet/gpu/preprocess/hvg.py +262 -0
  250. singlet-1.2.0/python/singlet/gpu/preprocess/lognorm.py +384 -0
  251. singlet-1.2.0/python/singlet/gpu/preprocess/neighbors.py +378 -0
  252. singlet-1.2.0/python/singlet/gpu/preprocess/scale.py +293 -0
  253. singlet-1.2.0/python/singlet/gpu/qc/__init__.py +23 -0
  254. singlet-1.2.0/python/singlet/gpu/qc/doublet_score.py +115 -0
  255. singlet-1.2.0/python/singlet/gpu/qc/omnidoublet.py +150 -0
  256. singlet-1.2.0/python/singlet/gpu/qc/qc_metrics.py +487 -0
  257. singlet-1.2.0/python/singlet/gpu/reduce/__init__.py +43 -0
  258. singlet-1.2.0/python/singlet/gpu/reduce/_nmf_core.py +634 -0
  259. singlet-1.2.0/python/singlet/gpu/reduce/nmf/__init__.py +42 -0
  260. singlet-1.2.0/python/singlet/gpu/reduce/nmf/csi_gep.py +136 -0
  261. singlet-1.2.0/python/singlet/gpu/reduce/svd.py +528 -0
  262. singlet-1.2.0/python/singlet/gpu/spatial/__init__.py +17 -0
  263. singlet-1.2.0/python/singlet/gpu/spatial/cell2fate.py +215 -0
  264. singlet-1.2.0/python/singlet/gpu/spatial/flash_deconv.py +163 -0
  265. singlet-1.2.0/python/singlet/gpu/spatial/stagate.py +143 -0
  266. singlet-1.2.0/python/singlet/gpu/streaming/__init__.py +20 -0
  267. singlet-1.2.0/python/singlet/gpu/streaming/pipeline.py +436 -0
  268. singlet-1.2.0/python/singlet/gpu/tools/__init__.py +32 -0
  269. singlet-1.2.0/python/singlet/gpu/tools/leiden.py +294 -0
  270. singlet-1.2.0/python/singlet/gpu/tools/markers.py +438 -0
  271. singlet-1.2.0/python/singlet/gpu/tools/rank_genes_groups.py +430 -0
  272. singlet-1.2.0/python/singlet/gpu/tools/umap.py +288 -0
  273. singlet-1.2.0/python/singlet/gpu/variants/__init__.py +13 -0
  274. singlet-1.2.0/python/singlet/gpu/variants/monopogen.py +169 -0
  275. singlet-1.2.0/python/singlet/gpu/velocity/__init__.py +27 -0
  276. singlet-1.2.0/python/singlet/gpu/velocity/moments.py +224 -0
  277. singlet-1.2.0/python/singlet/gpu/velocity/velocity.py +226 -0
  278. singlet-1.2.0/python/singlet/gpu/version.py +2 -0
  279. singlet-1.2.0/python/singlet/io/__init__.py +45 -0
  280. singlet-1.2.0/python/singlet/io/convert.py +253 -0
  281. singlet-1.2.0/python/singlet/manifest_gen.py +79 -0
  282. singlet-1.2.0/python/singlet/mcp/__init__.py +2 -0
  283. singlet-1.2.0/python/singlet/mcp/__main__.py +32 -0
  284. singlet-1.2.0/python/singlet/mcp/server.py +964 -0
  285. singlet-1.2.0/python/singlet/mcp/smoke_test.py +260 -0
  286. singlet-1.2.0/python/singlet/pipeline/__init__.py +24 -0
  287. singlet-1.2.0/python/singlet/pipeline/__main__.py +103 -0
  288. singlet-1.2.0/python/singlet/pipeline/_binary.py +163 -0
  289. singlet-1.2.0/python/singlet/pipeline/_errors.py +8 -0
  290. singlet-1.2.0/python/singlet/pipeline/_run.py +211 -0
  291. singlet-1.2.0/python/singlet/pp/__init__.py +44 -0
  292. singlet-1.2.0/python/singlet/preprocessing/__init__.py +44 -0
  293. singlet-1.2.0/python/singlet/preprocessing/_detect.py +230 -0
  294. singlet-1.2.0/python/singlet/preprocessing/_download.py +253 -0
  295. singlet-1.2.0/python/singlet/preprocessing/_export.py +130 -0
  296. singlet-1.2.0/python/singlet/preprocessing/_qc.py +148 -0
  297. singlet-1.2.0/python/singlet/preprocessing/_quantify.py +159 -0
  298. singlet-1.2.0/python/singlet/preprocessing/_species.py +132 -0
  299. singlet-1.2.0/python/singlet/refbundle/__init__.py +56 -0
  300. singlet-1.2.0/python/singlet/refbundle/_features.py +487 -0
  301. singlet-1.2.0/python/singlet/refbundle/_snp.py +195 -0
  302. singlet-1.2.0/python/singlet/s1/__init__.py +18 -0
  303. singlet-1.2.0/python/singlet/s1/atlas.py +3945 -0
  304. singlet-1.2.0/python/singlet/s1/builtin_recipes.py +32 -0
  305. singlet-1.2.0/python/singlet/s1/bundle.py +461 -0
  306. singlet-1.2.0/python/singlet/s1/cellcall.py +452 -0
  307. singlet-1.2.0/python/singlet/s1/cells.py +494 -0
  308. singlet-1.2.0/python/singlet/s1/client.py +2161 -0
  309. singlet-1.2.0/python/singlet/s1/codec.py +793 -0
  310. singlet-1.2.0/python/singlet/s1/container.py +366 -0
  311. singlet-1.2.0/python/singlet/s1/context.py +490 -0
  312. singlet-1.2.0/python/singlet/s1/junctions.py +766 -0
  313. singlet-1.2.0/python/singlet/s1/labels.py +325 -0
  314. singlet-1.2.0/python/singlet/s1/labels_step.py +418 -0
  315. singlet-1.2.0/python/singlet/s1/legacy.py +456 -0
  316. singlet-1.2.0/python/singlet/s1/manifest.py +144 -0
  317. singlet-1.2.0/python/singlet/s1/matrix.py +158 -0
  318. singlet-1.2.0/python/singlet/s1/migrate.py +1702 -0
  319. singlet-1.2.0/python/singlet/s1/packs/09243cc59ea1b0223dcbf071e1df34e3.pack +0 -0
  320. singlet-1.2.0/python/singlet/s1/packs/0bcd2ceb31fc6cad695901e449f667cc.pack +0 -0
  321. singlet-1.2.0/python/singlet/s1/packs/15854e80854ce93702dc4c716e6a35c5.pack +0 -0
  322. singlet-1.2.0/python/singlet/s1/packs/32bbdc195ae2486a1257e38d3c4c161e.pack +0 -0
  323. singlet-1.2.0/python/singlet/s1/packs/5b24205cb61a91db46ebbc980e8ee6bc.pack +0 -0
  324. singlet-1.2.0/python/singlet/s1/packs/88579b0570adecbc3f0e8602d65d243f.pack +0 -0
  325. singlet-1.2.0/python/singlet/s1/packs/94e3bff7460f96e92311ff009efae582.pack +0 -0
  326. singlet-1.2.0/python/singlet/s1/packs/99a51e8db8bc54baede2092c8b828737.pack +0 -0
  327. singlet-1.2.0/python/singlet/s1/packs/a34ebca652f38b28f0ab5c0ec2a13249.pack +0 -0
  328. singlet-1.2.0/python/singlet/s1/packs/b3961cb6986f392743ea332b879d1d5a.pack +0 -0
  329. singlet-1.2.0/python/singlet/s1/packs/b6abb72f333412054fd8d2afa76f35b4.pack +0 -0
  330. singlet-1.2.0/python/singlet/s1/packs/b708a9dbd566355a876377babed1a4a1.pack +0 -0
  331. singlet-1.2.0/python/singlet/s1/packs/c46618191a313da3983d934abe51e751.pack +0 -0
  332. singlet-1.2.0/python/singlet/s1/packs/ce5a05fc3282d0e3c39e0c7109619eb1.pack +0 -0
  333. singlet-1.2.0/python/singlet/s1/packs/cef1acaf465ebfc4ff7404f308966e92.pack +0 -0
  334. singlet-1.2.0/python/singlet/s1/packs/fd3fcc82842baa3a1d4c8bc6a8f99b90.pack +0 -0
  335. singlet-1.2.0/python/singlet/s1/packs/index.json +179 -0
  336. singlet-1.2.0/python/singlet/s1/packs.py +985 -0
  337. singlet-1.2.0/python/singlet/s1/packs_build.py +211 -0
  338. singlet-1.2.0/python/singlet/s1/policy.py +376 -0
  339. singlet-1.2.0/python/singlet/s1/rcp_adapter.py +115 -0
  340. singlet-1.2.0/python/singlet/s1/recipes.py +203 -0
  341. singlet-1.2.0/python/singlet/s1/recipes_cells.py +227 -0
  342. singlet-1.2.0/python/singlet/s1/recipes_ctx.py +465 -0
  343. singlet-1.2.0/python/singlet/s1/recipes_data/features_order_GRCm39-2024-A.u32.zst +0 -0
  344. singlet-1.2.0/python/singlet/s1/recipes_extra.py +321 -0
  345. singlet-1.2.0/python/singlet/s1/recipes_mtx.py +192 -0
  346. singlet-1.2.0/python/singlet/s1/recipes_psi.py +292 -0
  347. singlet-1.2.0/python/singlet/s1/recipes_pzw.py +335 -0
  348. singlet-1.2.0/python/singlet/s1/recipes_qc.py +118 -0
  349. singlet-1.2.0/python/singlet/s1/recipes_star.py +386 -0
  350. singlet-1.2.0/python/singlet/s1/recipes_tables.py +468 -0
  351. singlet-1.2.0/python/singlet/s1/recipes_tsv.py +212 -0
  352. singlet-1.2.0/python/singlet/s1/sample.py +166 -0
  353. singlet-1.2.0/python/singlet/s1/transport.py +413 -0
  354. singlet-1.2.0/python/singlet/s1/util.py +163 -0
  355. singlet-1.2.0/python/singlet/s1/verify.py +891 -0
  356. singlet-1.2.0/python/singlet/store/__init__.py +55 -0
  357. singlet-1.2.0/python/singlet/store/migrate.py +10 -0
  358. singlet-1.2.0/python/singlet/store/packs_build.py +10 -0
  359. singlet-1.2.0/python/singlet/store/verify.py +10 -0
  360. singlet-1.2.0/python/singlet/torch/__init__.py +54 -0
  361. singlet-1.2.0/python/singlet/torch/_stream.py +791 -0
  362. singlet-1.2.0/python/singlet/torch/_torch.py +362 -0
  363. singlet-1.2.0/python/singlet/v2/__init__.py +55 -0
  364. singlet-1.2.0/python/singlet/v2/migrate.py +10 -0
  365. singlet-1.2.0/python/singlet/v2/packs_build.py +10 -0
  366. singlet-1.2.0/python/singlet/v2/verify.py +10 -0
  367. singlet-1.2.0/python/singlet/whitelists.py +179 -0
  368. singlet-1.2.0/python/singlet.egg-info/PKG-INFO +277 -0
  369. singlet-1.2.0/python/singlet.egg-info/SOURCES.txt +405 -0
  370. singlet-1.2.0/python/singlet.egg-info/entry_points.txt +4 -0
  371. singlet-1.2.0/python/singlet.egg-info/requires.txt +50 -0
  372. singlet-1.2.0/setup.py +31 -0
  373. singlet-1.2.0/src/bindings/common/singlet/pz2_client.h +205 -0
  374. singlet-1.2.0/src/bindings/python/_bind_abundance.hpp +221 -0
  375. singlet-1.2.0/src/bindings/python/_bind_ase.hpp +203 -0
  376. singlet-1.2.0/src/bindings/python/_bind_atac.hpp +270 -0
  377. singlet-1.2.0/src/bindings/python/_bind_cna.hpp +289 -0
  378. singlet-1.2.0/src/bindings/python/_bind_comm.hpp +210 -0
  379. singlet-1.2.0/src/bindings/python/_bind_cupy_ingest.hpp +192 -0
  380. singlet-1.2.0/src/bindings/python/_bind_disease.hpp +226 -0
  381. singlet-1.2.0/src/bindings/python/_bind_enrich.hpp +280 -0
  382. singlet-1.2.0/src/bindings/python/_bind_eqtl.hpp +215 -0
  383. singlet-1.2.0/src/bindings/python/_bind_fate.hpp +593 -0
  384. singlet-1.2.0/src/bindings/python/_bind_generative.hpp +283 -0
  385. singlet-1.2.0/src/bindings/python/_bind_grn.hpp +255 -0
  386. singlet-1.2.0/src/bindings/python/_bind_kernels.hpp +1795 -0
  387. singlet-1.2.0/src/bindings/python/_bind_loader.hpp +379 -0
  388. singlet-1.2.0/src/bindings/python/_bind_metadata.hpp +116 -0
  389. singlet-1.2.0/src/bindings/python/_bind_network.hpp +192 -0
  390. singlet-1.2.0/src/bindings/python/_bind_nmf_new.hpp +196 -0
  391. singlet-1.2.0/src/bindings/python/_bind_perturbation.hpp +326 -0
  392. singlet-1.2.0/src/bindings/python/_bind_preprocess.hpp +239 -0
  393. singlet-1.2.0/src/bindings/python/_bind_qc_metrics.hpp +347 -0
  394. singlet-1.2.0/src/bindings/python/_bind_qc_new.hpp +308 -0
  395. singlet-1.2.0/src/bindings/python/_bind_results.hpp +750 -0
  396. singlet-1.2.0/src/bindings/python/_bind_score_genes.hpp +184 -0
  397. singlet-1.2.0/src/bindings/python/_bind_spatial_phaseb.hpp +549 -0
  398. singlet-1.2.0/src/bindings/python/_bind_variants.hpp +235 -0
  399. singlet-1.2.0/src/bindings/python/_cupy_interop.hpp +131 -0
  400. singlet-1.2.0/src/bindings/python/_gpu_core.cpp +486 -0
  401. singlet-1.2.0/src/bindings/python/_pz.cpp +304 -0
  402. singlet-1.2.0/src/bindings/python/_pz2.cpp +952 -0
  403. singlet-1.2.0/src/bindings/python/_singlepress.cpp +570 -0
  404. singlet-0.4/PKG-INFO +0 -24
  405. singlet-0.4/README.md +0 -96
  406. singlet-0.4/setup.py +0 -86
  407. singlet-0.4/singlet/__init__.py +0 -8
  408. singlet-0.4/singlet/_version.py +0 -1
  409. singlet-0.4/singlet/config.py +0 -100
  410. singlet-0.4/singlet/counts_table/__init__.py +0 -16
  411. singlet-0.4/singlet/counts_table/counts_table.py +0 -444
  412. singlet-0.4/singlet/counts_table/counts_table_sparse.py +0 -261
  413. singlet-0.4/singlet/counts_table/counts_table_xarray.py +0 -1063
  414. singlet-0.4/singlet/dataset/__init__.py +0 -944
  415. singlet-0.4/singlet/dataset/cluster.py +0 -175
  416. singlet-0.4/singlet/dataset/correlations.py +0 -438
  417. singlet-0.4/singlet/dataset/dimensionality.py +0 -274
  418. singlet-0.4/singlet/dataset/feature_selection.py +0 -128
  419. singlet-0.4/singlet/dataset/fit.py +0 -196
  420. singlet-0.4/singlet/dataset/graph.py +0 -180
  421. singlet-0.4/singlet/dataset/plot.py +0 -1140
  422. singlet-0.4/singlet/featuresheet.py +0 -33
  423. singlet-0.4/singlet/io/__init__.py +0 -192
  424. singlet-0.4/singlet/io/csv/__init__.py +0 -53
  425. singlet-0.4/singlet/io/googleapi/__init__.py +0 -11
  426. singlet-0.4/singlet/io/googleapi/googleapi.py +0 -407
  427. singlet-0.4/singlet/io/googleapi/samplesheet.py +0 -105
  428. singlet-0.4/singlet/io/loom/__init__.py +0 -74
  429. singlet-0.4/singlet/io/npz/__init__.py +0 -47
  430. singlet-0.4/singlet/io/pickle/__init__.py +0 -12
  431. singlet-0.4/singlet/samplesheet.py +0 -33
  432. singlet-0.4/singlet/utils/cache.py +0 -43
  433. singlet-0.4/singlet.egg-info/PKG-INFO +0 -24
  434. singlet-0.4/singlet.egg-info/SOURCES.txt +0 -39
  435. singlet-0.4/singlet.egg-info/requires.txt +0 -4
  436. singlet-0.4/test/test_counts_table.py +0 -62
  437. singlet-0.4/test/test_dataset.py +0 -59
  438. singlet-0.4/test/test_examples.py +0 -43
  439. singlet-0.4/test/test_io.py +0 -50
  440. singlet-0.4/test/test_samplesheet.py +0 -42
  441. /singlet-0.4/singlet/utils/__init__.py → /singlet-1.2.0/python/singlet/py.typed +0 -0
  442. {singlet-0.4 → singlet-1.2.0/python}/singlet.egg-info/dependency_links.txt +0 -0
  443. {singlet-0.4 → singlet-1.2.0/python}/singlet.egg-info/top_level.txt +0 -0
  444. {singlet-0.4 → singlet-1.2.0}/setup.cfg +0 -0
singlet-1.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 Singlet Bio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,31 @@
1
+ include LICENSE
2
+ include README.md
3
+ include python/README.md
4
+ include pyproject.toml
5
+ include setup.py
6
+
7
+ # C++ sources + headers needed to build the singlet._pz extension from an sdist
8
+ recursive-include src/bindings *.cpp *.h *.hpp
9
+ # only the .1pz codec headers: the extension includes nothing else (the rest of include/ is the C++ pipeline)
10
+ include include/singlet/pileup/pz_reader.h
11
+ include include/singlet/pileup/pz_writer.h
12
+ # the pz2 matrix codec (header-only) and the binding helpers
13
+ recursive-include include/singlet/pz2 *.h
14
+
15
+ # Bundled package data
16
+ recursive-include python/singlet/data *.parquet *.txt
17
+ recursive-include python/singlet/celllabels/data *.gz
18
+ recursive-include python/singlet/features/data *.json *.parquet
19
+ # ...except the large 10x whitelists, which singlet.whitelists downloads on demand
20
+ exclude python/singlet/data/whitelists/3M-february-2018.txt
21
+ exclude python/singlet/data/whitelists/737K-august-2016.txt
22
+ exclude python/singlet/data/whitelists/737K-cratac-v1.txt
23
+ exclude python/singlet/data/whitelists/gex_737K-arc-v1.txt
24
+ include python/singlet/py.typed
25
+
26
+ # Keep test/build noise out of the sdist
27
+ prune build
28
+ prune dist
29
+ global-exclude *.pyc
30
+ global-exclude __pycache__
31
+ global-exclude *.so
singlet-1.2.0/PKG-INFO ADDED
@@ -0,0 +1,277 @@
1
+ Metadata-Version: 2.4
2
+ Name: singlet
3
+ Version: 1.2.0
4
+ Summary: Open single-cell RNA-seq atlas: find, load, and analyze single-cell data at scale
5
+ Author-email: Zach DeBruine <debruinz@gvsu.edu>
6
+ License: MIT
7
+ Project-URL: Homepage, https://singlet.bio
8
+ Project-URL: Documentation, https://singlet.bio/docs
9
+ Project-URL: Repository, https://github.com/Singlet-Bio/singlet
10
+ Project-URL: Issues, https://github.com/Singlet-Bio/singlet/issues
11
+ Project-URL: Changelog, https://github.com/Singlet-Bio/singlet/blob/main/CHANGELOG.md
12
+ Keywords: single-cell,RNA-seq,bioinformatics,sparse-matrix,pytorch,anndata,GPU
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: C++
23
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
24
+ Classifier: Operating System :: POSIX :: Linux
25
+ Classifier: Operating System :: MacOS
26
+ Classifier: Operating System :: Microsoft :: Windows
27
+ Requires-Python: >=3.9
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Requires-Dist: numpy>=1.21
31
+ Requires-Dist: scipy>=1.7
32
+ Requires-Dist: pandas>=1.3
33
+ Requires-Dist: anndata>=0.8
34
+ Requires-Dist: requests>=2.25
35
+ Requires-Dist: tqdm>=4.60
36
+ Requires-Dist: scikit-learn>=1.0
37
+ Requires-Dist: zstandard>=0.20
38
+ Requires-Dist: pyarrow>=10.0
39
+ Provides-Extra: torch
40
+ Requires-Dist: torch>=2.0; extra == "torch"
41
+ Provides-Extra: gpu
42
+ Requires-Dist: cupy-cuda12x>=13.0; extra == "gpu"
43
+ Provides-Extra: zarr
44
+ Requires-Dist: zarr>=2.12; extra == "zarr"
45
+ Provides-Extra: tiledb
46
+ Requires-Dist: tiledbsoma>=1.4; extra == "tiledb"
47
+ Provides-Extra: mcp
48
+ Requires-Dist: mcp<2,>=1.0; extra == "mcp"
49
+ Provides-Extra: migrate
50
+ Requires-Dist: numba>=0.57; extra == "migrate"
51
+ Provides-Extra: analysis
52
+ Requires-Dist: matplotlib>=3.5; extra == "analysis"
53
+ Requires-Dist: scanpy>=1.9; extra == "analysis"
54
+ Requires-Dist: statsmodels>=0.13; extra == "analysis"
55
+ Requires-Dist: igraph>=0.10; extra == "analysis"
56
+ Requires-Dist: leidenalg>=0.9; extra == "analysis"
57
+ Provides-Extra: all
58
+ Requires-Dist: singlet[analysis,gpu,mcp,tiledb,torch,zarr]; extra == "all"
59
+ Provides-Extra: test
60
+ Requires-Dist: pytest>=7.0; extra == "test"
61
+ Requires-Dist: pytest-cov; extra == "test"
62
+ Requires-Dist: coverage>=7.0; extra == "test"
63
+ Requires-Dist: hypothesis>=6.0; extra == "test"
64
+ Requires-Dist: singlet[analysis]; extra == "test"
65
+ Provides-Extra: dev
66
+ Requires-Dist: singlet[test]; extra == "dev"
67
+ Requires-Dist: ruff; extra == "dev"
68
+ Requires-Dist: pyright; extra == "dev"
69
+ Requires-Dist: pybind11>=2.11; extra == "dev"
70
+ Dynamic: license-file
71
+
72
+ # singlet
73
+
74
+ **Find, load, and analyze re-processed public single-cell RNA-seq studies with one line of Python.**
75
+
76
+ Singlet re-processes public GEO single-cell RNA-seq studies through one
77
+ uniform pipeline and publishes each study as a `.singlet` file. You work with
78
+ two simple things: GEO accession strings (`GSE…` / `GSM…`) and `.singlet`
79
+ files. Everything loads as [AnnData](https://anndata.readthedocs.io/), ready
80
+ for scanpy or PyTorch. Browse the catalog at [singlet.bio](https://singlet.bio).
81
+
82
+ - **Data: CC0** (public domain) — **Code: MIT**.
83
+ - Downloads need no login and no API key.
84
+
85
+ ## Install
86
+
87
+ ```bash
88
+ pip install singlet
89
+ ```
90
+
91
+ Wheels for Linux (x86_64, aarch64), macOS (Intel, Apple silicon) and Windows include the compiled `.1pz` / `.s1`
92
+ codec, so no compiler is needed. The development version installs from GitHub:
93
+
94
+ ```bash
95
+ pip install "singlet @ git+https://github.com/Singlet-Bio/singlet"
96
+ ```
97
+
98
+ Building from source compiles the package's `.1pz` codec, so you need a **C++17 compiler**
99
+ and **zstd** (headers + library): `apt install build-essential libzstd-dev`
100
+ on Debian/Ubuntu, `brew install zstd` on macOS, or
101
+ `conda install -c conda-forge zstd`. Linux, macOS and Windows are
102
+ supported (Windows needs Visual Studio Build Tools and zstd to build from source; wheels are built in CI).
103
+
104
+ Optional extras (same URL, extra in brackets):
105
+
106
+ ```bash
107
+ pip install "singlet[analysis] @ git+https://github.com/Singlet-Bio/singlet" # matplotlib, scanpy, statsmodels, igraph, leidenalg
108
+ pip install "singlet[torch] @ git+https://github.com/Singlet-Bio/singlet" # PyTorch DataLoaders
109
+ pip install "singlet[zarr] @ git+https://github.com/Singlet-Bio/singlet" # Zarr export/import
110
+ pip install "singlet[mcp] @ git+https://github.com/Singlet-Bio/singlet" # local MCP server (singlet-mcp)
111
+ ```
112
+
113
+ ## Quick start
114
+
115
+ ```python
116
+ import singlet
117
+
118
+ # Find studies in plain English → GSE accessions (live search)
119
+ studies = singlet.find("human PBMC 10x")
120
+
121
+ # Load a study → AnnData (free download, cached under ~/.singlet/cache)
122
+ adata = singlet.load("GSE138867")
123
+
124
+ # Load one sample: the parent study is downloaded, then filtered to it
125
+ pbmc1 = singlet.load("GSM4120733")
126
+
127
+ # Load and concatenate several studies into ONE AnnData
128
+ adata = singlet.load(["GSE138867", "GSE146974"])
129
+
130
+ # Per-cell labels come with every per-sample study (docs/cell_annotation.md section 8)
131
+ adata.obs[
132
+ ["cell_type", "cell_type_ontology_term_id", "sex_chrom", "ancestry_hancestro", "called_ed"]
133
+ ]
134
+ # ... and can select cells before anything else is downloaded
135
+ heart = singlet.cells("GSE286650", "cell_type == 'cardiac muscle cell' and sex_chrom == 'male'")
136
+
137
+ # Load a local .singlet file
138
+ adata = singlet.load("path/to/GSE138867.singlet")
139
+
140
+ # Search and load the top three matching studies in one step
141
+ adata = singlet.find_load("human pancreas islet cells")
142
+ ```
143
+
144
+ `load()` accepts a single accession, a single `.singlet` path, or a list/tuple
145
+ mixing both. Lists are concatenated into one AnnData; `obs["source"]` and
146
+ `obs["dataset"]` record where each cell came from.
147
+
148
+ What you get back:
149
+
150
+ - `X`: gene-level UMI counts (cells × genes, sparse), with `layers["spliced"]`
151
+ and `layers["unspliced"]` when both are available.
152
+ - `var_names`: Ensembl gene ids; `var["gene_name"]`: gene symbols.
153
+ - `obs`: `gsm_id`, organism, protocol and other per-sample metadata.
154
+ - `uns["study_meta"]`, `uns["manifest"]`: study metadata and the file's
155
+ manifest (stored so that `write_h5ad` / `write_zarr` work).
156
+ - `uns["skipped_samples"]`: present only when some samples had an empty count
157
+ matrix; those are skipped with a warning. A study with no usable sample
158
+ raises an error pointing to its page on singlet.bio.
159
+
160
+ Pick genes by symbol or by Ensembl id:
161
+
162
+ ```python
163
+ adata = singlet.load("GSE138867", genes=["CD3E", "MS4A1", "ENSG00000105374"])
164
+ ```
165
+
166
+ Symbols are matched exactly first, then case-insensitively; anything
167
+ unmatched is reported in a warning.
168
+
169
+ ## Natural-language search
170
+
171
+ ```python
172
+ import singlet
173
+
174
+ singlet.find("exhausted T cells in melanoma") # study (GSE) accessions
175
+ singlet.find("mouse brain 10x", level="gsm", limit=20) # sample (GSM) accessions
176
+
177
+ # find + load in one call (top 3 studies by default; raise limit deliberately)
178
+ adata = singlet.find_load("human kidney organoids", limit=5)
179
+ ```
180
+
181
+ Search runs against the hosted endpoint (`https://singlet.bio/api`; override
182
+ with `$SINGLET_API_BASE`). It is rate-limited per client; for heavier use,
183
+ create a key at https://singlet.bio/account and call `singlet.set_api_key()`
184
+ (or set `$SINGLET_API_KEY`).
185
+
186
+ ## Browse the catalog snapshot (offline)
187
+
188
+ ```python
189
+ import singlet
190
+
191
+ singlet.summary() # snapshot overview
192
+ singlet.samples(organism="Homo sapiens", status="SUCCESS")
193
+ singlet.tissues() # tissue breakdown
194
+ singlet.info("GSE138867") # metadata
195
+ ```
196
+
197
+ These functions read a catalog snapshot bundled with the package, so they
198
+ work offline but lag the live catalog. `singlet.info()` falls back to the
199
+ live API (`/api/gse/<GSE>`, `/api/gsm/<GSM>`) for accessions the snapshot
200
+ does not know, and `python -m singlet` prints live totals from
201
+ `https://singlet.bio/api/stats`. Set `SINGLET_OFFLINE=1` to disable those
202
+ live lookups.
203
+
204
+ ## Export
205
+
206
+ ```python
207
+ singlet.to_h5ad(adata, "study.h5ad")
208
+ singlet.to_zarr(adata, "study.zarr") # needs singlet[zarr]
209
+ singlet.to_mtx(adata, "study_mtx/") # 10x-style matrix.mtx.gz + barcodes + features
210
+ ```
211
+
212
+ Loom export is not supported from Python.
213
+
214
+ ## Standard analysis (scanpy-compatible)
215
+
216
+ ```python
217
+ import scanpy as sc
218
+
219
+ adata = singlet.load("GSE138867")
220
+ sc.pp.normalize_total(adata, target_sum=1e4)
221
+ sc.pp.log1p(adata)
222
+ sc.pp.highly_variable_genes(adata)
223
+ sc.tl.pca(adata)
224
+ sc.pp.neighbors(adata)
225
+ sc.tl.umap(adata)
226
+ sc.tl.leiden(adata)
227
+ ```
228
+
229
+ The package also has built-in equivalents (`singlet.normalize`,
230
+ `singlet.pca`, `singlet.neighbors`, `singlet.leiden`, `singlet.umap`, ...)
231
+ that do not need scanpy.
232
+
233
+ ## PyTorch training
234
+
235
+ ```python
236
+ from singlet.torch import SingletDataset, DataLoader
237
+
238
+ # An array of .singlet files, concatenated into one training set
239
+ loader = DataLoader(
240
+ ["a.singlet", "b.singlet", "c.singlet"],
241
+ batch_size=512,
242
+ device="cuda",
243
+ normalize=True,
244
+ )
245
+
246
+ # A single dataset / accession / AnnData also works
247
+ ds = SingletDataset("GSE138867", normalize=True)
248
+ ```
249
+
250
+ ## MCP servers
251
+
252
+ - **Hosted:** `https://singlet.bio/mcp` serves the live catalog to MCP clients;
253
+ nothing to install.
254
+ - **Local:** `singlet-mcp` (install `singlet[mcp]`) runs 12 tools over the
255
+ offline catalog snapshot plus live search, over stdio. The old command name
256
+ `singlet` still works but is deprecated.
257
+
258
+ ## Configuration
259
+
260
+ | Variable | Meaning |
261
+ |---|---|
262
+ | `SINGLET_DATA_BASE` | Bundle host: files live at `<base>/data/<GSE>/<GSE>.singlet` (default `https://data.singlet.bio`; a trailing `/data` is accepted, so the R client's value works too) |
263
+ | `SINGLET_SAMPLE_MIRROR` | Self-hosted mirror of per-sample directories for `singlet.fetch()` (no public default) |
264
+ | `SINGLET_API_BASE` | REST API base (default `https://singlet.bio/api`) |
265
+ | `SINGLET_CACHE_DIR` | Download cache (default `~/.singlet/cache`) |
266
+ | `SINGLET_API_KEY` | Optional key for natural-language search |
267
+ | `SINGLET_OFFLINE` | `1` disables the live lookups in `info()` and `python -m singlet` |
268
+
269
+ ## Links
270
+
271
+ - Homepage: https://singlet.bio
272
+ - Documentation: https://singlet.bio/docs
273
+ - Source: https://github.com/Singlet-Bio/singlet
274
+
275
+ ## License
276
+
277
+ Code: MIT. Catalog data: CC0 (public domain).
@@ -0,0 +1,183 @@
1
+ # singlet
2
+
3
+ A single-cell genomics toolkit: process, load, and analyze public single-cell
4
+ RNA-seq data. It is the client for the [singlet.bio](https://singlet.bio)
5
+ catalog of re-processed GEO studies.
6
+
7
+ **One repository. Three languages.**
8
+
9
+ ```bash
10
+ pip install singlet # Python
11
+ ```
12
+ ```r
13
+ remotes::install_github("Singlet-Bio/singlet", subdir = "r") # R
14
+ ```
15
+ ```cmake
16
+ find_package(Singlet REQUIRED) # C++
17
+ ```
18
+
19
+ Wheels for Linux (x86_64, aarch64), macOS (Intel, Apple silicon) and Windows include the compiled `.1pz` / `.s1`
20
+ codec, so no compiler is needed.
21
+
22
+ Installing the Python package from source (`pip install "singlet @ git+https://github.com/Singlet-Bio/singlet"`) compiles a small C++ extension (the
23
+ `.1pz` codec), so you need a **C++17 compiler** and **zstd** headers + library
24
+ (`apt install build-essential libzstd-dev`, `brew install zstd`, or
25
+ `conda install -c conda-forge zstd`). Linux, macOS and Windows are
26
+ supported (Windows needs Visual Studio Build Tools and zstd to build from source; wheels are built in CI).
27
+
28
+ ## What singlet does
29
+
30
+ | Layer | Capability |
31
+ |-------|-----------|
32
+ | **Catalog** | Search and load re-processed GEO studies from singlet.bio as AnnData — see the site for current numbers |
33
+ | **Format** | `.singlet` per-study bundles and the `.1pz` sparse-matrix codec |
34
+ | **Pipeline** | Raw SRA reads → aligned, deduplicated, annotated count matrices (C++ binary) |
35
+ | **Analysis** | PCA, neighbors, Leiden, UMAP, DE, batch correction — no scanpy required |
36
+ | **PyTorch** | Sparse DataLoaders over `.singlet` files for ML training |
37
+
38
+ ## Quick Start
39
+
40
+ ```python
41
+ import singlet
42
+
43
+ # Find studies in plain English (live search) → GSE accessions
44
+ singlet.find("human PBMC 10x")
45
+
46
+ # Load a study → AnnData (free download from data.singlet.bio, cached)
47
+ adata = singlet.load("GSE138867")
48
+
49
+ # Load one sample of it (downloads the parent study, keeps this sample's cells)
50
+ pbmc1 = singlet.load("GSM4120733")
51
+
52
+ # Load several studies into ONE AnnData (obs["dataset"] records each study)
53
+ adata = singlet.load(["GSE138867", "GSE146974"])
54
+
55
+ # Subset genes by symbol or Ensembl id (var_names stay Ensembl ids)
56
+ tcells = singlet.load("GSE138867", genes=["CD3E", "CD8A", "MS4A1"])
57
+
58
+ # Per-cell labels come with every per-sample study (docs/cell_annotation.md section 8)
59
+ adata.obs[["cell_type", "cell_type_ontology_term_id", "sex_chrom", "ancestry_hancestro", "called_ed"]]
60
+ # ... and can select cells before anything else is downloaded
61
+ heart = singlet.cells("GSE286650", "cell_type == 'cardiac muscle cell' and sex_chrom == 'male'")
62
+
63
+ # Explore
64
+ singlet.describe(adata) # quick summary stats
65
+
66
+ # Preprocessing (no scanpy required)
67
+ singlet.filter_cells(adata, min_genes=200, inplace=True)
68
+ singlet.filter_genes(adata, min_cells=3, inplace=True)
69
+ singlet.normalize(adata) # library-size + log1p
70
+ singlet.highly_variable_genes(adata) # feature selection
71
+
72
+ # Analysis
73
+ singlet.pca(adata) # dimensionality reduction
74
+ singlet.harmony(adata, "dataset") # batch-correct across the two studies
75
+ singlet.neighbors(adata, use_rep="X_pca_harmony")
76
+ singlet.leiden(adata) # clustering
77
+ singlet.umap(adata) # 2D embedding
78
+
79
+ # Differential expression & visualization (plotting needs matplotlib)
80
+ singlet.rank_genes_groups(adata, "leiden")
81
+ singlet.plot_umap(adata, color="leiden")
82
+
83
+ # Export
84
+ singlet.to_h5ad(adata, "pbmc.h5ad") # also to_zarr, to_mtx
85
+ ```
86
+
87
+ Samples whose count matrix is empty are skipped with a warning and listed in
88
+ `adata.uns["skipped_samples"]`. Loom export is not supported from Python; use
89
+ `.h5ad`, `.zarr` or 10x MTX.
90
+
91
+ ## Repository Layout
92
+
93
+ ```
94
+ singlet/
95
+ ├── include/singlet/ C++ headers (libsinglet — header-only)
96
+ │ ├── pz/ .1pz format codec
97
+ │ ├── fq/ .1fq encoded FASTQ codec
98
+ │ ├── pileup/ Streaming BAM pileup engine
99
+ │ └── gpu/ CUDA analysis kernels (experimental)
100
+ ├── python/singlet/ Python package source
101
+ │ ├── io/ Format I/O (.1pz, h5ad, zarr)
102
+ │ ├── preprocessing/ Pipeline QC & preprocessing
103
+ │ ├── torch/ PyTorch integration
104
+ │ └── gpu/ GPU analysis wrappers (experimental)
105
+ ├── r/ R package
106
+ ├── src/ Compiled sources (pipeline binary, STAR aligner, GPU kernels)
107
+ ├── tests/ Test suites (Python + C++ + R)
108
+ ├── notebooks/ Jupyter tutorial notebooks
109
+ ├── docs/ User documentation
110
+ └── papers/ Scientific manuscripts
111
+ ```
112
+
113
+ ## Installation
114
+
115
+ See [docs/installation.md](docs/installation.md) for full details. The Python
116
+ package is `pip install singlet`; the rows below install the development version from GitHub.
117
+
118
+ | Install | Command |
119
+ |---------|---------|
120
+ | Python (core) | `pip install "singlet @ git+https://github.com/Singlet-Bio/singlet"` |
121
+ | Python + analysis extras | `pip install "singlet[analysis] @ git+https://github.com/Singlet-Bio/singlet"` |
122
+ | Python + PyTorch | `pip install "singlet[torch] @ git+https://github.com/Singlet-Bio/singlet"` |
123
+ | Python + local MCP server | `pip install "singlet[mcp] @ git+https://github.com/Singlet-Bio/singlet"` |
124
+ | R | `remotes::install_github("Singlet-Bio/singlet", subdir = "r")` |
125
+ | C++ (CMake) | `find_package(Singlet COMPONENTS pz fq pileup)` |
126
+ | Pipeline binary | `cmake -B build -DSINGLET_BUILD_PIPELINE=ON` |
127
+
128
+ The GPU module (`singlet.gpu`) is experimental: `singlet[gpu]` only installs
129
+ CuPy, and the CUDA extension it needs must be built from source on a CUDA 12
130
+ machine.
131
+
132
+ ## MCP servers
133
+
134
+ There are two, and they are different:
135
+
136
+ - **Hosted:** `https://singlet.bio/mcp` — the live catalog, maintained by the
137
+ site. Point an MCP client at the URL; nothing to install.
138
+ - **Local:** `singlet-mcp` (from `singlet[mcp]`) — 12 tools over the offline
139
+ catalog snapshot bundled with the package plus live search. The old command
140
+ name `singlet` still starts it but is deprecated, because `singlet` is also
141
+ the pipeline binary's name.
142
+
143
+ ## Notebooks
144
+
145
+ | Notebook | Topic |
146
+ |----------|-------|
147
+ | [01_load_and_explore](notebooks/01_load_and_explore.ipynb) | Full analysis pipeline |
148
+ | [quickstart](notebooks/quickstart.ipynb) | Catalog API |
149
+ | [gene_counting](notebooks/gene_counting.ipynb) | STARsolo equivalence |
150
+ | [1pz_format](notebooks/1pz_format.ipynb) | Format internals |
151
+ | [doublet_detection](notebooks/doublet_detection.ipynb) | UMI-based doublet detection |
152
+ | [rna_velocity](notebooks/rna_velocity.ipynb) | Spliced/unspliced for scVelo |
153
+ | [cell_calling](notebooks/cell_calling.ipynb) | EmptyDrops deviance testing |
154
+ | + more | QC, ancestry, sex, splicing, saturation, etc. |
155
+
156
+ ## Building from Source
157
+
158
+ ```bash
159
+ # Pipeline binary (C++ — requires htslib, zstd, ncbi-vdb, OpenMP; HDF5 optional)
160
+ source /opt/rh/gcc-toolset-13/enable # RHEL/Rocky — need GCC 13+
161
+ export CONDA_PREFIX=/path/to/conda/env # must have htslib, ncbi-vdb
162
+ export PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
163
+ cmake -B build -DSINGLET_BUILD_PIPELINE=ON -DCMAKE_BUILD_TYPE=Release
164
+ cmake --build build -j$(nproc)
165
+ # Binary: build/src/pipeline/singlet — set $SINGLET_BINARY to it (or put it on
166
+ # $PATH as singlet-pipeline) for singlet.run_pipeline / singlet-process.
167
+
168
+ # C++ tests
169
+ cmake -B build -DSINGLET_BUILD_TESTS=ON
170
+ cmake --build build -j$(nproc) && ctest --test-dir build -j$(nproc)
171
+
172
+ # Python tests
173
+ pip install -e ".[dev]"
174
+ pytest tests/python/
175
+
176
+ # Lint
177
+ make lint
178
+ ```
179
+
180
+ ## License
181
+
182
+ MIT. See [LICENSE](LICENSE). Vendored STAR sources under
183
+ `include/singlet/star/` keep their own licenses.