diffbio 0.1.0__tar.gz → 0.1.1__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.1}/.gitignore +8 -0
  2. {diffbio-0.1.0 → diffbio-0.1.1}/PKG-INFO +96 -54
  3. {diffbio-0.1.0 → diffbio-0.1.1}/README.md +80 -36
  4. diffbio-0.1.1/benchmarks/crossmodality/README.md +76 -0
  5. {diffbio-0.1.0 → diffbio-0.1.1}/pyproject.toml +49 -19
  6. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/base_operators.py +3 -15
  7. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/graph_utils.py +59 -0
  8. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/neural_components.py +3 -19
  9. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/__init__.py +4 -0
  10. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/sorting.py +74 -0
  11. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/straight_through.py +9 -0
  12. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/uncertainty.py +20 -19
  13. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/losses/__init__.py +6 -0
  14. diffbio-0.1.1/src/diffbio/losses/self_supervised_losses.py +80 -0
  15. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/losses/singlecell_losses.py +17 -0
  16. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/losses/statistical_losses.py +34 -23
  17. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/_loss_balancing.py +2 -1
  18. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/primitives.py +30 -10
  19. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/embedding_probe.py +5 -1
  20. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/metabolomics/__init__.py +16 -0
  21. diffbio-0.1.1/src/diffbio/operators/metabolomics/isotope_envelope.py +174 -0
  22. diffbio-0.1.1/src/diffbio/operators/metabolomics/soft_centroiding.py +195 -0
  23. diffbio-0.1.1/src/diffbio/operators/normalization/__init__.py +96 -0
  24. diffbio-0.1.1/src/diffbio/operators/normalization/arcsinh_cofactor.py +144 -0
  25. diffbio-0.1.1/src/diffbio/operators/normalization/differentiable_pca.py +231 -0
  26. diffbio-0.1.1/src/diffbio/operators/normalization/learnable_normalization.py +160 -0
  27. diffbio-0.1.1/src/diffbio/operators/normalization/learnable_orthogonal_projection.py +127 -0
  28. diffbio-0.1.1/src/diffbio/operators/normalization/learnable_projection.py +125 -0
  29. diffbio-0.1.1/src/diffbio/operators/normalization/matrix_free_pca.py +197 -0
  30. diffbio-0.1.1/src/diffbio/operators/normalization/scaling.py +121 -0
  31. diffbio-0.1.1/src/diffbio/operators/normalization/soft_pca.py +134 -0
  32. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/__init__.py +16 -0
  33. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/batch_correction.py +2 -6
  34. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/ot_trajectory.py +2 -5
  35. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/soft_clustering.py +2 -10
  36. diffbio-0.1.1/src/diffbio/operators/singlecell/soft_hvg.py +261 -0
  37. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/spatial_domains.py +4 -12
  38. diffbio-0.1.1/src/diffbio/operators/singlecell/stochastic_gate_selector.py +164 -0
  39. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/__init__.py +3 -0
  40. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/cnn_classifier.py +46 -60
  41. diffbio-0.1.1/src/diffbio/operators/variant/learnable_pileup.py +131 -0
  42. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/__init__.py +22 -0
  43. diffbio-0.1.1/src/diffbio/pipelines/adapters.py +99 -0
  44. diffbio-0.1.1/src/diffbio/pipelines/joint_preprocessing.py +214 -0
  45. diffbio-0.1.1/src/diffbio/pipelines/joint_training.py +190 -0
  46. diffbio-0.1.1/src/diffbio/pipelines/minibatch_training.py +194 -0
  47. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/single_cell.py +0 -29
  48. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/variant_calling.py +0 -19
  49. diffbio-0.1.1/src/diffbio/reductions/__init__.py +18 -0
  50. diffbio-0.1.1/src/diffbio/reductions/base.py +36 -0
  51. diffbio-0.1.1/src/diffbio/reductions/pca_reduction.py +79 -0
  52. diffbio-0.1.1/src/diffbio/reductions/tfidf_reduction.py +110 -0
  53. diffbio-0.1.1/src/diffbio/sequences/kmer.py +88 -0
  54. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/_types.py +4 -5
  55. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/utils/training.py +17 -9
  56. diffbio-0.1.0/src/diffbio/operators/normalization/__init__.py +0 -42
  57. {diffbio-0.1.0 → diffbio-0.1.1}/LICENSE +0 -0
  58. {diffbio-0.1.0 → diffbio-0.1.1}/benchmarks/README.md +0 -0
  59. {diffbio-0.1.0 → diffbio-0.1.1}/examples/README.md +0 -0
  60. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/__init__.py +0 -0
  61. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/configs.py +0 -0
  62. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/constants.py +0 -0
  63. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/__init__.py +0 -0
  64. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/data_types.py +0 -0
  65. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/gnn_components.py +0 -0
  66. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/optimal_transport.py +0 -0
  67. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/_projections_permutahedron.py +0 -0
  68. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/_projections_simplex.py +0 -0
  69. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/_projections_transport.py +0 -0
  70. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/_sorting_network.py +0 -0
  71. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/_types.py +0 -0
  72. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/_utils.py +0 -0
  73. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/autograd_safe.py +0 -0
  74. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/comparison.py +0 -0
  75. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/elementwise.py +0 -0
  76. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/logical.py +0 -0
  77. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/quantile.py +0 -0
  78. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/selection.py +0 -0
  79. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/evaluation/__init__.py +0 -0
  80. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/evaluation/adapters.py +0 -0
  81. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/evaluation/graders.py +0 -0
  82. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/evaluation/problem.py +0 -0
  83. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/evaluation/runner.py +0 -0
  84. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/losses/alignment_losses.py +0 -0
  85. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/losses/biological_regularization.py +0 -0
  86. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/losses/metric_losses.py +0 -0
  87. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/__init__.py +0 -0
  88. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/_count_vae.py +0 -0
  89. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/_masked_gene_transformer.py +0 -0
  90. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/_transformer_validation.py +0 -0
  91. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/alignment/__init__.py +0 -0
  92. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/alignment/profile_hmm.py +0 -0
  93. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/alignment/scoring.py +0 -0
  94. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/alignment/smith_waterman.py +0 -0
  95. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/alignment/soft_msa.py +0 -0
  96. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/assembly/__init__.py +0 -0
  97. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/assembly/gnn_assembly.py +0 -0
  98. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/assembly/metagenomic_binning.py +0 -0
  99. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/crispr/__init__.py +0 -0
  100. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/crispr/guide_scoring.py +0 -0
  101. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/__init__.py +0 -0
  102. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/_graph_utils.py +0 -0
  103. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/admet_predictor.py +0 -0
  104. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/attentive_fp.py +0 -0
  105. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/dti.py +0 -0
  106. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/fingerprint.py +0 -0
  107. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/maccs_keys.py +0 -0
  108. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/message_passing.py +0 -0
  109. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/property_predictor.py +0 -0
  110. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/similarity.py +0 -0
  111. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/epigenomics/__init__.py +0 -0
  112. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/epigenomics/chromatin_state.py +0 -0
  113. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/epigenomics/contextual.py +0 -0
  114. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/epigenomics/fno_peak_calling.py +0 -0
  115. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/epigenomics/peak_calling.py +0 -0
  116. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/__init__.py +0 -0
  117. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/adapters.py +0 -0
  118. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/contracts.py +0 -0
  119. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/experimental.py +0 -0
  120. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/foundation_model.py +0 -0
  121. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/frozen.py +0 -0
  122. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/precomputed.py +0 -0
  123. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/transformer_encoder.py +0 -0
  124. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/mapping/__init__.py +0 -0
  125. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/mapping/neural_mapper.py +0 -0
  126. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/metabolomics/spectral_similarity.py +0 -0
  127. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/molecular_dynamics/__init__.py +0 -0
  128. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/molecular_dynamics/force_field.py +0 -0
  129. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/molecular_dynamics/integrator.py +0 -0
  130. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/molecular_dynamics/primitives.py +0 -0
  131. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/multiomics/__init__.py +0 -0
  132. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/multiomics/hic_contact.py +0 -0
  133. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/multiomics/multiomics_vae.py +0 -0
  134. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/multiomics/spatial_deconvolution.py +0 -0
  135. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/multiomics/spatial_gene_detection.py +0 -0
  136. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/normalization/embedding.py +0 -0
  137. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/normalization/phate.py +0 -0
  138. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/normalization/umap.py +0 -0
  139. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/normalization/vae_normalizer.py +0 -0
  140. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/population/__init__.py +0 -0
  141. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/population/ancestry_estimation.py +0 -0
  142. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/preprocessing/__init__.py +0 -0
  143. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/preprocessing/adapter_removal.py +0 -0
  144. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/preprocessing/duplicate_filter.py +0 -0
  145. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/preprocessing/error_correction.py +0 -0
  146. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/protein/__init__.py +0 -0
  147. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/protein/secondary_structure.py +0 -0
  148. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/quality_filter.py +0 -0
  149. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/rna_structure/__init__.py +0 -0
  150. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/rna_structure/rna_folding.py +0 -0
  151. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/rnaseq/__init__.py +0 -0
  152. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/rnaseq/motif_discovery.py +0 -0
  153. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/rnaseq/splicing_psi.py +0 -0
  154. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/ambient_removal.py +0 -0
  155. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/archetypes.py +0 -0
  156. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/cell_annotation.py +0 -0
  157. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/communication.py +0 -0
  158. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/differential_distribution.py +0 -0
  159. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/doublet_detection.py +0 -0
  160. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/downsampling.py +0 -0
  161. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/enhanced_batch_correction.py +0 -0
  162. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/grn_inference.py +0 -0
  163. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/imputation.py +0 -0
  164. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/knockdown_filter.py +0 -0
  165. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/simulation.py +0 -0
  166. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/sindy_grn.py +0 -0
  167. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/switch_de.py +0 -0
  168. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/trajectory.py +0 -0
  169. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/velocity.py +0 -0
  170. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/statistical/__init__.py +0 -0
  171. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/statistical/em_quantification.py +0 -0
  172. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/statistical/hmm.py +0 -0
  173. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/statistical/nb_glm.py +0 -0
  174. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/classifier.py +0 -0
  175. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/cnv_segmentation.py +0 -0
  176. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/deepvariant_pileup.py +0 -0
  177. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/pileup.py +0 -0
  178. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/quality_recalibration.py +0 -0
  179. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/differential_expression.py +0 -0
  180. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/enhanced_variant_calling.py +0 -0
  181. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/perturbation.py +0 -0
  182. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/preprocessing.py +0 -0
  183. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/samplers/__init__.py +0 -0
  184. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/samplers/perturbation_sampler.py +0 -0
  185. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sequences/__init__.py +0 -0
  186. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sequences/dna.py +0 -0
  187. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/__init__.py +0 -0
  188. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/_anndata_shared.py +0 -0
  189. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/_batch_iteration.py +0 -0
  190. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/_benchmark_source.py +0 -0
  191. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/_indexed_batch_source.py +0 -0
  192. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/_utils.py +0 -0
  193. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/anndata_interop.py +0 -0
  194. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/anndata_source.py +0 -0
  195. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/archive_ii.py +0 -0
  196. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/balifam.py +0 -0
  197. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/bam.py +0 -0
  198. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/bengrn_ground_truth.py +0 -0
  199. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/contextual_epigenomics.py +0 -0
  200. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/dti.py +0 -0
  201. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/embeddings.py +0 -0
  202. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/encode_peaks.py +0 -0
  203. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/fasta.py +0 -0
  204. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/immune_human.py +0 -0
  205. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/indexed_embeddings.py +0 -0
  206. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/indexed_view.py +0 -0
  207. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/molnet.py +0 -0
  208. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/multiomics.py +0 -0
  209. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/pancreas.py +0 -0
  210. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/__init__.py +0 -0
  211. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/_utils.py +0 -0
  212. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/concat_source.py +0 -0
  213. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/control_mapping.py +0 -0
  214. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/experiment_config.py +0 -0
  215. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/h5_metadata_cache.py +0 -0
  216. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/output_space.py +0 -0
  217. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/perturbation_source.py +0 -0
  218. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/seqfish.py +0 -0
  219. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/sequence_foundation.py +0 -0
  220. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/singlecell_foundation.py +0 -0
  221. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/splitters/__init__.py +0 -0
  222. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/splitters/base.py +0 -0
  223. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/splitters/molecular.py +0 -0
  224. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/splitters/perturbation.py +0 -0
  225. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/splitters/random.py +0 -0
  226. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/splitters/sequence.py +0 -0
  227. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/utils/__init__.py +0 -0
  228. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/utils/dependency_runtime.py +0 -0
  229. {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/utils/nn_utils.py +0 -0
  230. {diffbio-0.1.0 → diffbio-0.1.1}/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.1
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,7 +35,6 @@ 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
40
39
  Classifier: Topic :: Scientific/Engineering
41
40
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
@@ -43,32 +42,30 @@ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
43
42
  Classifier: Topic :: Software Development
44
43
  Classifier: Topic :: Software Development :: Libraries
45
44
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
46
- Requires-Python: >=3.11
45
+ Requires-Python: >=3.12
47
46
  Requires-Dist: anndata>=0.9.1
48
- Requires-Dist: avitai-artifex>=0.1.0
47
+ Requires-Dist: avitai-artifex>=0.1.4
49
48
  Requires-Dist: beartype>=0.14.1
50
49
  Requires-Dist: biopython>=1.81
51
- Requires-Dist: calibrax>=0.1.1
50
+ Requires-Dist: calibrax>=0.1.2
52
51
  Requires-Dist: chex>=0.1.7
53
- Requires-Dist: datarax>=0.1.3
54
- Requires-Dist: flax>=0.12.0
52
+ Requires-Dist: datarax>=0.1.5
53
+ Requires-Dist: flax>=0.12.1
55
54
  Requires-Dist: h5py>=3.7
56
55
  Requires-Dist: jax-md>=0.2.27
57
56
  Requires-Dist: jax>=0.6.1
58
57
  Requires-Dist: jaxtyping>=0.2.20
59
58
  Requires-Dist: numpy>=1.24
60
- Requires-Dist: opifex>=0.1.0
61
- Requires-Dist: optax>=0.1.4
59
+ Requires-Dist: opifex>=0.2.1
60
+ Requires-Dist: optax>=0.2.8
62
61
  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
66
62
  Requires-Dist: scipy>=1.10
67
63
  Provides-Extra: all
68
64
  Requires-Dist: bandit[toml]>=1.8.6; extra == 'all'
69
65
  Requires-Dist: beartype>=0.14.1; extra == 'all'
70
66
  Requires-Dist: build>=1.0.3; extra == 'all'
71
67
  Requires-Dist: coverage>=7; extra == 'all'
68
+ Requires-Dist: datasets>=2.14; extra == 'all'
72
69
  Requires-Dist: deepchem>=2.8.0; extra == 'all'
73
70
  Requires-Dist: flake8-functions-names>=0.4; extra == 'all'
74
71
  Requires-Dist: flake8>=7.0; extra == 'all'
@@ -77,7 +74,6 @@ Requires-Dist: import-linter>=2.5; extra == 'all'
77
74
  Requires-Dist: interrogate>=1.7.0; extra == 'all'
78
75
  Requires-Dist: ipykernel>=6.29.5; extra == 'all'
79
76
  Requires-Dist: jax[cuda12]>=0.6.1; extra == 'all'
80
- Requires-Dist: jaxlib>=0.6.1; extra == 'all'
81
77
  Requires-Dist: lineax>=0.0.8; extra == 'all'
82
78
  Requires-Dist: matplotlib>=3.7; extra == 'all'
83
79
  Requires-Dist: mkdocs-include-exclude-files>=0.1; extra == 'all'
@@ -105,6 +101,7 @@ Requires-Dist: pytest-xdist>=3.6; extra == 'all'
105
101
  Requires-Dist: pytest>=8.3.5; extra == 'all'
106
102
  Requires-Dist: python-dotenv>=1; extra == 'all'
107
103
  Requires-Dist: radon>=6.0.1; extra == 'all'
104
+ Requires-Dist: rdkit>=2025.9.3; extra == 'all'
108
105
  Requires-Dist: ruff>=0.1.5; extra == 'all'
109
106
  Requires-Dist: scib-metrics>=0.5; extra == 'all'
110
107
  Requires-Dist: shellcheck-py>=0.10.0.1; extra == 'all'
@@ -113,6 +110,7 @@ Requires-Dist: tabulate>=0.9; extra == 'all'
113
110
  Requires-Dist: torch>=1.13.0; extra == 'all'
114
111
  Requires-Dist: wemake-python-styleguide>=1.0; extra == 'all'
115
112
  Provides-Extra: benchmark
113
+ Requires-Dist: datasets>=2.14; extra == 'benchmark'
116
114
  Requires-Dist: deepchem>=2.8.0; extra == 'benchmark'
117
115
  Requires-Dist: matplotlib>=3.7; extra == 'benchmark'
118
116
  Requires-Dist: pandas>=2.0; extra == 'benchmark'
@@ -120,6 +118,8 @@ Requires-Dist: pynndescent>=0.5; extra == 'benchmark'
120
118
  Requires-Dist: scib-metrics>=0.5; extra == 'benchmark'
121
119
  Requires-Dist: squidpy>=1.4; extra == 'benchmark'
122
120
  Requires-Dist: tabulate>=0.9; extra == 'benchmark'
121
+ Provides-Extra: chem
122
+ Requires-Dist: rdkit>=2025.9.3; extra == 'chem'
123
123
  Provides-Extra: cuda-dev
124
124
  Requires-Dist: bandit[toml]>=1.8.6; extra == 'cuda-dev'
125
125
  Requires-Dist: build>=1.0.3; extra == 'cuda-dev'
@@ -130,7 +130,6 @@ Requires-Dist: import-linter>=2.5; extra == 'cuda-dev'
130
130
  Requires-Dist: interrogate>=1.7.0; extra == 'cuda-dev'
131
131
  Requires-Dist: ipykernel>=6.29.5; extra == 'cuda-dev'
132
132
  Requires-Dist: jax[cuda12]>=0.6.1; extra == 'cuda-dev'
133
- Requires-Dist: jaxlib>=0.6.1; extra == 'cuda-dev'
134
133
  Requires-Dist: pylint>=3.3.8; extra == 'cuda-dev'
135
134
  Requires-Dist: pyright>=1.1.336; extra == 'cuda-dev'
136
135
  Requires-Dist: pytest-asyncio>=0.23; extra == 'cuda-dev'
@@ -147,6 +146,8 @@ Requires-Dist: radon>=6.0.1; extra == 'cuda-dev'
147
146
  Requires-Dist: ruff>=0.1.5; extra == 'cuda-dev'
148
147
  Requires-Dist: shellcheck-py>=0.10.0.1; extra == 'cuda-dev'
149
148
  Requires-Dist: wemake-python-styleguide>=1.0; extra == 'cuda-dev'
149
+ Provides-Extra: cuda12
150
+ Requires-Dist: jax[cuda12]>=0.6.1; extra == 'cuda12'
150
151
  Provides-Extra: dev
151
152
  Requires-Dist: bandit[toml]>=1.8.6; extra == 'dev'
152
153
  Requires-Dist: build>=1.0.3; extra == 'dev'
@@ -183,9 +184,6 @@ Requires-Dist: pymdown-extensions>=10.14.3; extra == 'docs'
183
184
  Provides-Extra: genomics
184
185
  Requires-Dist: pyfaidx>=0.8.0; extra == 'genomics'
185
186
  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
187
  Provides-Extra: soft-ops-advanced
190
188
  Requires-Dist: lineax>=0.0.8; extra == 'soft-ops-advanced'
191
189
  Requires-Dist: optimistix>=0.0.9; extra == 'soft-ops-advanced'
@@ -211,7 +209,7 @@ Description-Content-Type: text/markdown
211
209
  # DiffBio
212
210
 
213
211
  <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>
212
+ <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
213
  <a href="https://jax.readthedocs.io/"><img src="https://img.shields.io/badge/JAX-0.6.1+-green.svg" alt="JAX"></a>
216
214
  <a href="https://flax.readthedocs.io/"><img src="https://img.shields.io/badge/Flax-0.12+-orange.svg" alt="Flax"></a>
217
215
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a>
@@ -222,11 +220,28 @@ Description-Content-Type: text/markdown
222
220
  </p>
223
221
 
224
222
  <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>
223
+ 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
224
  </p>
227
225
 
228
226
  ---
229
227
 
228
+ > **Research preview.** DiffBio is under rapid iteration and the API will change while we iterate
229
+ > toward v1.0. What that means concretely:
230
+ >
231
+ > | Area | Status | Impact |
232
+ > |------|--------|--------|
233
+ > | **API** | 🔄 Unstable | Breaking changes are expected. Public interfaces may change without deprecation warnings. Pin to specific commits if stability is required. |
234
+ > | **Tests** | 🔄 In Flux | Test suite is being expanded. Some tests may fail or be skipped. Coverage metrics are improving but not yet full. |
235
+ > | **Documentation** | 🔄 Evolving | Docs may not reflect current implementation. Code examples might be outdated. Refer to source code and tests for accurate usage. |
236
+ >
237
+ > Pin a version if you need stability, and do not put it in production yet. For research and
238
+ > experimentation it is ready to use today, with the understanding that APIs will evolve.
239
+ >
240
+ > This is public this early on purpose. Issues, questions and pull requests genuinely steer
241
+ > what gets built next, and a star tells us which layer to push on.
242
+
243
+ ---
244
+
230
245
  ## Overview
231
246
 
232
247
  DiffBio is a framework for building **end-to-end differentiable bioinformatics
@@ -258,7 +273,7 @@ This enables learning optimal pipeline parameters directly from data, rather tha
258
273
  - **Composable Architecture** built on the Datarax, Artifex, Opifex, and Calibrax stack
259
274
  - **Training Utilities** with gradient clipping, custom loss functions, and synthetic data generation
260
275
 
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.
276
+ 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
277
 
263
278
  ## Installation
264
279
 
@@ -280,24 +295,22 @@ import jax
280
295
  import jax.numpy as jnp
281
296
  from flax import nnx
282
297
 
283
- from diffbio.operators import DifferentiableQualityFilter
284
- from diffbio.operators.variant.pileup import DifferentiablePileup
285
- from diffbio.operators.alignment.smith_waterman import SmoothSmithWaterman
298
+ from diffbio.operators import DifferentiableQualityFilter, QualityFilterConfig
286
299
 
287
- # Quality filtering with learnable threshold
300
+ # Quality filtering with learnable threshold (default initial_threshold=20.0)
288
301
  quality_filter = DifferentiableQualityFilter(
289
- threshold=20.0,
290
- temperature=1.0,
302
+ QualityFilterConfig(initial_threshold=20.0),
291
303
  rngs=nnx.Rngs(0),
292
304
  )
293
305
 
294
- # Apply to reads
306
+ # Apply to a one-hot encoded sequence with per-position quality scores
295
307
  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}
