diffbio 0.1.0__tar.gz → 0.1.2__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 (230) hide show
  1. {diffbio-0.1.0 → diffbio-0.1.2}/.gitignore +8 -0
  2. {diffbio-0.1.0 → diffbio-0.1.2}/PKG-INFO +107 -63
  3. {diffbio-0.1.0 → diffbio-0.1.2}/README.md +86 -41
  4. diffbio-0.1.2/benchmarks/crossmodality/README.md +76 -0
  5. {diffbio-0.1.0 → diffbio-0.1.2}/pyproject.toml +54 -21
  6. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/__init__.py +4 -2
  7. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/base_operators.py +3 -15
  8. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/graph_utils.py +59 -0
  9. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/neural_components.py +3 -19
  10. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/__init__.py +4 -0
  11. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/sorting.py +74 -0
  12. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/straight_through.py +9 -0
  13. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/uncertainty.py +20 -19
  14. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/losses/__init__.py +6 -0
  15. diffbio-0.1.2/src/diffbio/losses/self_supervised_losses.py +80 -0
  16. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/losses/singlecell_losses.py +17 -0
  17. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/losses/statistical_losses.py +34 -23
  18. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/_loss_balancing.py +2 -1
  19. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/drug_discovery/primitives.py +30 -10
  20. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/foundation_models/embedding_probe.py +5 -1
  21. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/metabolomics/__init__.py +16 -0
  22. diffbio-0.1.2/src/diffbio/operators/metabolomics/isotope_envelope.py +174 -0
  23. diffbio-0.1.2/src/diffbio/operators/metabolomics/soft_centroiding.py +195 -0
  24. diffbio-0.1.2/src/diffbio/operators/normalization/__init__.py +96 -0
  25. diffbio-0.1.2/src/diffbio/operators/normalization/arcsinh_cofactor.py +144 -0
  26. diffbio-0.1.2/src/diffbio/operators/normalization/differentiable_pca.py +231 -0
  27. diffbio-0.1.2/src/diffbio/operators/normalization/learnable_normalization.py +160 -0
  28. diffbio-0.1.2/src/diffbio/operators/normalization/learnable_orthogonal_projection.py +127 -0
  29. diffbio-0.1.2/src/diffbio/operators/normalization/learnable_projection.py +125 -0
  30. diffbio-0.1.2/src/diffbio/operators/normalization/matrix_free_pca.py +197 -0
  31. diffbio-0.1.2/src/diffbio/operators/normalization/scaling.py +121 -0
  32. diffbio-0.1.2/src/diffbio/operators/normalization/soft_pca.py +134 -0
  33. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/protein/secondary_structure.py +1 -1
  34. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/__init__.py +16 -0
  35. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/batch_correction.py +2 -6
  36. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/ot_trajectory.py +2 -5
  37. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/soft_clustering.py +2 -10
  38. diffbio-0.1.2/src/diffbio/operators/singlecell/soft_hvg.py +261 -0
  39. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/spatial_domains.py +4 -12
  40. diffbio-0.1.2/src/diffbio/operators/singlecell/stochastic_gate_selector.py +164 -0
  41. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/variant/__init__.py +3 -0
  42. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/variant/cnn_classifier.py +46 -60
  43. diffbio-0.1.2/src/diffbio/operators/variant/learnable_pileup.py +131 -0
  44. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/pipelines/__init__.py +22 -0
  45. diffbio-0.1.2/src/diffbio/pipelines/adapters.py +99 -0
  46. diffbio-0.1.2/src/diffbio/pipelines/joint_preprocessing.py +214 -0
  47. diffbio-0.1.2/src/diffbio/pipelines/joint_training.py +190 -0
  48. diffbio-0.1.2/src/diffbio/pipelines/minibatch_training.py +194 -0
  49. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/pipelines/single_cell.py +0 -29
  50. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/pipelines/variant_calling.py +0 -19
  51. diffbio-0.1.2/src/diffbio/reductions/__init__.py +18 -0
  52. diffbio-0.1.2/src/diffbio/reductions/base.py +36 -0
  53. diffbio-0.1.2/src/diffbio/reductions/pca_reduction.py +79 -0
  54. diffbio-0.1.2/src/diffbio/reductions/tfidf_reduction.py +110 -0
  55. diffbio-0.1.2/src/diffbio/sequences/kmer.py +88 -0
  56. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/bam.py +5 -5
  57. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/perturbation/_types.py +4 -5
  58. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/splitters/random.py +2 -1
  59. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/utils/dependency_runtime.py +1 -1
  60. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/utils/training.py +17 -9
  61. diffbio-0.1.0/src/diffbio/operators/normalization/__init__.py +0 -42
  62. {diffbio-0.1.0 → diffbio-0.1.2}/LICENSE +0 -0
  63. {diffbio-0.1.0 → diffbio-0.1.2}/benchmarks/README.md +0 -0
  64. {diffbio-0.1.0 → diffbio-0.1.2}/examples/README.md +0 -0
  65. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/configs.py +0 -0
  66. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/constants.py +0 -0
  67. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/__init__.py +0 -0
  68. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/data_types.py +0 -0
  69. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/gnn_components.py +0 -0
  70. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/optimal_transport.py +0 -0
  71. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/_projections_permutahedron.py +0 -0
  72. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/_projections_simplex.py +0 -0
  73. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/_projections_transport.py +0 -0
  74. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/_sorting_network.py +0 -0
  75. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/_types.py +0 -0
  76. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/_utils.py +0 -0
  77. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/autograd_safe.py +0 -0
  78. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/comparison.py +0 -0
  79. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/elementwise.py +0 -0
  80. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/logical.py +0 -0
  81. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/quantile.py +0 -0
  82. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/core/soft_ops/selection.py +0 -0
  83. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/evaluation/__init__.py +0 -0
  84. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/evaluation/adapters.py +0 -0
  85. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/evaluation/graders.py +0 -0
  86. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/evaluation/problem.py +0 -0
  87. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/evaluation/runner.py +0 -0
  88. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/losses/alignment_losses.py +0 -0
  89. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/losses/biological_regularization.py +0 -0
  90. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/losses/metric_losses.py +0 -0
  91. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/__init__.py +0 -0
  92. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/_count_vae.py +0 -0
  93. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/_masked_gene_transformer.py +0 -0
  94. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/_transformer_validation.py +0 -0
  95. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/alignment/__init__.py +0 -0
  96. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/alignment/profile_hmm.py +0 -0
  97. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/alignment/scoring.py +0 -0
  98. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/alignment/smith_waterman.py +0 -0
  99. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/alignment/soft_msa.py +0 -0
  100. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/assembly/__init__.py +0 -0
  101. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/assembly/gnn_assembly.py +0 -0
  102. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/assembly/metagenomic_binning.py +0 -0
  103. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/crispr/__init__.py +0 -0
  104. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/crispr/guide_scoring.py +0 -0
  105. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/drug_discovery/__init__.py +0 -0
  106. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/drug_discovery/_graph_utils.py +0 -0
  107. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/drug_discovery/admet_predictor.py +0 -0
  108. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/drug_discovery/attentive_fp.py +0 -0
  109. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/drug_discovery/dti.py +0 -0
  110. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/drug_discovery/fingerprint.py +0 -0
  111. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/drug_discovery/maccs_keys.py +0 -0
  112. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/drug_discovery/message_passing.py +0 -0
  113. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/drug_discovery/property_predictor.py +0 -0
  114. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/drug_discovery/similarity.py +0 -0
  115. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/epigenomics/__init__.py +0 -0
  116. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/epigenomics/chromatin_state.py +0 -0
  117. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/epigenomics/contextual.py +0 -0
  118. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/epigenomics/fno_peak_calling.py +0 -0
  119. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/epigenomics/peak_calling.py +0 -0
  120. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/foundation_models/__init__.py +0 -0
  121. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/foundation_models/adapters.py +0 -0
  122. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/foundation_models/contracts.py +0 -0
  123. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/foundation_models/experimental.py +0 -0
  124. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/foundation_models/foundation_model.py +0 -0
  125. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/foundation_models/frozen.py +0 -0
  126. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/foundation_models/precomputed.py +0 -0
  127. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/foundation_models/transformer_encoder.py +0 -0
  128. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/mapping/__init__.py +0 -0
  129. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/mapping/neural_mapper.py +0 -0
  130. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/metabolomics/spectral_similarity.py +0 -0
  131. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/molecular_dynamics/__init__.py +0 -0
  132. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/molecular_dynamics/force_field.py +0 -0
  133. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/molecular_dynamics/integrator.py +0 -0
  134. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/molecular_dynamics/primitives.py +0 -0
  135. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/multiomics/__init__.py +0 -0
  136. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/multiomics/hic_contact.py +0 -0
  137. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/multiomics/multiomics_vae.py +0 -0
  138. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/multiomics/spatial_deconvolution.py +0 -0
  139. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/multiomics/spatial_gene_detection.py +0 -0
  140. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/normalization/embedding.py +0 -0
  141. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/normalization/phate.py +0 -0
  142. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/normalization/umap.py +0 -0
  143. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/normalization/vae_normalizer.py +0 -0
  144. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/population/__init__.py +0 -0
  145. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/population/ancestry_estimation.py +0 -0
  146. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/preprocessing/__init__.py +0 -0
  147. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/preprocessing/adapter_removal.py +0 -0
  148. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/preprocessing/duplicate_filter.py +0 -0
  149. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/preprocessing/error_correction.py +0 -0
  150. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/protein/__init__.py +0 -0
  151. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/quality_filter.py +0 -0
  152. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/rna_structure/__init__.py +0 -0
  153. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/rna_structure/rna_folding.py +0 -0
  154. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/rnaseq/__init__.py +0 -0
  155. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/rnaseq/motif_discovery.py +0 -0
  156. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/rnaseq/splicing_psi.py +0 -0
  157. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/ambient_removal.py +0 -0
  158. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/archetypes.py +0 -0
  159. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/cell_annotation.py +0 -0
  160. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/communication.py +0 -0
  161. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/differential_distribution.py +0 -0
  162. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/doublet_detection.py +0 -0
  163. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/downsampling.py +0 -0
  164. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/enhanced_batch_correction.py +0 -0
  165. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/grn_inference.py +0 -0
  166. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/imputation.py +0 -0
  167. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/knockdown_filter.py +0 -0
  168. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/simulation.py +0 -0
  169. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/sindy_grn.py +0 -0
  170. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/switch_de.py +0 -0
  171. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/trajectory.py +0 -0
  172. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/singlecell/velocity.py +0 -0
  173. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/statistical/__init__.py +0 -0
  174. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/statistical/em_quantification.py +0 -0
  175. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/statistical/hmm.py +0 -0
  176. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/statistical/nb_glm.py +0 -0
  177. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/variant/classifier.py +0 -0
  178. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/variant/cnv_segmentation.py +0 -0
  179. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/variant/deepvariant_pileup.py +0 -0
  180. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/variant/pileup.py +0 -0
  181. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/operators/variant/quality_recalibration.py +0 -0
  182. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/pipelines/differential_expression.py +0 -0
  183. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/pipelines/enhanced_variant_calling.py +0 -0
  184. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/pipelines/perturbation.py +0 -0
  185. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/pipelines/preprocessing.py +0 -0
  186. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/samplers/__init__.py +0 -0
  187. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/samplers/perturbation_sampler.py +0 -0
  188. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sequences/__init__.py +0 -0
  189. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sequences/dna.py +0 -0
  190. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/__init__.py +0 -0
  191. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/_anndata_shared.py +0 -0
  192. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/_batch_iteration.py +0 -0
  193. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/_benchmark_source.py +0 -0
  194. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/_indexed_batch_source.py +0 -0
  195. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/_utils.py +0 -0
  196. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/anndata_interop.py +0 -0
  197. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/anndata_source.py +0 -0
  198. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/archive_ii.py +0 -0
  199. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/balifam.py +0 -0
  200. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/bengrn_ground_truth.py +0 -0
  201. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/contextual_epigenomics.py +0 -0
  202. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/dti.py +0 -0
  203. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/embeddings.py +0 -0
  204. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/encode_peaks.py +0 -0
  205. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/fasta.py +0 -0
  206. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/immune_human.py +0 -0
  207. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/indexed_embeddings.py +0 -0
  208. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/indexed_view.py +0 -0
  209. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/molnet.py +0 -0
  210. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/multiomics.py +0 -0
  211. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/pancreas.py +0 -0
  212. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/perturbation/__init__.py +0 -0
  213. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/perturbation/_utils.py +0 -0
  214. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/perturbation/concat_source.py +0 -0
  215. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/perturbation/control_mapping.py +0 -0
  216. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/perturbation/experiment_config.py +0 -0
  217. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/perturbation/h5_metadata_cache.py +0 -0
  218. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/perturbation/output_space.py +0 -0
  219. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/perturbation/perturbation_source.py +0 -0
  220. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/seqfish.py +0 -0
  221. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/sequence_foundation.py +0 -0
  222. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/sources/singlecell_foundation.py +0 -0
  223. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/splitters/__init__.py +0 -0
  224. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/splitters/base.py +0 -0
  225. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/splitters/molecular.py +0 -0
  226. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/splitters/perturbation.py +0 -0
  227. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/splitters/sequence.py +0 -0
  228. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/utils/__init__.py +0 -0
  229. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/utils/nn_utils.py +0 -0
  230. {diffbio-0.1.0 → diffbio-0.1.2}/src/diffbio/utils/quality.py +0 -0
