File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -175,13 +175,18 @@ def make_msa_features(
175175
176176 polymer_residue_index = - 1
177177
178+ chemtype_constants_cache = {}
179+
178180 for idx , (chemtype , residue_index ) in enumerate (
179181 zip (chain_chemtype , chain_residue_index )
180182 ):
181183 is_polymer = chemtype < ligand_chemtype_index
182184 is_ligand = not is_polymer
183185
184- chem_residue_constants = get_residue_constants (res_chem_index = chemtype )
186+ if chemtype not in chemtype_constants_cache :
187+ chemtype_constants_cache [chemtype ] = get_residue_constants (res_chem_index = chemtype )
188+
189+ chem_residue_constants = chemtype_constants_cache [chemtype ]
185190
186191 # NOTE: For modified polymer residues, we only increment the polymer residue index
187192 # when the current (atomized) modified polymer residue's atom sequence ends.
You can’t perform that action at this time.
0 commit comments