308
+ sequence = jax.nn.one_hot(jnp.array([0, 1, 2, 3]), 4) # (length, alphabet=4)
309
+ data = {"sequence": sequence, "quality_scores": quality_scores}
298
310
 
299
311
  filtered_data, _, _ = quality_filter.apply(data, {}, None)
300
- # filtered_data["weights"] contains soft weights for each read
312
+ # filtered_data["sequence"] - sequence with low-quality positions softly suppressed
313
+ # filtered_data["quality_scores"] - pass-through quality values
301
314
  ```
302
315
 
303
316
  ### Using the Variant Calling Pipeline
@@ -386,9 +399,12 @@ DiffBio sits on a layered ecosystem rather than standing alone:
386
399
  |---|---|---|
387
400
  | Execution contracts | [Datarax](https://github.com/avitai/datarax) | Operator, data-source, and pipeline contracts |
388
401
  | 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 |
402
+ | Scientific ML substrate | [Opifex](https://github.com/avitai/opifex) | Scientific optimization, operator learning, and advanced training methods |
390
403
  | 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 |
404
+
405
+ DiffBio itself sits on top of these as the biology-specific layer: differentiable
406
+ biological operators and end-to-end pipeline compositions (alignment, variant
407
+ calling, single-cell analysis, drug discovery, structural biology, multi-omics).
392
408
 
393
409
  Each DiffBio operator inherits from Datarax's `OperatorModule` and implements:
394
410
 
@@ -403,18 +419,31 @@ This enables:
403
419
 
404
420
  ### Operator Composition
405
421
 
406
- Operators are chained by threading the `(data, state, metadata)` triple
407
- returned by `apply()` into the next operator:
422
+ `apply()` runs an operator on a single element (no batch dimension). Operators
423
+ are chained by threading the `(data, state, metadata)` triple returned by
424
+ `apply()` into the next operator:
408
425
 
409
426
  ```python