@@ -217,3 +217,11 @@ CLAUDE.md
217
217
  # Benchmark results (generated)
218
218
  benchmarks/results/
219
219
  data/
220
+
221
+ # Local tracer-bullet tickets and scratch work
222
+ .scratch/
223
+
224
+ # Private working notes and per-editor assistant configuration. Local only.
225
+ .claude/
226
+ .cursor/
227
+ AGENTS.md
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: diffbio
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: DiffBio: End-to-end differentiable bioinformatics pipelines built on Datarax, Artifex, Opifex, and Calibrax
5
5
  Project-URL: Bug Tracker, https://github.com/avitai/DiffBio/issues
6
6
  Project-URL: Documentation, https://diffbio.readthedocs.io
@@ -35,40 +35,38 @@ Classifier: Intended Audience :: Education
35
35
  Classifier: Intended Audience :: Science/Research
36
36
  Classifier: License :: OSI Approved :: MIT License
37
37
  Classifier: Programming Language :: Python :: 3 :: Only
38
- Classifier: Programming Language :: Python :: 3.11
39
38
  Classifier: Programming Language :: Python :: 3.12
39
+ Classifier: Programming Language :: Python :: 3.13
40
40
  Classifier: Topic :: Scientific/Engineering
41
41
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
42
42
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
43
43
  Classifier: Topic :: Software Development
