### Define uniaf3 configuration in YAML Source: https://github.com/y1zhou/uniaf3/blob/master/README.md A comprehensive example showing the structure for defining sequences, covalent bonds, and various restraints in a YAML configuration file. ```yaml sequences: - polymer_type: protein id: [A, B] sequence: MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLS msa_dir: dummy_msa/ modifications: - ccd: HY3 position: 1 description: Hemoglobin subunit - polymer_type: dna id: C sequence: GATTACA - id: D ccd: - ATP - id: E smiles: "CC(=O)OC1C[NH+]2CCC1CC2" - id: F chai_str: NAG description: Example glycan covalent_bonds: - atom1: chain_id: B residue_idx: 2 atom_name: CA residue_name: V atom2: chain_id: D residue_idx: 1 atom_name: C04 residue_name: null contact_restraints: - token1: chain_id: A residue_idx: 5 atom_name: CG residue_name: P token2: chain_id: B residue_idx: 5 atom_name: null residue_name: P max_distance: 8.0 boltz_enable_force: true pocket_restraints: - binder_chain: D max_distance: 6.0 contact_tokens: - chain_id: A residue_idx: 10 atom_name: null residue_name: N - chain_id: B residue_idx: 3 atom_name: null residue_name: L aux: seeds: - 42 - 123 num_trunk_recycles: 3 num_diffn_timesteps: 200 num_diffn_samples: 5 num_trunk_samples: 1 boltz_affinity_binder_chain: D ``` -------------------------------- ### Multi-entity FASTA format Source: https://github.com/y1zhou/uniaf3/blob/master/docs/chai1-input-format.md Example of a multi-entity FASTA file defining various biological entities including proteins, DNA, ligands, and glycans. ```fasta >protein|Hemoglobin subunit MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLS >protein|Modified protein (HY3)VLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLS >dna|example DNA GATTACA >ligand|CCD example ATP >ligand|SMILES example CC(=O)OC1C[NH+]2CCC1CC2 >glycan|multi-ring glycan NAG(NAG)(BMA) ``` -------------------------------- ### Define molecular restraints in CSV Source: https://github.com/y1zhou/uniaf3/blob/master/docs/chai1-input-format.md Example CSV structure for defining covalent, contact, and pocket restraints. ```csv restraint_id,chainA,res_idxA,chainB,res_idxB,connection_type,confidence,min_distance_angstrom,max_distance_angstrom,comment restraint0,A,P5@CG,F,@C1,covalent,1.0,0.0,6.0,protein-glycan bond restraint1,A,V11,B,L35,contact,1.0,0.0,6.0,interface contact restraint2,B,,A,A14,pocket,1.0,0.0,8.0,binding pocket ``` -------------------------------- ### Inline residue modification Source: https://github.com/y1zhou/uniaf3/blob/master/docs/chai1-input-format.md Example of specifying a residue modification inline within a protein sequence using a parenthesized CCD code. ```text MVLS(HY3)ADKTNVK ``` -------------------------------- ### Convert configuration formats Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Converts a configuration file from a source format to a target format and saves it to the specified output directory. ```bash uniaf3 convert INPUT_CONFIG_FILE OUTPUT_DIR [PREFIX] [--from-format FORMAT] [--to-format FORMAT] ``` ```bash # UniAF3 → AlphaFold3 uniaf3 convert input.yaml output_dir/ --from-format uniaf3 --to-format alphafold3 # Boltz → Chai-1 uniaf3 convert boltz_input.yaml output_dir/ --from-format boltz --to-format chai # AF3 → Protenix uniaf3 convert af3_input.json output_dir/ --from-format alphafold3 --to-format protenix ``` -------------------------------- ### Configure MSA inference Source: https://github.com/y1zhou/uniaf3/blob/master/docs/chai1-input-format.md Sets up the inference function to use either a local MSA directory or the ColabFold server. ```python run_inference( fasta_file="input.fasta", msa_directory="path/to/msa/", use_msa_server=True, msa_server_url="https://api.colabfold.com" ) ``` -------------------------------- ### Validate a configuration file Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Validates an input configuration file and prints its contents. Supports multiple formats via the --format option. ```bash uniaf3 validate INPUT_CONFIG_FILE [--format FORMAT] ``` ```bash # Validate a UniAF3 config uniaf3 validate input.yaml # Validate a Boltz config uniaf3 validate boltz_input.yaml --format boltz # Validate an AlphaFold3 JSON uniaf3 validate af3_input.json -f alphafold3 ``` -------------------------------- ### Run Protenix inference via CLI Source: https://github.com/y1zhou/uniaf3/blob/master/docs/protenix-input-format.md Execute the inference script using the required JSON input path and configuration parameters. ```bash python runner/inference.py \ --input_json_path input.json \ --dump_dir ./output \ --seeds 42 \ --sample_diffusion.N_sample 5 ``` -------------------------------- ### Define a Ligand input Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-server-input-format.md Use this structure to define a ligand using its CCD code. ```json { "ligand": { "ligand": "CCD_ATP", "count": 1 } } ``` -------------------------------- ### Define ligand inputs Source: https://github.com/y1zhou/uniaf3/blob/master/docs/protenix-input-format.md Specify ligands using CCD codes, SMILES strings, or file paths to molecular structure files. ```json {"ligand": {"ligand": "CCD_ATP", "count": 1}} {"ligand": {"ligand": "CCD_NAG_BMA_BGC", "count": 1}} {"ligand": {"ligand": "CC(=O)OC1C[NH+]2CCC1CC2", "count": 1}} {"ligand": {"ligand": "FILE_/path/to/molecule.sdf", "count": 1}} ``` -------------------------------- ### Define Ligand Entry Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Ligands can be defined using either CCD codes or SMILES strings. ```yaml # CCD ligand (single or multi-CCD) - id: E ccd: - ATP # Multi-CCD ligand (e.g., glycan as ligand) - id: F ccd: - NAG - BMA # SMILES ligand - id: G smiles: "CC(=O)OC1C[NH+]2CCC1CC2" ``` -------------------------------- ### MSA directory structure Source: https://github.com/y1zhou/uniaf3/blob/master/docs/chai1-input-format.md Expected file naming convention for precomputed A3M files within the MSA directory. ```text msa_dir/ a3ms/ {sha256_hash}.single.a3m {sha256_hash}.pair.a3m ``` -------------------------------- ### Define Glycan Entry Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Glycans are defined using Chai-1's glycan notation via the chai_str field. ```yaml - id: H chai_str: "NAG(4-1 NAG(4-1 BMA(3-1 MAN)(6-1 MAN)))" description: "Branched glycan" ``` -------------------------------- ### Define MSA Directory Structure Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Expected directory layout for MSA files, where {seq_hash} is the SHA-256 hex digest of the protein sequence. ```text msa_dir/ a3ms/ {seq_hash}.single.a3m # Unpaired MSA {seq_hash}.pair.a3m # Paired MSA (optional) ``` -------------------------------- ### Define ion ligands Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-input-format.md Ions are represented as ligands using the standard ligand schema. ```json {"ligand": {"id": "X", "ccdCodes": ["MG"]}} ``` -------------------------------- ### Configure Inference Parameters Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Set optional inference parameters within the aux field, such as recycle counts and diffusion timesteps. ```yaml aux: num_trunk_recycles: 3 # Default: 3 num_diffn_timesteps: 200 # Default: 200 num_diffn_samples: 5 # Default: 5 num_trunk_samples: 1 # Default: 1 name: "job_name" # Optional, used in AF3 Server boltz_affinity_binder_chain: D # Boltz-specific: affinity binder chain ID ``` -------------------------------- ### Define an Ion input Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-server-input-format.md Use this structure to define an ion. Note that ion codes do not require the CCD_ prefix. ```json { "ion": { "ion": "MG", "count": 2 } } ``` -------------------------------- ### Define Structural Templates Source: https://github.com/y1zhou/uniaf3/blob/master/docs/boltz-input-format.md Configures structural templates using CIF or PDB files with optional chain mapping and force enforcement. ```yaml templates: - cif: path/to/template.cif # or pdb: path/to/template.pdb chain_id: A # Optional: which chain(s) to template template_id: A # Optional: explicit template chain mapping force: true # Optional: enforce template with potential threshold: 2.0 # Optional: max deviation in Å (required if force=true) ``` -------------------------------- ### Configure Random Seeds Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Define a list of integer random seeds in the aux.seeds field. ```yaml aux: seeds: - 42 - 123 ``` -------------------------------- ### Define custom ligand CCD Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-input-format.md Provide a custom ligand definition in mmCIF format within the userCCD field when specific atom names are required or RDKit conformer generation fails. ```json { "userCCD": "data_MY_LIGAND\n_chem_comp.id MY_LIGAND\n...", "sequences": [ {"ligand": {"id": "A", "ccdCodes": ["MY_LIGAND"]}} ] } ``` -------------------------------- ### Define UniAF3 Configuration Structure Source: https://github.com/y1zhou/uniaf3/blob/master/README.md The top-level YAML structure for UniAF3 configuration, including optional restraints and inference parameters. ```yaml sequences: - # Polymer, Ligand, or Glycan entries covalent_bonds: # Optional - # CovalentBond entries contact_restraints: # Optional - # ContactRestraint entries pocket_restraints: # Optional - # PocketRestraint entries aux: # Optional, inference parameters seeds: - 42 num_trunk_recycles: 3 num_diffn_timesteps: 200 num_diffn_samples: 5 num_trunk_samples: 1 ``` -------------------------------- ### Define a Protein Chain input Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-server-input-format.md Use this structure to define a protein chain, including optional glycans, PTMs, and template usage settings. ```json { "proteinChain": { "sequence": "PREACHINGS", "count": 2, "glycans": [ {"residues": "NAG(NAG)(BMA)", "position": 8} ], "modifications": [ {"ptmType": "CCD_HY3", "ptmPosition": 1} ], "useStructureTemplate": true, "maxTemplateDate": "2024-05-08" } } ``` -------------------------------- ### Define a complete Boltz input configuration Source: https://github.com/y1zhou/uniaf3/blob/master/docs/boltz-input-format.md This YAML structure defines sequences, covalent bonds, contact constraints, pocket constraints, templates, and affinity properties for a prediction task. ```yaml version: 1 sequences: - protein: id: [A, B] sequence: MVTPEGNVSLV... msa: path/to/msa.csv modifications: - position: 5 ccd: HY3 cyclic: false - ligand: id: C ccd: SAH constraints: - bond: atom1: [A, 111, SG] atom2: [C, 1, SD] - contact: token1: [A, 10] token2: [C, C4] max_distance: 8.0 force: true - pocket: binder: C contacts: - [A, 140] - [A, 145] max_distance: 6.0 force: false templates: - cif: path/to/template.cif chain_id: A force: true threshold: 2.0 properties: - affinity: binder: C ``` -------------------------------- ### Define an RNA Sequence input Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-server-input-format.md Use this structure to define an RNA sequence with optional base modifications. ```json { "rnaSequence": { "sequence": "GUAC", "count": 1, "modifications": [ {"modificationType": "CCD_2MG", "basePosition": 1} ] } } ``` -------------------------------- ### Define a Protenix job structure Source: https://github.com/y1zhou/uniaf3/blob/master/docs/protenix-input-format.md The top-level structure is a list of job objects containing sequences, covalent bonds, and constraints. ```json [ { "name": "Test Fold Job", "sequences": [...], "covalent_bonds": [...], "constraint": {...} } ] ``` -------------------------------- ### Define a Pocket Constraint Source: https://github.com/y1zhou/uniaf3/blob/master/docs/boltz-input-format.md Defines a binding pocket by specifying a binder chain and a list of contact points. ```yaml - pocket: binder: CHAIN_ID contacts: [[CHAIN_ID, RES_IDX_OR_ATOM_NAME], ...] max_distance: 6.0 force: false ``` -------------------------------- ### Define a DNA Sequence input Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-server-input-format.md Use this structure to define a DNA sequence with optional base modifications. ```json { "dnaSequence": { "sequence": "GATTACA", "count": 1, "modifications": [ {"modificationType": "CCD_6OG", "basePosition": 1} ] } } ``` -------------------------------- ### run_inference Source: https://github.com/y1zhou/uniaf3/blob/master/docs/chai1-input-format.md Executes the protein structure prediction inference process using the specified FASTA input and MSA configuration. ```APIDOC ## run_inference ### Description Executes the protein structure prediction inference process. It supports using a remote MSA server or local precomputed MSA files. ### Parameters - **fasta_file** (string) - Required - Path to the input FASTA file. - **msa_directory** (string) - Optional - Path to the directory containing precomputed A3M files. - **use_msa_server** (boolean) - Optional - Whether to use the ColabFold server for MSA generation. - **msa_server_url** (string) - Optional - URL of the MSA server to use. - **num_trunk_recycles** (int) - Optional - Number of recycling steps (default: 3). - **num_diffn_timesteps** (int) - Optional - Number of diffusion timesteps (default: 200). - **num_diffn_samples** (int) - Optional - Number of diffusion samples (default: 5). - **num_trunk_samples** (int) - Optional - Number of trunk samples (default: 1). - **seed** (int) - Optional - Random seed for reproducibility. - **use_esm_embeddings** (boolean) - Optional - Whether to use ESM embeddings (default: True). ``` -------------------------------- ### Define a multi-ring glycan with bonds Source: https://github.com/y1zhou/uniaf3/blob/master/docs/chai1-input-format.md Specifies a bond between two sugar units using O-glycosidic notation. ```text NAG(4-1 NAG) ``` -------------------------------- ### Define Pocket Constraints Source: https://github.com/y1zhou/uniaf3/blob/master/docs/protenix-input-format.md Defines a binding pocket constraint by specifying a binder chain and a list of contact residues. Only one pocket constraint is supported per job. ```json "constraint": { "pocket": { "binder_chain": {"entity": 2, "copy": 1}, "contact_residues": [ {"entity": 1, "copy": 1, "position": 126} ], "max_distance": 6.0 } } ``` -------------------------------- ### Define a DNA sequence in JSON Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-input-format.md Structure for defining a DNA chain, which does not support MSA configurations. ```json { "dna": { "id": "A", "sequence": "GACCTCT", "modifications": [ {"modificationType": "6OG", "basePosition": 1} ], "description": "DNA strand" } } ``` -------------------------------- ### Define Protein Sequence Entry Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Schema for protein sequences, supporting MSA directories, structural templates, and PTMs. ```yaml - polymer_type: protein id: A # or [A, B] for homomeric copies sequence: MVLSPADKTNVK # Standard 1-letter amino acid codes description: "My protein" # Optional description modifications: # Optional PTMs - ccd: HY3 # CCD code of modification position: 1 # 1-based residue index msa_dir: path/to/msa/ # Optional, directory containing MSA files templates: # Optional structural templates - path: template.cif # Path to mmCIF or PDB file query_idx: [0, 1, 2] # 0-based query residue indices template_idx: [0, 1, 2] # 0-based template residue indices query_chains: [A] # Optional, chain IDs in query template_chains: [A] # Optional, chain IDs in template boltz_enable_force: false # Boltz-specific: enforce template boltz_template_threshold: null # Boltz-specific: deviation threshold (Å) boltz_cyclic: false # Boltz-specific: cyclic polymer flag ``` -------------------------------- ### Define a Protein sequence in JSON Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-input-format.md Structure for defining a protein chain, including optional post-translational modifications, MSA paths, and structural templates. ```json { "protein": { "id": "A", "sequence": "PVLSCGEWQL", "modifications": [ {"ptmType": "HY3", "ptmPosition": 1} ], "description": "My protein chain", "unpairedMsa": "...", "unpairedMsaPath": "path/to/unpaired.a3m", "pairedMsa": "...", "pairedMsaPath": "path/to/paired.a3m", "templates": [ { "mmcif": "...", "mmcifPath": "path/to/template.cif", "queryIndices": [0, 1, 2], "templateIndices": [0, 1, 2] } ] } } ``` -------------------------------- ### Define an RNA sequence in JSON Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-input-format.md Structure for defining an RNA chain, supporting specific modifications and optional unpaired MSA data. ```json { "rna": { "id": "A", "sequence": "AGCU", "modifications": [ {"modificationType": "2MG", "basePosition": 1} ], "description": "Short RNA", "unpairedMsa": "...", "unpairedMsaPath": "..." } } ``` -------------------------------- ### Define RNA Sequence Entry Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Schema for RNA sequences, restricted to A, U, G, and C. ```yaml - polymer_type: rna id: D sequence: AGCU # Only A, U, G, C allowed modifications: # Optional - ccd: 2MG position: 1 ``` -------------------------------- ### Define Affinity Binder Chain Source: https://github.com/y1zhou/uniaf3/blob/master/docs/boltz-input-format.md Specifies the chain ID of the small molecule ligand for affinity computation in the YAML configuration. ```yaml properties: - affinity: binder: C # Chain ID of the small molecule ``` -------------------------------- ### Define a single-ring glycan Source: https://github.com/y1zhou/uniaf3/blob/master/docs/chai1-input-format.md Represents a single sugar unit in the Chai-1 notation. ```text NAG ``` -------------------------------- ### Define AlphaFold Server Job Structure Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-server-input-format.md The top-level structure for an AlphaFold Server request is a JSON array containing one or more job objects. ```json [ { "name": "Job name", "modelSeeds": [], "sequences": [...], "dialect": "alphafoldserver", "version": 1 } ] ``` -------------------------------- ### Define Contact Constraints Source: https://github.com/y1zhou/uniaf3/blob/master/docs/protenix-input-format.md Sets soft distance constraints between specific atoms or tokens of two entities. ```json "constraint": { "contact": [ { "entity1": 1, "copy1": 1, "position1": 169, "atom1": "CA", "entity2": 2, "copy2": 1, "position2": 1, "atom2": "C5", "max_distance": 6.0, "min_distance": 0.0 } ] } ``` -------------------------------- ### Define a Contact Constraint Source: https://github.com/y1zhou/uniaf3/blob/master/docs/boltz-input-format.md Sets a distance constraint between two residues or atoms with an optional force parameter. ```yaml - contact: token1: [CHAIN_ID, RES_IDX_OR_ATOM_NAME] token2: [CHAIN_ID, RES_IDX_OR_ATOM_NAME] max_distance: 6.0 force: false ``` -------------------------------- ### Define DNA Sequence Entry Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Schema for DNA sequences, restricted to A, T, G, and C. ```yaml - polymer_type: dna id: C sequence: GATTACA # Only A, T, G, C allowed modifications: # Optional - ccd: 6OG position: 1 ``` -------------------------------- ### Define AlphaFold3 JSON Input Structure Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-input-format.md The top-level JSON schema for AlphaFold3 input, defining required fields like sequences, modelSeeds, and version. ```json { "name": "Job name", "modelSeeds": [1, 2], "sequences": [ {"protein": {...}}, {"rna": {...}}, {"dna": {...}}, {"ligand": {...}} ], "bondedAtomPairs": [...], "userCCD": "...", "userCCDPath": "...", "dialect": "alphafold3", "version": 4 } ``` -------------------------------- ### Define a branched glycan Source: https://github.com/y1zhou/uniaf3/blob/master/docs/chai1-input-format.md Represents complex branched glycan structures using nested bond notation. ```text NAG(4-1 NAG(4-1 BMA(3-1 MAN)(6-1 MAN))) ``` -------------------------------- ### Define bonded atom pairs Source: https://github.com/y1zhou/uniaf3/blob/master/docs/alphafold3-input-format.md Specify covalent bonds between atoms using a list of pairs containing entity ID, residue ID, and atom name. ```json "bondedAtomPairs": [ [["A", 1, "CA"], ["F", 1, "CHA"]], [["I", 1, "O6"], ["I", 2, "C1"]] ] ``` -------------------------------- ### Define a Bond Constraint Source: https://github.com/y1zhou/uniaf3/blob/master/docs/boltz-input-format.md Specifies a covalent bond between two atoms using 1-based residue indices and CCD atom names. ```yaml - bond: atom1: [CHAIN_ID, RES_IDX, ATOM_NAME] atom2: [CHAIN_ID, RES_IDX, ATOM_NAME] ``` -------------------------------- ### Define Covalent Bonds Source: https://github.com/y1zhou/uniaf3/blob/master/docs/protenix-input-format.md Specifies covalent bonds between entities using 1-based indexing for entities, copies, and positions. ```json "covalent_bonds": [ { "entity1": 1, "copy1": 1, "position1": 2, "atom1": "N6", "entity2": 3, "copy2": 1, "position2": 1, "atom2": "C1" } ] ``` -------------------------------- ### Define Pocket Restraints Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Specify a binding pocket where a binder chain interacts with specific contact residues; not supported by AF3 or AF3 Server. ```yaml pocket_restraints: - binder_chain: E # ID of the chain binding to the pocket contact_tokens: # List of residues forming the pocket - chain_id: A residue_idx: 10 atom_name: null # For polymers; use atom_name for ligands residue_name: K - chain_id: A residue_idx: 15 atom_name: null residue_name: G max_distance: 6.0 # Maximum distance in Å (4-20 Å) min_distance: 0.0 # Protenix only boltz_enable_force: false # Boltz-specific: enforce with potential ``` -------------------------------- ### Define Contact Restraints Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Set distance constraints between two atoms or residues, noting that AF3 and AF3 Server do not support these. ```yaml contact_restraints: - token1: chain_id: A residue_idx: 10 # 1-based, or 0 if atom_name is used for ligands atom_name: null # Optional for polymers, required for ligands residue_name: K # Optional, for validation token2: chain_id: C residue_idx: 5 atom_name: null residue_name: null max_distance: 8.0 # Maximum distance in Å (must be 4-20 Å) min_distance: 0.0 # Minimum distance in Å (Protenix only) boltz_enable_force: true # Boltz-specific: enforce with potential ``` -------------------------------- ### Define Covalent Bonds Source: https://github.com/y1zhou/uniaf3/blob/master/README.md Specify covalent bonds between atoms from different entities using chain IDs and residue indices. ```yaml covalent_bonds: - atom1: chain_id: A # Entity ID residue_idx: 5 # 1-based residue index (0 for ligands) atom_name: CG # Atom name (e.g., CA, N, SG) residue_name: P # Optional, for validation atom2: chain_id: E # Entity ID residue_idx: 1 # 1-based position within ligand atom_name: C04 # Atom name in the ligand residue_name: null # Not required for ligands description: "Optional description" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.