410
- data, state, metadata = quality_filter.apply(batch_data, {}, None)
427
+ data, state, metadata = quality_filter.apply(element_data, {}, None)
411
428
  data, state, metadata = pileup.apply(data, state, metadata)
412
429
  data, state, metadata = classifier.apply(data, state, metadata)
413
430
 
414
- # `data` is a dict of JAX arrays read out the per-position predictions
431
+ # `data` is a dict of JAX arrays - read out the per-position predictions
415
432
  predictions = data["logits"]
416
433
  ```
417
434
 
435
+ For batched data wrapped in a Datarax `Batch`, call the operator directly
436
+ (or use `apply_batch()`); both delegate to the same code path:
437
+
438
+ ```python
439
+ from datarax import Batch
440
+
441
+ batch = Batch.from_parts(...) # construct from a list of elements
442
+ batch = quality_filter(batch) # equivalent to quality_filter.apply_batch(batch)
443
+ batch = pileup(batch)
444
+ batch = classifier(batch)
445
+ ```
446
+
418
447
  ## Testing
419
448
 
420
449
  ```bash
@@ -435,30 +464,44 @@ uv run pytest tests/integration/ -vv
435
464
  ```
436
465
  DiffBio/
437
466
  ├── src/diffbio/
438
- │ ├── core/ # Base operators, graph utils, soft ops
439
- │ ├── operators/ # 35+ differentiable operators
467
+ │ ├── core/ # Base operators, graph utils, soft ops, neural components
468
+ │ ├── operators/ # 40+ differentiable operators
440
469
  │ │ ├── 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
470
+ │ │ ├── assembly/ # GNN assembly, metagenomic binning
471
+ │ │ ├── crispr/ # Guide RNA scoring
472
+ │ │ ├── drug_discovery/ # Fingerprints, ADMET, AttentiveFP, MACCS keys
473
+ │ │ ├── epigenomics/ # Peak calling, chromatin state, contextual epigenomics
474
+ │ │ ├── foundation_models/ # Geneformer/scGPT adapters, transformer encoders
475
+ │ │ ├── mapping/ # Neural read mapping
476
+ │ │ ├── metabolomics/ # Spectral similarity
477
+ │ │ ├── molecular_dynamics/ # Force fields, MD integrators
478
+ │ │ ├── multiomics/ # Hi-C, spatial deconvolution, multi-omics VAE
479
+ │ │ ├── normalization/ # VAE normalizer, UMAP, PHATE, embeddings
480
+ │ │ ├── population/ # Ancestry estimation
481
+ │ │ ├── preprocessing/ # Adapter removal, duplicate weighting, error correction
482
+ │ │ ├── protein/ # Secondary structure
483
+ │ │ ├── rna_structure/ # RNA folding
484
+ │ │ ├── rnaseq/ # Splicing PSI, motif discovery
485
+ │ │ ├── singlecell/ # Clustering, trajectory, velocity, GRN, batch correction, ...
446
486
  │ │ ├── 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
487
+ │ │ └── variant/ # Pileup, classifiers, CNV segmentation
488
+ ├── pipelines/ # 6 end-to-end pipelines
489
+ │ ├── losses/ # Alignment, biological-regularization, single-cell, statistical, metric
490
+ │ ├── sources/ # Data loaders (FASTA, BAM, AnnData, MoleculeNet, indexed views)
491
+ │ ├── splitters/ # Random, stratified, scaffold, Tanimoto, sequence-identity
492
+ │ ├── samplers/ # Perturbation samplers
493
+ ├── sequences/ # DNA / RNA encoding utilities
494
+ │ ├── evaluation/ # Evaluation runner and graders
495
+ │ └── utils/ # Training utilities, dependency-runtime checks
454
496
  ├── tests/ # Unit, integration, and benchmark tests
455
497
  ├── benchmarks/ # Domain benchmarks with training + baselines
498
+ ├── examples/ # Runnable example scripts paired with notebooks
456
499
  └── docs/ # MkDocs documentation
457
500
  ```