44
44
  Classifier: Topic :: Software Development :: Libraries
45
45
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
46
- Requires-Python: >=3.11
46
+ Requires-Python: <3.14,>=3.12
47
47
  Requires-Dist: anndata>=0.9.1
48
- Requires-Dist: avitai-artifex>=0.1.0
48
+ Requires-Dist: avitai-artifex>=0.1.5
49
49
  Requires-Dist: beartype>=0.14.1
50
50
  Requires-Dist: biopython>=1.81
51
- Requires-Dist: calibrax>=0.1.1
51
+ Requires-Dist: calibrax>=0.1.5
52
52
  Requires-Dist: chex>=0.1.7
53
- Requires-Dist: datarax>=0.1.3
54
- Requires-Dist: flax>=0.12.0
53
+ Requires-Dist: datarax>=0.1.6
54
+ Requires-Dist: flax>=0.12.9
55
55
  Requires-Dist: h5py>=3.7
56
56
  Requires-Dist: jax-md>=0.2.27
57
- Requires-Dist: jax>=0.6.1
57
+ Requires-Dist: jax>=0.11.1
58
58
  Requires-Dist: jaxtyping>=0.2.20
59
59
  Requires-Dist: numpy>=1.24
60
- Requires-Dist: opifex>=0.1.0
61
- Requires-Dist: optax>=0.1.4
62
- Requires-Dist: orbax-checkpoint>=0.11.10
63
- Requires-Dist: pre-commit>=4.3.0
64
- Requires-Dist: rdkit>=2025.9.3
65
- Requires-Dist: ruff>=0.1.5
60
+ Requires-Dist: opifex>=0.2.2
61
+ Requires-Dist: optax>=0.2.8
66
62
  Requires-Dist: scipy>=1.10
63
+ Requires-Dist: substrax>=0.1.5
67
64
  Provides-Extra: all
68
65
  Requires-Dist: bandit[toml]>=1.8.6; extra == 'all'
69
66
  Requires-Dist: beartype>=0.14.1; extra == 'all'
70
67
  Requires-Dist: build>=1.0.3; extra == 'all'
71
68
  Requires-Dist: coverage>=7; extra == 'all'
69
+ Requires-Dist: datasets>=2.14; extra == 'all'
72
70
  Requires-Dist: deepchem>=2.8.0; extra == 'all'
73
71
  Requires-Dist: flake8-functions-names>=0.4; extra == 'all'
74
72
  Requires-Dist: flake8>=7.0; extra == 'all'
@@ -76,8 +74,7 @@ Requires-Dist: griffe>=1.7.3; extra == 'all'
76
74
  Requires-Dist: import-linter>=2.5; extra == 'all'
77
75
  Requires-Dist: interrogate>=1.7.0; extra == 'all'
78
76
  Requires-Dist: ipykernel>=6.29.5; extra == 'all'
79
- Requires-Dist: jax[cuda12]>=0.6.1; extra == 'all'
80
- Requires-Dist: jaxlib>=0.6.1; extra == 'all'
77
+ Requires-Dist: jax[cuda12]>=0.11.1; extra == 'all'
81
78
  Requires-Dist: lineax>=0.0.8; extra == 'all'
82
79
  Requires-Dist: matplotlib>=3.7; extra == 'all'
83
80
  Requires-Dist: mkdocs-include-exclude-files>=0.1; extra == 'all'
@@ -105,6 +102,7 @@ Requires-Dist: pytest-xdist>=3.6; extra == 'all'
105
102
  Requires-Dist: pytest>=8.3.5; extra == 'all'
106
103
  Requires-Dist: python-dotenv>=1; extra == 'all'
107
104
  Requires-Dist: radon>=6.0.1; extra == 'all'
105
+ Requires-Dist: rdkit>=2025.9.3; extra == 'all'
108
106
  Requires-Dist: ruff>=0.1.5; extra == 'all'
109
107
  Requires-Dist: scib-metrics>=0.5; extra == 'all'
110
108
  Requires-Dist: shellcheck-py>=0.10.0.1; extra == 'all'
@@ -113,6 +111,7 @@ Requires-Dist: tabulate>=0.9; extra == 'all'
113
111
  Requires-Dist: torch>=1.13.0; extra == 'all'
114
112
  Requires-Dist: wemake-python-styleguide>=1.0; extra == 'all'
115
113
  Provides-Extra: benchmark
