@@ -50,11 +50,22 @@ class PocketConditioning:
5050 contacts : list [tuple [str , int ]]
5151
5252
53+ @dataclass
54+ class CovalentBond :
55+ chain_id1 : str
56+ res_idx1 : int
57+ atom_idx1 : int
58+ chain_id2 : str
59+ res_idx2 : int
60+ atom_idx2 : int
61+
62+
5363@dataclass
5464class StructurePredictionInput :
5565 sequences : Sequence [ProteinInput | RNAInput | DNAInput | LigandInput ]
5666 pocket : PocketConditioning | None = None
5767 distogram_conditioning : list [DistogramConditioning ] | None = None
68+ covalent_bonds : list [CovalentBond ] | None = None
5869
5970
6071def serialize_structure_prediction_input (all_atom_input : StructurePredictionInput ):
@@ -92,4 +103,20 @@ def create_chain_data(seq_input, chain_type: str) -> dict[str, Any]:
92103 else :
93104 raise ValueError (f"Unsupported sequence input type: { type (seq_input )} " )
94105
95- return {"sequences" : sequences }
106+ result : dict [str , Any ] = {"sequences" : sequences }
107+
108+ # Add covalent bonds if present
109+ if all_atom_input .covalent_bonds is not None :
110+ result ["covalent_bonds" ] = [
111+ {
112+ "chain_id1" : bond .chain_id1 ,
113+ "res_idx1" : bond .res_idx1 ,
114+ "atom_idx1" : bond .atom_idx1 ,
115+ "chain_id2" : bond .chain_id2 ,
116+ "res_idx2" : bond .res_idx2 ,
117+ "atom_idx2" : bond .atom_idx2 ,
118+ }
119+ for bond in all_atom_input .covalent_bonds
120+ ]
121+
122+ return result
0 commit comments