458
501
 
459
502
  ## Requirements
460
503
 
461
- - Python 3.11+
504
+ - Python 3.12+
462
505
  - JAX 0.6.1+
463
506
  - Flax 0.12+
464
507
  - Optax 0.1.4+
@@ -472,9 +515,8 @@ MIT License. See [LICENSE](LICENSE) for details.
472
515
  ## Acknowledgments
473
516
 
474
517
  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
518
  - [Datarax](https://github.com/avitai/datarax): Composable data processing framework
477
519
  - [Artifex](https://github.com/avitai/artifex): Generative-model and transformer substrate
478
- - [Opifex](https://github.com/avitai/Opifex): Scientific ML and advanced optimization substrate
520
+ - [Opifex](https://github.com/avitai/opifex): Scientific ML and advanced optimization substrate
479
521
  - [Calibrax](https://github.com/avitai/calibrax): Benchmarking, comparison, and regression substrate
480
522
  - [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,7 +65,7 @@ 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
 
@@ -70,24 +87,22 @@ import jax
70
87
  import jax.numpy as jnp
71
88
  from flax import nnx
72
89
 
73
- from diffbio.operators import DifferentiableQualityFilter
74
- from diffbio.operators.variant.pileup import DifferentiablePileup
75
- from diffbio.operators.alignment.smith_waterman import SmoothSmithWaterman
90
+ from diffbio.operators import DifferentiableQualityFilter, QualityFilterConfig
76
91
 
77
- # Quality filtering with learnable threshold
92
+ # Quality filtering with learnable threshold (default initial_threshold=20.0)
78
93
  quality_filter = DifferentiableQualityFilter(
79
- threshold=20.0,
80
- temperature=1.0,
94
+ QualityFilterConfig(initial_threshold=20.0),
81
95
  rngs=nnx.Rngs(0),
82
96
  )
83
97
 
84
- # Apply to reads
98
+ # Apply to a one-hot encoded sequence with per-position quality scores
85
99
  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}
100
+ sequence = jax.nn.one_hot(jnp.array([0, 1, 2, 3]), 4) # (length, alphabet=4)
101
+ data = {"sequence": sequence, "quality_scores": quality_scores}
88
102
 
89
103
  filtered_data, _, _ = quality_filter.apply(data, {}, None)
90
- # filtered_data["weights"] contains soft weights for each read
104
+ # filtered_data["sequence"] - sequence with low-quality positions softly suppressed
105
+ # filtered_data["quality_scores"] - pass-through quality values
91
106
  ```
92
107
 
93
108
  ### Using the Variant Calling Pipeline
@@ -176,9 +191,12 @@ DiffBio sits on a layered ecosystem rather than standing alone:
176
191
  |---|---|---|
177
192
  | Execution contracts | [Datarax](https://github.com/avitai/datarax) | Operator, data-source, and pipeline contracts |
178
193
  | 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 |
194
+ | Scientific ML substrate | [Opifex](https://github.com/avitai/opifex) | Scientific optimization, operator learning, and advanced training methods |
180
195
  | 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 |
196
+
197
+ DiffBio itself sits on top of these as the biology-specific layer: differentiable
198
+ biological operators and end-to-end pipeline compositions (alignment, variant
199
+ calling, single-cell analysis, drug discovery, structural biology, multi-omics).
182
200
 
183
201
  Each DiffBio operator inherits from Datarax's `OperatorModule` and implements:
184
202
 
@@ -193,18 +211,31 @@ This enables:
193
211
 
194
212
  ### Operator Composition
195
213
 
196
- Operators are chained by threading the `(data, state, metadata)` triple
197
- returned by `apply()` into the next operator:
214
+ `apply()` runs an operator on a single element (no batch dimension). Operators
215
+ are chained by threading the `(data, state, metadata)` triple returned by
216
+ `apply()` into the next operator:
198
217
 
199
218
  ```python
200
- data, state, metadata = quality_filter.apply(batch_data, {}, None)
219
+ data, state, metadata = quality_filter.apply(element_data, {}, None)
201
220
  data, state, metadata = pileup.apply(data, state, metadata)
202
221
  data, state, metadata = classifier.apply(data, state, metadata)
203
222
 
204
- # `data` is a dict of JAX arrays read out the per-position predictions
223
+ # `data` is a dict of JAX arrays - read out the per-position predictions
205
224
  predictions = data["logits"]
206
225
  ```
207
226
 
227
+ For batched data wrapped in a Datarax `Batch`, call the operator directly
228
+ (or use `apply_batch()`); both delegate to the same code path:
229
+
230
+ ```python
231
+ from datarax import Batch
232
+
233
+ batch = Batch.from_parts(...) # construct from a list of elements
234
+ batch = quality_filter(batch) # equivalent to quality_filter.apply_batch(batch)
235
+ batch = pileup(batch)
236
+ batch = classifier(batch)
237
+ ```
238
+
208
239
  ## Testing
209
240
 
210
241
  ```bash
@@ -225,30 +256,44 @@ uv run pytest tests/integration/ -vv
225
256
  ```
226
257
  DiffBio/
227
258
  ├── src/diffbio/
228
- │ ├── core/ # Base operators, graph utils, soft ops
229
- │ ├── operators/ # 35+ differentiable operators
259
+ │ ├── core/ # Base operators, graph utils, soft ops, neural components
260
+ │ ├── operators/ # 40+ differentiable operators
230
261
  │ │ ├── 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
262
+ │ │ ├── assembly/ # GNN assembly, metagenomic binning
263
+ │ │ ├── crispr/ # Guide RNA scoring
264
+ │ │ ├── drug_discovery/ # Fingerprints, ADMET, AttentiveFP, MACCS keys
265
+ │ │ ├── epigenomics/ # Peak calling, chromatin state, contextual epigenomics
266
+ │ │ ├── foundation_models/ # Geneformer/scGPT adapters, transformer encoders
267
+ │ │ ├── mapping/ # Neural read mapping
268
+ │ │ ├── metabolomics/ # Spectral similarity
269
+ │ │ ├── molecular_dynamics/ # Force fields, MD integrators
270
+ │ │ ├── multiomics/ # Hi-C, spatial deconvolution, multi-omics VAE
271
+ │ │ ├── normalization/ # VAE normalizer, UMAP, PHATE, embeddings
272
+ │ │ ├── population/ # Ancestry estimation
273
+ │ │ ├── preprocessing/ # Adapter removal, duplicate weighting, error correction
274
+ │ │ ├── protein/ # Secondary structure
275
+ │ │ ├── rna_structure/ # RNA folding
276
+ │ │ ├── rnaseq/ # Splicing PSI, motif discovery
277
+ │ │ ├── singlecell/ # Clustering, trajectory, velocity, GRN, batch correction, ...
236
278
  │ │ ├── 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
279
+ │ │ └── variant/ # Pileup, classifiers, CNV segmentation
280
+ ├── pipelines/ # 6 end-to-end pipelines
281
+ │ ├── losses/ # Alignment, biological-regularization, single-cell, statistical, metric
282
+ │ ├── sources/ # Data loaders (FASTA, BAM, AnnData, MoleculeNet, indexed views)
283
+ │ ├── splitters/ # Random, stratified, scaffold, Tanimoto, sequence-identity
284
+ │ ├── samplers/ # Perturbation samplers
285
+ ├── sequences/ # DNA / RNA encoding utilities
286
+ │ ├── evaluation/ # Evaluation runner and graders
287
+ │ └── utils/ # Training utilities, dependency-runtime checks
244
288
  ├── tests/ # Unit, integration, and benchmark tests
245
289
  ├── benchmarks/ # Domain benchmarks with training + baselines
290
+ ├── examples/ # Runnable example scripts paired with notebooks
246
291
  └── docs/ # MkDocs documentation
247
292
  ```
248
293
 
249
294
  ## Requirements
250
295
 
251
- - Python 3.11+
296
+ - Python 3.12+
252
297
  - JAX 0.6.1+
253
298
  - Flax 0.12+
254
299
  - Optax 0.1.4+
@@ -262,9 +307,8 @@ MIT License. See [LICENSE](LICENSE) for details.
262
307
  ## Acknowledgments
263
308
 
264
309
  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
310
  - [Datarax](https://github.com/avitai/datarax): Composable data processing framework
267
311
  - [Artifex](https://github.com/avitai/artifex): Generative-model and transformer substrate
268
- - [Opifex](https://github.com/avitai/Opifex): Scientific ML and advanced optimization substrate
312
+ - [Opifex](https://github.com/avitai/opifex): Scientific ML and advanced optimization substrate
269
313
  - [Calibrax](https://github.com/avitai/calibrax): Benchmarking, comparison, and regression substrate
270
314
  - [Flax NNX](https://flax.readthedocs.io/): Neural network library for JAX
@@ -0,0 +1,76 @@
1
+ # Cross-modality reproduction benchmarks
2
+
3
+ Scripts that reproduce the experiments in the DiffBio manuscript
4
+ (`paper/diffbio.tex`) beyond the single-cell annotation result (which lives in
5
+ `benchmarks/singlecell/`). Every script uses **real data**, fits all preprocessing on
6
+ the **training split only**, reports **held-out** metrics over 3 seeds, and writes its
7
+ summary to `benchmarks/results/crossmodality/`.
8
+
9
+ Each script reads its dataset path from an environment variable with a default under
10
+ `/mnt/ssd2/Data`; override the variable to point at your own copy.
11
+
12
+ ## Data sources
13
+
14
+ | Pipeline | Dataset | Source | Env var |
15
+ |---|---|---|---|
16
+ | DNA regulatory elements | Genomic Benchmarks `human_ocr_ensembl` | HuggingFace `katarinagresova/Genomic_Benchmarks_human_ocr_ensembl` (DOI 10.1186/s12863-023-01123-8) | `HF_HOME` |
17
+ | scATAC annotation | CATLAS GSE184462 | GEO `GSE184462_RAW.tar` + `GSE184462_metadata.tsv.gz` (Zhang 2021, 10.1016/j.cell.2021.10.024) | `DIFFBIO_CATLAS_DIR` |
18
+ | Perturb-seq identity | Virtual Cell Challenge Perturb-seq | challenge `adata_Training.h5ad` | `DIFFBIO_VCC_NPZ` |
19
+ | Variant calling | GIAB HG002 chr20 | `HG002.chr20.bam` + GIAB v4.2.1 truth VCF + GRCh38 chr20 FASTA (Zook 2019, 10.1038/s41587-019-0074-6) | `DIFFBIO_GIAB_DIR` |
20
+
21
+ ## Data preparation
22
+
23
+ Prep scripts materialize the model-ready arrays the benchmarks consume:
24
+
25
+ ```bash
26
+ python benchmarks/crossmodality/prepare_scatac.py # CATLAS fragments -> cell x bin npz
27
+ python benchmarks/crossmodality/prepare_variant.py # GIAB BAM+truth -> labelled pileup windows
28
+ python benchmarks/crossmodality/prepare_perturbation.py # VCC h5ad -> target-masked npz (chunked)
29
+ ```
30
+
31
+ DNA needs no prep (the HuggingFace dataset is featurized on the fly by the k-mer operator).
32
+
33
+ ## Reproducing paper results
34
+
35
+ ```bash
36
+ source ./activate.sh
37
+
38
+ # Table 3 / Figure 4 -- the joint gain across modalities and machineries (gain vs k)
39
+ python benchmarks/crossmodality/dna_classification.py # DNA, +7.5pp @ k=5
40
+ python benchmarks/crossmodality/scatac_annotation.py # scATAC, +12.2pp @ k=5
41
+ python benchmarks/crossmodality/perturbation_identity.py # Perturb-seq, +8.3pp @ k=5
42
+ python benchmarks/crossmodality/variant_read_pooling.py # variant (set pooling), +16.9pp @ k=5
43
+
44
+ # Figure 5a / section 4.4 depth -- scaling crossover and domain baselines
45
+ python benchmarks/crossmodality/scatac_deepening.py # scATAC scaling + LSI+LogReg/kNN baseline
46
+ python benchmarks/crossmodality/dna_deepening.py # DNA scaling + 6-mer+linear baseline
47
+
48
+ # Section 4.5 -- knob attribution on Perturb-seq (the projection carries the gain)
49
+ python benchmarks/crossmodality/perturbation_ablation.py
50
+
51
+ # Section 4.6 -- trainable and orthonormal reduction bases (MatrixFreePCA, Stiefel projection)
52
+ python benchmarks/crossmodality/trainable_basis.py
53
+
54
+ # Rigor audits (data leakage / overfitting)
55
+ python benchmarks/crossmodality/audit_leakfree_scatac.py # held-out donors + train-only bins, train/test F1
56
+ python benchmarks/crossmodality/audit_overfitting.py # 3-way train/val/test, DNA + Perturb-seq
57
+ python benchmarks/crossmodality/audit_regularization_scatac.py # weight-decay / early-stop / Stiefel vs joint overfit
58
+ ```
59
+
60
+ ## Data splits (no fitting on held-out data)
61
+
62
+ Every benchmark fits **all** preprocessing (PCA / LSI / normalization / linear
63
+ baselines) on the **training split only**, then applies the fitted transform to the
64
+ held-out data. Splits:
65
+
66
+ | Pipeline | Split |
67
+ |---|---|
68
+ | scRNA annotation | 80/20 stratified by cell type |
69
+ | DNA regulatory elements | official Genomic Benchmarks disjoint train/test sequences (+15% validation carved from train for `audit_overfitting.py`) |
70
+ | Perturb-seq identity | held-out experimental **batches** (target-gene columns masked) |
71
+ | scATAC annotation | stratified 70/30 (headline); **held-out donors + train-only bin selection** for `audit_leakfree_scatac.py` |
72
+ | Variant calling | disjoint **genomic regions** (chr20:2–22 Mb train / 30–40 Mb test) |
73
+
74
+ Each script prints a per-`k` (or per-arm) summary and writes a JSON to
75
+ `benchmarks/results/crossmodality/`. Numbers are means over 3 seeds; small differences
76
+ from the paper are expected from GPU non-determinism in the convolution/scan kernels.