114
+ Requires-Dist: datasets>=2.14; extra == 'benchmark'
116
115
  Requires-Dist: deepchem>=2.8.0; extra == 'benchmark'
117
116
  Requires-Dist: matplotlib>=3.7; extra == 'benchmark'
118
117
  Requires-Dist: pandas>=2.0; extra == 'benchmark'
@@ -120,6 +119,8 @@ Requires-Dist: pynndescent>=0.5; extra == 'benchmark'
120
119
  Requires-Dist: scib-metrics>=0.5; extra == 'benchmark'
121
120
  Requires-Dist: squidpy>=1.4; extra == 'benchmark'
122
121
  Requires-Dist: tabulate>=0.9; extra == 'benchmark'
122
+ Provides-Extra: chem
123
+ Requires-Dist: rdkit>=2025.9.3; extra == 'chem'
123
124
  Provides-Extra: cuda-dev
124
125
  Requires-Dist: bandit[toml]>=1.8.6; extra == 'cuda-dev'
125
126
  Requires-Dist: build>=1.0.3; extra == 'cuda-dev'
@@ -129,8 +130,7 @@ Requires-Dist: flake8>=7.0; extra == 'cuda-dev'
129
130
  Requires-Dist: import-linter>=2.5; extra == 'cuda-dev'
130
131
  Requires-Dist: interrogate>=1.7.0; extra == 'cuda-dev'
131
132
  Requires-Dist: ipykernel>=6.29.5; extra == 'cuda-dev'
132
- Requires-Dist: jax[cuda12]>=0.6.1; extra == 'cuda-dev'
133
- Requires-Dist: jaxlib>=0.6.1; extra == 'cuda-dev'
133
+ Requires-Dist: jax[cuda12]>=0.11.1; extra == 'cuda-dev'
134
134
  Requires-Dist: pylint>=3.3.8; extra == 'cuda-dev'
135
135
  Requires-Dist: pyright>=1.1.336; extra == 'cuda-dev'
136
136
  Requires-Dist: pytest-asyncio>=0.23; extra == 'cuda-dev'
@@ -147,6 +147,8 @@ Requires-Dist: radon>=6.0.1; extra == 'cuda-dev'
147
147
  Requires-Dist: ruff>=0.1.5; extra == 'cuda-dev'
148
148
  Requires-Dist: shellcheck-py>=0.10.0.1; extra == 'cuda-dev'
149
149
  Requires-Dist: wemake-python-styleguide>=1.0; extra == 'cuda-dev'
150
+ Provides-Extra: cuda12
151
+ Requires-Dist: jax[cuda12]>=0.11.1; extra == 'cuda12'
150
152
  Provides-Extra: dev
151
153
  Requires-Dist: bandit[toml]>=1.8.6; extra == 'dev'
152
154
  Requires-Dist: build>=1.0.3; extra == 'dev'
@@ -183,9 +185,6 @@ Requires-Dist: pymdown-extensions>=10.14.3; extra == 'docs'
183
185
  Provides-Extra: genomics
184
186
  Requires-Dist: pyfaidx>=0.8.0; extra == 'genomics'
185
187
  Requires-Dist: pysam>=0.22.0; extra == 'genomics'
186
- Provides-Extra: gpu
187
- Requires-Dist: jax[cuda12]>=0.6.1; extra == 'gpu'
188
- Requires-Dist: jaxlib>=0.6.1; extra == 'gpu'
189
188
  Provides-Extra: soft-ops-advanced
190
189
  Requires-Dist: lineax>=0.0.8; extra == 'soft-ops-advanced'
191
190
  Requires-Dist: optimistix>=0.0.9; extra == 'soft-ops-advanced'
@@ -211,7 +210,7 @@ Description-Content-Type: text/markdown
211
210
  # DiffBio
212
211
 
213
212
  <p align="center">
214
- <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.11+-blue.svg" alt="Python 3.11+"></a>
213
+ <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.12+-blue.svg" alt="Python 3.12+"></a>
215
214
  <a href="https://jax.readthedocs.io/"><img src="https://img.shields.io/badge/JAX-0.6.1+-green.svg" alt="JAX"></a>
216
215
  <a href="https://flax.readthedocs.io/"><img src="https://img.shields.io/badge/Flax-0.12+-orange.svg" alt="Flax"></a>
217
216
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a>
@@ -222,11 +221,28 @@ Description-Content-Type: text/markdown
222
221
  </p>
223
222
 
224
223
  <p align="center">
225
- Built on <a href="https://github.com/avitai/datarax">Datarax</a>, <a href="https://github.com/avitai/artifex">Artifex</a>, <a href="https://github.com/avitai/Opifex">Opifex</a>, and <a href="https://github.com/avitai/calibrax">Calibrax</a> | Powered by <a href="https://jax.readthedocs.io/">JAX</a> & <a href="https://flax.readthedocs.io/">Flax NNX</a>
224
+ Built on <a href="https://github.com/avitai/datarax">Datarax</a>, <a href="https://github.com/avitai/artifex">Artifex</a>, <a href="https://github.com/avitai/opifex">Opifex</a>, and <a href="https://github.com/avitai/calibrax">Calibrax</a> | Powered by <a href="https://jax.readthedocs.io/">JAX</a> & <a href="https://flax.readthedocs.io/">Flax NNX</a>
226
225
  </p>
227
226
 
228
227
  ---
229
228
 
229
+ > **Research preview.** DiffBio is under rapid iteration and the API will change while we iterate
230
+ > toward v1.0. What that means concretely:
231
+ >
232
+ > | Area | Status | Impact |
233
+ > |------|--------|--------|
234
+ > | **API** | 🔄 Unstable | Breaking changes are expected. Public interfaces may change without deprecation warnings. Pin to specific commits if stability is required. |
235
+ > | **Tests** | 🔄 In Flux | Test suite is being expanded. Some tests may fail or be skipped. Coverage metrics are improving but not yet full. |
236
+ > | **Documentation** | 🔄 Evolving | Docs may not reflect current implementation. Code examples might be outdated. Refer to source code and tests for accurate usage. |
237
+ >
238
+ > Pin a version if you need stability, and do not put it in production yet. For research and
239
+ > experimentation it is ready to use today, with the understanding that APIs will evolve.
240
+ >
241
+ > This is public this early on purpose. Issues, questions and pull requests genuinely steer
242
+ > what gets built next, and a star tells us which layer to push on.
243
+
244
+ ---
245
+
230
246
  ## Overview
