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.
- {diffbio-0.1.0 → diffbio-0.1.1}/.gitignore +8 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/PKG-INFO +96 -54
- {diffbio-0.1.0 → diffbio-0.1.1}/README.md +80 -36
- diffbio-0.1.1/benchmarks/crossmodality/README.md +76 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/pyproject.toml +49 -19
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/base_operators.py +3 -15
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/graph_utils.py +59 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/neural_components.py +3 -19
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/__init__.py +4 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/sorting.py +74 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/straight_through.py +9 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/uncertainty.py +20 -19
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/losses/__init__.py +6 -0
- diffbio-0.1.1/src/diffbio/losses/self_supervised_losses.py +80 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/losses/singlecell_losses.py +17 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/losses/statistical_losses.py +34 -23
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/_loss_balancing.py +2 -1
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/primitives.py +30 -10
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/embedding_probe.py +5 -1
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/metabolomics/__init__.py +16 -0
- diffbio-0.1.1/src/diffbio/operators/metabolomics/isotope_envelope.py +174 -0
- diffbio-0.1.1/src/diffbio/operators/metabolomics/soft_centroiding.py +195 -0
- diffbio-0.1.1/src/diffbio/operators/normalization/__init__.py +96 -0
- diffbio-0.1.1/src/diffbio/operators/normalization/arcsinh_cofactor.py +144 -0
- diffbio-0.1.1/src/diffbio/operators/normalization/differentiable_pca.py +231 -0
- diffbio-0.1.1/src/diffbio/operators/normalization/learnable_normalization.py +160 -0
- diffbio-0.1.1/src/diffbio/operators/normalization/learnable_orthogonal_projection.py +127 -0
- diffbio-0.1.1/src/diffbio/operators/normalization/learnable_projection.py +125 -0
- diffbio-0.1.1/src/diffbio/operators/normalization/matrix_free_pca.py +197 -0
- diffbio-0.1.1/src/diffbio/operators/normalization/scaling.py +121 -0
- diffbio-0.1.1/src/diffbio/operators/normalization/soft_pca.py +134 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/__init__.py +16 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/batch_correction.py +2 -6
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/ot_trajectory.py +2 -5
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/soft_clustering.py +2 -10
- diffbio-0.1.1/src/diffbio/operators/singlecell/soft_hvg.py +261 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/spatial_domains.py +4 -12
- diffbio-0.1.1/src/diffbio/operators/singlecell/stochastic_gate_selector.py +164 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/__init__.py +3 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/cnn_classifier.py +46 -60
- diffbio-0.1.1/src/diffbio/operators/variant/learnable_pileup.py +131 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/__init__.py +22 -0
- diffbio-0.1.1/src/diffbio/pipelines/adapters.py +99 -0
- diffbio-0.1.1/src/diffbio/pipelines/joint_preprocessing.py +214 -0
- diffbio-0.1.1/src/diffbio/pipelines/joint_training.py +190 -0
- diffbio-0.1.1/src/diffbio/pipelines/minibatch_training.py +194 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/single_cell.py +0 -29
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/variant_calling.py +0 -19
- diffbio-0.1.1/src/diffbio/reductions/__init__.py +18 -0
- diffbio-0.1.1/src/diffbio/reductions/base.py +36 -0
- diffbio-0.1.1/src/diffbio/reductions/pca_reduction.py +79 -0
- diffbio-0.1.1/src/diffbio/reductions/tfidf_reduction.py +110 -0
- diffbio-0.1.1/src/diffbio/sequences/kmer.py +88 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/_types.py +4 -5
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/utils/training.py +17 -9
- diffbio-0.1.0/src/diffbio/operators/normalization/__init__.py +0 -42
- {diffbio-0.1.0 → diffbio-0.1.1}/LICENSE +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/benchmarks/README.md +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/examples/README.md +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/configs.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/constants.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/data_types.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/gnn_components.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/optimal_transport.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/_projections_permutahedron.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/_projections_simplex.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/_projections_transport.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/_sorting_network.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/_types.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/_utils.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/autograd_safe.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/comparison.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/elementwise.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/logical.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/quantile.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/core/soft_ops/selection.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/evaluation/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/evaluation/adapters.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/evaluation/graders.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/evaluation/problem.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/evaluation/runner.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/losses/alignment_losses.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/losses/biological_regularization.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/losses/metric_losses.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/_count_vae.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/_masked_gene_transformer.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/_transformer_validation.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/alignment/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/alignment/profile_hmm.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/alignment/scoring.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/alignment/smith_waterman.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/alignment/soft_msa.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/assembly/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/assembly/gnn_assembly.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/assembly/metagenomic_binning.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/crispr/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/crispr/guide_scoring.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/_graph_utils.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/admet_predictor.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/attentive_fp.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/dti.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/fingerprint.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/maccs_keys.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/message_passing.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/property_predictor.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/drug_discovery/similarity.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/epigenomics/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/epigenomics/chromatin_state.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/epigenomics/contextual.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/epigenomics/fno_peak_calling.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/epigenomics/peak_calling.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/adapters.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/contracts.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/experimental.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/foundation_model.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/frozen.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/precomputed.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/foundation_models/transformer_encoder.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/mapping/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/mapping/neural_mapper.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/metabolomics/spectral_similarity.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/molecular_dynamics/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/molecular_dynamics/force_field.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/molecular_dynamics/integrator.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/molecular_dynamics/primitives.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/multiomics/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/multiomics/hic_contact.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/multiomics/multiomics_vae.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/multiomics/spatial_deconvolution.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/multiomics/spatial_gene_detection.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/normalization/embedding.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/normalization/phate.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/normalization/umap.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/normalization/vae_normalizer.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/population/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/population/ancestry_estimation.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/preprocessing/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/preprocessing/adapter_removal.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/preprocessing/duplicate_filter.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/preprocessing/error_correction.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/protein/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/protein/secondary_structure.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/quality_filter.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/rna_structure/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/rna_structure/rna_folding.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/rnaseq/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/rnaseq/motif_discovery.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/rnaseq/splicing_psi.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/ambient_removal.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/archetypes.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/cell_annotation.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/communication.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/differential_distribution.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/doublet_detection.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/downsampling.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/enhanced_batch_correction.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/grn_inference.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/imputation.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/knockdown_filter.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/simulation.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/sindy_grn.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/switch_de.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/trajectory.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/singlecell/velocity.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/statistical/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/statistical/em_quantification.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/statistical/hmm.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/statistical/nb_glm.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/classifier.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/cnv_segmentation.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/deepvariant_pileup.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/pileup.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/operators/variant/quality_recalibration.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/differential_expression.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/enhanced_variant_calling.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/perturbation.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/pipelines/preprocessing.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/samplers/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/samplers/perturbation_sampler.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sequences/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sequences/dna.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/_anndata_shared.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/_batch_iteration.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/_benchmark_source.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/_indexed_batch_source.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/_utils.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/anndata_interop.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/anndata_source.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/archive_ii.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/balifam.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/bam.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/bengrn_ground_truth.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/contextual_epigenomics.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/dti.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/embeddings.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/encode_peaks.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/fasta.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/immune_human.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/indexed_embeddings.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/indexed_view.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/molnet.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/multiomics.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/pancreas.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/_utils.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/concat_source.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/control_mapping.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/experiment_config.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/h5_metadata_cache.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/output_space.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/perturbation/perturbation_source.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/seqfish.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/sequence_foundation.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/sources/singlecell_foundation.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/splitters/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/splitters/base.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/splitters/molecular.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/splitters/perturbation.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/splitters/random.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/splitters/sequence.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/utils/__init__.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/utils/dependency_runtime.py +0 -0
- {diffbio-0.1.0 → diffbio-0.1.1}/src/diffbio/utils/nn_utils.py +0 -0
- {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.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: diffbio
|
|
3
|
-
Version: 0.1.
|
|
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.
|
|
45
|
+
Requires-Python: >=3.12
|
|
47
46
|
Requires-Dist: anndata>=0.9.1
|
|
48
|
-
Requires-Dist: avitai-artifex>=0.1.
|
|
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.
|
|
50
|
+
Requires-Dist: calibrax>=0.1.2
|
|
52
51
|
Requires-Dist: chex>=0.1.7
|
|
53
|
-
Requires-Dist: datarax>=0.1.
|
|
54
|
-
Requires-Dist: flax>=0.12.
|
|
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
|
|
61
|
-
Requires-Dist: optax>=0.
|
|
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.
|
|
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/
|
|
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://
|
|
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
|
-
|
|
290
|
-
temperature=1.0,
|
|
302
|
+
QualityFilterConfig(initial_threshold=20.0),
|
|
291
303
|
rngs=nnx.Rngs(0),
|
|
292
304
|
)
|
|
293
305
|
|
|
294
|
-
# Apply to
|
|
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
|
-
|
|
297
|
-
data = {"
|
|
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["
|
|
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/
|
|
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
|
-
|
|
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
|
-
|
|
407
|
-
|
|
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(
|
|
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
|
|
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/
|
|
439
|
-
│ ├── 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
|
-
│ │ ├──
|
|
442
|
-
│ │ ├──
|
|
443
|
-
│ │ ├── drug_discovery/ # Fingerprints,
|
|
444
|
-
│ │ ├── epigenomics/ # Peak calling, chromatin state
|
|
445
|
-
│ │ ├──
|
|
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
|
-
│ │
|
|
448
|
-
│
|
|
449
|
-
│ ├──
|
|
450
|
-
│ ├──
|
|
451
|
-
│ ├──
|
|
452
|
-
│ ├──
|
|
453
|
-
│
|
|
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.
|
|
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/
|
|
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.
|
|
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/
|
|
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://
|
|
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
|
-
|
|
80
|
-
temperature=1.0,
|
|
94
|
+
QualityFilterConfig(initial_threshold=20.0),
|
|
81
95
|
rngs=nnx.Rngs(0),
|
|
82
96
|
)
|
|
83
97
|
|
|
84
|
-
# Apply to
|
|
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
|
-
|
|
87
|
-
data = {"
|
|
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["
|
|
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/
|
|
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
|
-
|
|
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
|
-
|
|
197
|
-
|
|
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(
|
|
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
|
|
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/
|
|
229
|
-
│ ├── 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
|
-
│ │ ├──
|
|
232
|
-
│ │ ├──
|
|
233
|
-
│ │ ├── drug_discovery/ # Fingerprints,
|
|
234
|
-
│ │ ├── epigenomics/ # Peak calling, chromatin state
|
|
235
|
-
│ │ ├──
|
|
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
|
-
│ │
|
|
238
|
-
│
|
|
239
|
-
│ ├──
|
|
240
|
-
│ ├──
|
|
241
|
-
│ ├──
|
|
242
|
-
│ ├──
|
|
243
|
-
│
|
|
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.
|
|
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/
|
|
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.
|