How pku-yuangroup/taxdiff works
Project Type and Purpose
• TaxDiff is a Python-based, diffusion-model inference tool for taxonomic-guided protein sequence generation.
• It provides only inference code; training will be released later.
Core Components (and their locations)
a. Data Sources & Artifacts
• taxonomy labels: data_reader/Taxonnmic_classfication.xlsx
• decoder vocabulary: decoder_data/model_10.txt and model_10_info.txt
• pretrained weights: ckpt/0012802_eval.pt
b. Code Modules
• data_reader/decoder.py – loads taxonomy labels and decodes tokens
• models.py – defines the protein transformer architecture
• diffusion/gaussian_diffusion.py – core diffusion operations
• diffusion/timestep_sampler.py – schedules and samples timesteps
• diffusion/respace.py – timestep rescaling utilities
• diffusion/diffusion_utils.py – helper functions (noise scheduler, loss)
• sample_protein.py – CLI entry point for inference
c. Output
• Generated protein sequences file (e.g., GeneratedSequences.txt)
Key Interaction Flow
• sample_protein.py loads taxonomy labels via decoder.py
• It loads the pretrained checkpoint
• Instantiates the model (models.py) and diffusion modules
• Executes the reverse diffusion loop: at each timestep, NoiseSampler → ReverseStep → ConditionalGuidance → next ReverseStep
• Decodes tokens back to amino acid sequences → writes output file
Architectural Patterns & Design Principles
• Modular separation: data ingestion vs. model definition vs. inference logic
• Emphasis on the diffusion loop as the computational core