231
247
 
232
248
  DiffBio is a framework for building **end-to-end differentiable bioinformatics
@@ -258,17 +274,18 @@ This enables learning optimal pipeline parameters directly from data, rather tha
258
274
  - **Composable Architecture** built on the Datarax, Artifex, Opifex, and Calibrax stack
259
275
  - **Training Utilities** with gradient clipping, custom loss functions, and synthetic data generation
260
276
 
261
- For complete operator and pipeline listings, see the [Operators Overview](https://docs.avitai.bio/diffbio/user-guide/operators/overview/) and [Pipelines Overview](https://docs.avitai.bio/diffbio/user-guide/pipelines/overview/) in the documentation.
277
+ For complete operator and pipeline listings, see the [Operators Overview](https://diffbio.readthedocs.io/en/latest/user-guide/operators/overview/) and [Pipelines Overview](https://diffbio.readthedocs.io/en/latest/user-guide/pipelines/overview/) in the documentation.
262
278
 
263
279
  ## Installation
264
280
 
265
281
  ```bash
266
- # Clone the repository
282
+ # From PyPI
283
+ uv add diffbio # or: pip install diffbio
284
+
285
+ # From source
267
286
  git clone https://github.com/avitai/DiffBio.git
268
287
  cd DiffBio
269
-
270
- # Install with uv
271
- uv sync
288
+ ./setup.sh # detects the backend and syncs the extras
272
289
  ```
273
290
 
274
291
  ## Quick Start
@@ -280,24 +297,22 @@ import jax
280
297
  import jax.numpy as jnp
281
298
  from flax import nnx
282
299
 
283
- from diffbio.operators import DifferentiableQualityFilter
284
- from diffbio.operators.variant.pileup import DifferentiablePileup
285
- from diffbio.operators.alignment.smith_waterman import SmoothSmithWaterman
300
+ from diffbio.operators import DifferentiableQualityFilter, QualityFilterConfig
286
301
 
287
- # Quality filtering with learnable threshold
302
+ # Quality filtering with learnable threshold (default initial_threshold=20.0)
288
303
  quality_filter = DifferentiableQualityFilter(
289
- threshold=20.0,
290
- temperature=1.0,
304
+ QualityFilterConfig(initial_threshold=20.0),
291
305
  rngs=nnx.Rngs(0),
292
306
  )
293
307
 
294
- # Apply to reads
308
+ # Apply to a one-hot encoded sequence with per-position quality scores
295
309
  quality_scores = jnp.array([35.0, 15.0, 28.0, 10.0])
296
- reads = jax.nn.one_hot(jnp.array([[0, 1, 2, 3]] * 4), 4)
297
- data = {"reads": reads, "quality": quality_scores}
310
+ sequence = jax.nn.one_hot(jnp.array([0, 1, 2, 3]), 4) # (length, alphabet=4)
311
+ data = {"sequence": sequence, "quality_scores": quality_scores}
298
312
 
299
313
  filtered_data, _, _ = quality_filter.apply(data, {}, None)
300
- # filtered_data["weights"] contains soft weights for each read
314
+ # filtered_data["sequence"] - sequence with low-quality positions softly suppressed
315
+ # filtered_data["quality_scores"] - pass-through quality values
301
316
  ```
302
317
 
303
318
  ### Using the Variant Calling Pipeline
@@ -386,9 +401,12 @@ DiffBio sits on a layered ecosystem rather than standing alone:
386
401
  |---|---|---|
387
402
  | Execution contracts | [Datarax](https://github.com/avitai/datarax) | Operator, data-source, and pipeline contracts |
388
403
  | Modeling substrate | [Artifex](https://github.com/avitai/artifex) | Reusable transformer and generative-model components |
389
- | Scientific ML substrate | [Opifex](https://github.com/avitai/Opifex) | Scientific optimization, operator learning, and advanced training methods |
404
+ | Scientific ML substrate | [Opifex](https://github.com/avitai/opifex) | Scientific optimization, operator learning, and advanced training methods |
390
405
  | Evaluation substrate | [Calibrax](https://github.com/avitai/calibrax) | Metrics, benchmarking, comparison, profiling, and regression checks |
391
- | Biology-specific layer | DiffBio | Differentiable biological operators and domain compositions |
406
+
407
+ DiffBio itself sits on top of these as the biology-specific layer: differentiable
408
+ biological operators and end-to-end pipeline compositions (alignment, variant
409
+ calling, single-cell analysis, drug discovery, structural biology, multi-omics).
392
410
 
393
411
  Each DiffBio operator inherits from Datarax's `OperatorModule` and implements:
394
412
 
@@ -403,18 +421,31 @@ This enables:
403
421
 
404
422
  ### Operator Composition
405
423
 
406
- Operators are chained by threading the `(data, state, metadata)` triple
407
- returned by `apply()` into the next operator:
424
+ `apply()` runs an operator on a single element (no batch dimension). Operators
425
+ are chained by threading the `(data, state, metadata)` triple returned by
426
+ `apply()` into the next operator:
408
427
 
409
428
  ```python
410
- data, state, metadata = quality_filter.apply(batch_data, {}, None)
429
+ data, state, metadata = quality_filter.apply(element_data, {}, None)
411
430
  data, state, metadata = pileup.apply(data, state, metadata)
412
431
  data, state, metadata = classifier.apply(data, state, metadata)
413
432
 
414
- # `data` is a dict of JAX arrays read out the per-position predictions
433
+ # `data` is a dict of JAX arrays - read out the per-position predictions
415
434
  predictions = data["logits"]
416
435
  ```
417
436
 
437
+ For batched data wrapped in a Datarax `Batch`, call the operator directly
438
+ (or use `apply_batch()`); both delegate to the same code path:
439
+
440
+ ```python
441
+ from datarax import Batch
442
+
443
+ batch = Batch.from_parts(...) # construct from a list of elements
444
+ batch = quality_filter(batch) # equivalent to quality_filter.apply_batch(batch)
445
+ batch = pileup(batch)
446
+ batch = classifier(batch)
447
+ ```
448
+
418
449
  ## Testing
419
450
 
420
451
  ```bash
@@ -435,35 +466,49 @@ uv run pytest tests/integration/ -vv
435
466
  ```
436
467
  DiffBio/
437
468
  ├── src/diffbio/
438
- │ ├── core/ # Base operators, graph utils, soft ops
439
- │ ├── operators/ # 35+ differentiable operators
469
+ │ ├── core/ # Base operators, graph utils, soft ops, neural components
470
+ │ ├── operators/ # 40+ differentiable operators
440
471
  │ │ ├── alignment/ # Smith-Waterman, profile HMM, soft MSA
441
- │ │ ├── variant/ # Pileup, classifiers, CNV segmentation
442
- │ │ ├── singlecell/ # Clustering, trajectory, velocity, GRN, ...
443
- │ │ ├── drug_discovery/ # Fingerprints, property prediction, ADMET
444
- │ │ ├── epigenomics/ # Peak calling, chromatin state
445
- │ │ ├── normalization/ # VAE normalizer, UMAP, PHATE
472
+ │ │ ├── assembly/ # GNN assembly, metagenomic binning
473
+ │ │ ├── crispr/ # Guide RNA scoring
474
+ │ │ ├── drug_discovery/ # Fingerprints, ADMET, AttentiveFP, MACCS keys
475
+ │ │ ├── epigenomics/ # Peak calling, chromatin state, contextual epigenomics
476
+ │ │ ├── foundation_models/ # Geneformer/scGPT adapters, transformer encoders
477
+ │ │ ├── mapping/ # Neural read mapping
478
+ │ │ ├── metabolomics/ # Spectral similarity
479
+ │ │ ├── molecular_dynamics/ # Force fields, MD integrators
480
+ │ │ ├── multiomics/ # Hi-C, spatial deconvolution, multi-omics VAE
481
+ │ │ ├── normalization/ # VAE normalizer, UMAP, PHATE, embeddings
482
+ │ │ ├── population/ # Ancestry estimation
483
+ │ │ ├── preprocessing/ # Adapter removal, duplicate weighting, error correction
484
+ │ │ ├── protein/ # Secondary structure
485
+ │ │ ├── rna_structure/ # RNA folding
486
+ │ │ ├── rnaseq/ # Splicing PSI, motif discovery
487
+ │ │ ├── singlecell/ # Clustering, trajectory, velocity, GRN, batch correction, ...
446
488
  │ │ ├── statistical/ # HMM, NB GLM, EM quantification
447
- │ │ ├── multiomics/ # Hi-C, spatial deconvolution
448
- │ └── ... # preprocessing, protein, RNA, assembly, ...
449
- │ ├── pipelines/ # End-to-end pipelines
450
- │ ├── losses/ # Alignment, single-cell, statistical losses
451
- │ ├── sources/ # Data loaders (FASTA, BAM, MolNet, ...)
452
- │ ├── splitters/ # Dataset splitting strategies
453
- └── utils/ # Training utilities
489
+ │ │ └── variant/ # Pileup, classifiers, CNV segmentation
490
+ ├── pipelines/ # 6 end-to-end pipelines
491
+ │ ├── losses/ # Alignment, biological-regularization, single-cell, statistical, metric
492
+ │ ├── sources/ # Data loaders (FASTA, BAM, AnnData, MoleculeNet, indexed views)
493
+ │ ├── splitters/ # Random, stratified, scaffold, Tanimoto, sequence-identity
494
+ │ ├── samplers/ # Perturbation samplers
495
+ ├── sequences/ # DNA / RNA encoding utilities
496
+ │ ├── evaluation/ # Evaluation runner and graders
497
+ │ └── utils/ # Training utilities, dependency-runtime checks
454
498
  ├── tests/ # Unit, integration, and benchmark tests
455
499
  ├── benchmarks/ # Domain benchmarks with training + baselines
500
+ ├── examples/ # Runnable example scripts paired with notebooks
456
501
  └── docs/ # MkDocs documentation
457
502
  ```
458
503
 
459
504
  ## Requirements
460
505
 
461
- - Python 3.11+
506
+ - Python 3.12+
462
507
  - JAX 0.6.1+
463
508
  - Flax 0.12+
464
509
  - Optax 0.1.4+
465
510
  - jaxtyping 0.2.20+
466
- - Datarax, Artifex, Opifex, and Calibrax (installed automatically from PyPI)
511
+ - Datarax, Artifex, Opifex, Calibrax and Substrax (installed automatically from PyPI)
467
512
 
468
513
  ## License
469
514
 
@@ -472,9 +517,8 @@ MIT License. See [LICENSE](LICENSE) for details.
472
517
  ## Acknowledgments
473
518
 
474
519
  DiffBio builds on ideas from:
475
- - [SMURF](https://www.biorxiv.org/content/10.1101/2021.10.23.465204): Differentiable Smith-Waterman for end-to-end MSA learning
476
520
  - [Datarax](https://github.com/avitai/datarax): Composable data processing framework
477
521
  - [Artifex](https://github.com/avitai/artifex): Generative-model and transformer substrate
478
- - [Opifex](https://github.com/avitai/Opifex): Scientific ML and advanced optimization substrate
522
+ - [Opifex](https://github.com/avitai/opifex): Scientific ML and advanced optimization substrate
479
523
  - [Calibrax](https://github.com/avitai/calibrax): Benchmarking, comparison, and regression substrate
480
524
  - [Flax NNX](https://flax.readthedocs.io/): Neural network library for JAX
@@ -1,7 +1,7 @@
1
1
  # DiffBio
2
2
 
3
3
  <p align="center">
4
- <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.11+-blue.svg" alt="Python 3.11+"></a>
4
+ <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.12+-blue.svg" alt="Python 3.12+"></a>
5
5
  <a href="https://jax.readthedocs.io/"><img src="https://img.shields.io/badge/JAX-0.6.1+-green.svg" alt="JAX"></a>
6
6
  <a href="https://flax.readthedocs.io/"><img src="https://img.shields.io/badge/Flax-0.12+-orange.svg" alt="Flax"></a>
7
7
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a>
@@ -12,11 +12,28 @@
12
12
  </p>
13
13
 
14
14
  <p align="center">
15
- Built on <a href="https://github.com/avitai/datarax">Datarax</a>, <a href="https://github.com/avitai/artifex">Artifex</a>, <a href="https://github.com/avitai/Opifex">Opifex</a>, and <a href="https://github.com/avitai/calibrax">Calibrax</a> | Powered by <a href="https://jax.readthedocs.io/">JAX</a> & <a href="https://flax.readthedocs.io/">Flax NNX</a>
15
+ Built on <a href="https://github.com/avitai/datarax">Datarax</a>, <a href="https://github.com/avitai/artifex">Artifex</a>, <a href="https://github.com/avitai/opifex">Opifex</a>, and <a href="https://github.com/avitai/calibrax">Calibrax</a> | Powered by <a href="https://jax.readthedocs.io/">JAX</a> & <a href="https://flax.readthedocs.io/">Flax NNX</a>
16
16
  </p>
17
17
 
18
18
  ---
19
19
 
20
+ > **Research preview.** DiffBio is under rapid iteration and the API will change while we iterate
21
+ > toward v1.0. What that means concretely:
22
+ >
23
+ > | Area | Status | Impact |
24
+ > |------|--------|--------|
25
+ > | **API** | 🔄 Unstable | Breaking changes are expected. Public interfaces may change without deprecation warnings. Pin to specific commits if stability is required. |
26
+ > | **Tests** | 🔄 In Flux | Test suite is being expanded. Some tests may fail or be skipped. Coverage metrics are improving but not yet full. |
27
+ > | **Documentation** | 🔄 Evolving | Docs may not reflect current implementation. Code examples might be outdated. Refer to source code and tests for accurate usage. |
28
+ >
29
+ > Pin a version if you need stability, and do not put it in production yet. For research and
30
+ > experimentation it is ready to use today, with the understanding that APIs will evolve.
31
+ >
32
+ > This is public this early on purpose. Issues, questions and pull requests genuinely steer
33
+ > what gets built next, and a star tells us which layer to push on.
34
+
35
+ ---
36
+
20
37
  ## Overview
21
38
 
22
39
  DiffBio is a framework for building **end-to-end differentiable bioinformatics
@@ -48,17 +65,18 @@ This enables learning optimal pipeline parameters directly from data, rather tha
48
65
  - **Composable Architecture** built on the Datarax, Artifex, Opifex, and Calibrax stack
49
66
  - **Training Utilities** with gradient clipping, custom loss functions, and synthetic data generation
50
67
 
51
- For complete operator and pipeline listings, see the [Operators Overview](https://docs.avitai.bio/diffbio/user-guide/operators/overview/) and [Pipelines Overview](https://docs.avitai.bio/diffbio/user-guide/pipelines/overview/) in the documentation.
68
+ For complete operator and pipeline listings, see the [Operators Overview](https://diffbio.readthedocs.io/en/latest/user-guide/operators/overview/) and [Pipelines Overview](https://diffbio.readthedocs.io/en/latest/user-guide/pipelines/overview/) in the documentation.
52
69
 
53
70
  ## Installation
54
71
 
55
72
  ```bash
56
- # Clone the repository
73
+ # From PyPI
74
+ uv add diffbio # or: pip install diffbio
75
+
76
+ # From source
57
77
  git clone https://github.com/avitai/DiffBio.git
58
78
  cd DiffBio
59
-
60
- # Install with uv
61
- uv sync
79
+ ./setup.sh # detects the backend and syncs the extras
62
80
  ```
63
81
 
64
82
  ## Quick Start
@@ -70,24 +88,22 @@ import jax
70
88
  import jax.numpy as jnp
71
89
  from flax import nnx
72
90
 
73
- from diffbio.operators import DifferentiableQualityFilter
74
- from diffbio.operators.variant.pileup import DifferentiablePileup
75
- from diffbio.operators.alignment.smith_waterman import SmoothSmithWaterman
91
+ from diffbio.operators import DifferentiableQualityFilter, QualityFilterConfig
76
92
 
77
- # Quality filtering with learnable threshold
93
+ # Quality filtering with learnable threshold (default initial_threshold=20.0)
78
94
  quality_filter = DifferentiableQualityFilter(
79
- threshold=20.0,
80
- temperature=1.0,
95
+ QualityFilterConfig(initial_threshold=20.0),
81
96
  rngs=nnx.Rngs(0),
82
97
  )
83
98
 
84
- # Apply to reads
99
+ # Apply to a one-hot encoded sequence with per-position quality scores
85
100
  quality_scores = jnp.array([35.0, 15.0, 28.0, 10.0])
86
- reads = jax.nn.one_hot(jnp.array([[0, 1, 2, 3]] * 4), 4)
87
- data = {"reads": reads, "quality": quality_scores}
101
+ sequence = jax.nn.one_hot(jnp.array([0, 1, 2, 3]), 4) # (length, alphabet=4)
102
+ data = {"sequence": sequence, "quality_scores": quality_scores}
88
103
 
89
104
  filtered_data, _, _ = quality_filter.apply(data, {}, None)
90
- # filtered_data["weights"] contains soft weights for each read
105
+ # filtered_data["sequence"] - sequence with low-quality positions softly suppressed
106
+ # filtered_data["quality_scores"] - pass-through quality values
91
107
  ```
92
108
 
93
109
  ### Using the Variant Calling Pipeline
@@ -176,9 +192,12 @@ DiffBio sits on a layered ecosystem rather than standing alone:
176
192
  |---|---|---|
177
193
  | Execution contracts | [Datarax](https://github.com/avitai/datarax) | Operator, data-source, and pipeline contracts |
178
194
  | Modeling substrate | [Artifex](https://github.com/avitai/artifex) | Reusable transformer and generative-model components |
179
- | Scientific ML substrate | [Opifex](https://github.com/avitai/Opifex) | Scientific optimization, operator learning, and advanced training methods |
195
+ | Scientific ML substrate | [Opifex](https://github.com/avitai/opifex) | Scientific optimization, operator learning, and advanced training methods |
180
196
  | Evaluation substrate | [Calibrax](https://github.com/avitai/calibrax) | Metrics, benchmarking, comparison, profiling, and regression checks |
181
- | Biology-specific layer | DiffBio | Differentiable biological operators and domain compositions |
197
+
198
+ DiffBio itself sits on top of these as the biology-specific layer: differentiable
199
+ biological operators and end-to-end pipeline compositions (alignment, variant
200
+ calling, single-cell analysis, drug discovery, structural biology, multi-omics).
182
201
 
183
202
  Each DiffBio operator inherits from Datarax's `OperatorModule` and implements:
184
203
 
@@ -193,18 +212,31 @@ This enables:
193
212
 
194
213
  ### Operator Composition
195
214
 
196
- Operators are chained by threading the `(data, state, metadata)` triple
197
- returned by `apply()` into the next operator:
215
+ `apply()` runs an operator on a single element (no batch dimension). Operators
216
+ are chained by threading the `(data, state, metadata)` triple returned by
217
+ `apply()` into the next operator:
198
218
 
199
219
  ```python
200
- data, state, metadata = quality_filter.apply(batch_data, {}, None)
220
+ data, state, metadata = quality_filter.apply(element_data, {}, None)
201
221
  data, state, metadata = pileup.apply(data, state, metadata)
202
222
  data, state, metadata = classifier.apply(data, state, metadata)
203
223
 
204
- # `data` is a dict of JAX arrays read out the per-position predictions
224
+ # `data` is a dict of JAX arrays - read out the per-position predictions
205
225
  predictions = data["logits"]
206
226
  ```
207
227
 
228
+ For batched data wrapped in a Datarax `Batch`, call the operator directly
229
+ (or use `apply_batch()`); both delegate to the same code path:
230
+
231
+ ```python
232
+ from datarax import Batch
233
+
234
+ batch = Batch.from_parts(...) # construct from a list of elements
235
+ batch = quality_filter(batch) # equivalent to quality_filter.apply_batch(batch)
236
+ batch = pileup(batch)
237
+ batch = classifier(batch)
238
+ ```
239
+
208
240
  ## Testing
209
241
 
210
242
  ```bash
@@ -225,35 +257,49 @@ uv run pytest tests/integration/ -vv
225
257
  ```
226
258
  DiffBio/
227
259
  ├── src/diffbio/
228
- │ ├── core/ # Base operators, graph utils, soft ops
229
- │ ├── operators/ # 35+ differentiable operators
260
+ │ ├── core/ # Base operators, graph utils, soft ops, neural components
261
+ │ ├── operators/ # 40+ differentiable operators
230
262
  │ │ ├── alignment/ # Smith-Waterman, profile HMM, soft MSA
231
- │ │ ├── variant/ # Pileup, classifiers, CNV segmentation
232
- │ │ ├── singlecell/ # Clustering, trajectory, velocity, GRN, ...
233
- │ │ ├── drug_discovery/ # Fingerprints, property prediction, ADMET
234
- │ │ ├── epigenomics/ # Peak calling, chromatin state
235
- │ │ ├── normalization/ # VAE normalizer, UMAP, PHATE
263
+ │ │ ├── assembly/ # GNN assembly, metagenomic binning
264
+ │ │ ├── crispr/ # Guide RNA scoring
265
+ │ │ ├── drug_discovery/ # Fingerprints, ADMET, AttentiveFP, MACCS keys
266
+ │ │ ├── epigenomics/ # Peak calling, chromatin state, contextual epigenomics
267
+ │ │ ├── foundation_models/ # Geneformer/scGPT adapters, transformer encoders
268
+ │ │ ├── mapping/ # Neural read mapping
269
+ │ │ ├── metabolomics/ # Spectral similarity
270
+ │ │ ├── molecular_dynamics/ # Force fields, MD integrators
271
+ │ │ ├── multiomics/ # Hi-C, spatial deconvolution, multi-omics VAE
272
+ │ │ ├── normalization/ # VAE normalizer, UMAP, PHATE, embeddings
273
+ │ │ ├── population/ # Ancestry estimation
274
+ │ │ ├── preprocessing/ # Adapter removal, duplicate weighting, error correction
275
+ │ │ ├── protein/ # Secondary structure
276
+ │ │ ├── rna_structure/ # RNA folding
277
+ │ │ ├── rnaseq/ # Splicing PSI, motif discovery
278
+ │ │ ├── singlecell/ # Clustering, trajectory, velocity, GRN, batch correction, ...
236
279
  │ │ ├── statistical/ # HMM, NB GLM, EM quantification
237
- │ │ ├── multiomics/ # Hi-C, spatial deconvolution
238
- │ └── ... # preprocessing, protein, RNA, assembly, ...
239
- │ ├── pipelines/ # End-to-end pipelines
240
- │ ├── losses/ # Alignment, single-cell, statistical losses
241
- │ ├── sources/ # Data loaders (FASTA, BAM, MolNet, ...)
242
- │ ├── splitters/ # Dataset splitting strategies
243
- └── utils/ # Training utilities
280
+ │ │ └── variant/ # Pileup, classifiers, CNV segmentation
281
+ ├── pipelines/ # 6 end-to-end pipelines
282
+ │ ├── losses/ # Alignment, biological-regularization, single-cell, statistical, metric
283
+ │ ├── sources/ # Data loaders (FASTA, BAM, AnnData, MoleculeNet, indexed views)
284
+ │ ├── splitters/ # Random, stratified, scaffold, Tanimoto, sequence-identity
285
+ │ ├── samplers/ # Perturbation samplers
286
+ ├── sequences/ # DNA / RNA encoding utilities
287
+ │ ├── evaluation/ # Evaluation runner and graders
288
+ │ └── utils/ # Training utilities, dependency-runtime checks
244
289
  ├── tests/ # Unit, integration, and benchmark tests
245
290
  ├── benchmarks/ # Domain benchmarks with training + baselines
291
+ ├── examples/ # Runnable example scripts paired with notebooks
246
292
  └── docs/ # MkDocs documentation
247
293
  ```
248
294
 
249
295
  ## Requirements
250
296
 
251
- - Python 3.11+
297
+ - Python 3.12+
252
298
  - JAX 0.6.1+
253
299
  - Flax 0.12+
254
300
  - Optax 0.1.4+
255
301
  - jaxtyping 0.2.20+
256
- - Datarax, Artifex, Opifex, and Calibrax (installed automatically from PyPI)
302
+ - Datarax, Artifex, Opifex, Calibrax and Substrax (installed automatically from PyPI)
257
303
 
258
304
  ## License
259
305
 
@@ -262,9 +308,8 @@ MIT License. See [LICENSE](LICENSE) for details.
262
308
  ## Acknowledgments
263
309
 
264
310
  DiffBio builds on ideas from:
265
- - [SMURF](https://www.biorxiv.org/content/10.1101/2021.10.23.465204): Differentiable Smith-Waterman for end-to-end MSA learning
266
311
  - [Datarax](https://github.com/avitai/datarax): Composable data processing framework
267
312
  - [Artifex](https://github.com/avitai/artifex): Generative-model and transformer substrate
268
- - [Opifex](https://github.com/avitai/Opifex): Scientific ML and advanced optimization substrate
313
+ - [Opifex](https://github.com/avitai/opifex): Scientific ML and advanced optimization substrate
269
314
  - [Calibrax](https://github.com/avitai/calibrax): Benchmarking, comparison, and regression substrate
270
315
  - [Flax NNX](https://flax.readthedocs.io/): Neural network library for JAX