foundry icon indicating copy to clipboard operation
foundry copied to clipboard

InstantiationException: Error in call to target when using sequence with D-amino acid

Open tsamdin opened this issue 2 months ago • 0 comments

Using the following json input, I get an error that stems from how modelforge is trying to parse the (DTY) code for D-Tyrosine in my sequence. The error is not produced when I use the single letter Y for L-Tyrosine. I used the CCD code for this residue [https://www.ebi.ac.uk/pdbe-srv/pdbechem/chemicalCompound/show/DTY]. Have I formatted the sequence string wrong in my json file?

JSON input


[ { "name": "2GB1_31_108", "components": [ { "seq": "LVFKLVVQFSTLKGETTTEAVDAATLIKVVKQYLNDNGLSGKVTQNPSKGFEIRL(DTY)", "chain_id": "A", "msa_path": "docs/rf3/2GB1/2GB1.a3m" } ] } ]


Error Output

│ /gpfs/gsfs12/users/samdintd/modelforge/.venv/lib/python3.12/site-packages/hydra/_internal/instantiate/_instantiate2.py:226 in instantiate │ │ ││ 223 │ │ convert = config.pop(_Keys.CONVERT, ConvertMode.NONE) │ │ 224 │ │ partial = config.pop(_Keys.PARTIAL, False) ││ 225 │ │ │ │ ❱ 226 │ │ return instantiate_node( ││ 227 │ │ │ config, args, recursive=recursive, convert=convert, partial=partial │ │ 228 │ │ ) ││ 229 │ elif OmegaConf.is_list(config): │ │ ││ ╭──────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────╮ │ │ │ convert = 'partial' │ ││ │ partial = False │ │ │ │ recursive = False │ ││ │ args = () │ │ │ │ config = {'ckpt_path': 'rf3_latest.pt', 'inputs': 'docs/rf3/2GB1/31_108_single_D.json', 'out_dir': './', 'num_nodes': 1, │ ││ │ 'devices_per_node': 1, 'target': 'modelhub.inference_engines.rf3.RF3InferenceEngine', 'n_recycles': 10, │ │ │ │ 'diffusion_batch_size': 5, 'num_steps': 50, 'solver': 'af3', 'early_stopping_plddt_threshold': 0.5, 'residue_renaming_dict': │ ││ │ None, 'template_selection': None, 'ground_truth_conformer_selection': None, 'seed': None, 'skip_existing': False, │ │ │ │ 'print_config': True, 'raise_if_missing_msa_for_protein_of_length_n': None, 'dump_predictions': True, 'dump_trajectories': │ ││ │ False, 'one_model_per_file': False, 'annotate_b_factor_with_plddt': True, 'metrics_cfg': {'ptm': {'target': │ │ │ │ 'modelhub.metrics.predicted_error.ComputePTM'}, 'iptm': {'target': 'modelhub.metrics.predicted_error.ComputeIPTM'}, │ ││ │ 'count_clashing_chains': {'target': 'modelhub.metrics.clashing_chains.CountClashingChains'}}, 'temp_dir': │ │ │ │ PosixPath('/tmp/tmp22l2ihqh')} │ ││ │ config_copy = {'ckpt_path': 'rf3_latest.pt', 'inputs': 'docs/rf3/2GB1/31_108_single_D.json', 'out_dir': './', 'num_nodes': 1, │ │ │ │ 'devices_per_node': 1, 'target': 'modelhub.inference_engines.rf3.RF3InferenceEngine', 'n_recycles': 10, │ ││ │ 'diffusion_batch_size': 5, 'num_steps': 50, 'solver': 'af3', 'early_stopping_plddt_threshold': 0.5, 'residue_renaming_dict': │ │ │ │ None, 'template_selection': None, 'ground_truth_conformer_selection': None, 'seed': None, 'skip_existing': False, │ │ │ │ 'print_config': True, 'raise_if_missing_msa_for_protein_of_length_n': None, 'dump_predictions': True, 'dump_trajectories': │ │ │ │ False, 'one_model_per_file': False, 'annotate_b_factor_with_plddt': True, 'metrics_cfg': {'ptm': {'target': │ │ │ │ 'modelhub.metrics.predicted_error.ComputePTM'}, 'iptm': {'target': 'modelhub.metrics.predicted_error.ComputeIPTM'}, │ │ │ │ 'count_clashing_chains': {'target': 'modelhub.metrics.clashing_chains.CountClashingChains'}}} │ │ │ │ kwargs = {'temp_dir': PosixPath('/tmp/tmp22l2ihqh'), 'convert': 'partial', 'recursive': False} │ │ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /gpfs/gsfs12/users/samdintd/modelforge/.venv/lib/python3.12/site-packages/hydra/_internal/instantiate/_instantiate2.py:347 in instantiate_node │ │ │ │ 344 │ │ │ │ │ │ ) │ │ 345 │ │ │ │ │ kwargs[key] = _convert_node(value, convert) │ │ 346 │ │ │ │ │ ❱ 347 │ │ │ return _call_target(target, partial, args, kwargs, full_key) │ │ 348 │ │ else: │ │ 349 │ │ │ # If ALL or PARTIAL non structured or OBJECT non structured, │ │ 350 │ │ │ # instantiate in dict and resolve interpolations eagerly. │ │ │ │ ╭──────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────╮ │ │ │ args = () │ │ │ │ convert = 'partial' │ │ │ │ exclude_keys = {'convert', 'partial', 'recursive', 'target'} │ │ │ │ full_key = '' │ │ │ │ is_partial = False │ │ │ │ key = 'temp_dir' │ │ │ │ kwargs = { │ │ │ │ │ 'ckpt_path': 'rf3_latest.pt', │ │ │ │ │ 'inputs': 'docs/rf3/2GB1/31_108_single_D.json', │ │ │ │ │ 'out_dir': './', │ │ │ │ │ 'num_nodes': 1, │ │ │ │ │ 'devices_per_node': 1, │ │ │ │ │ 'n_recycles': 10, │ │ │ │ │ 'diffusion_batch_size': 5, │ │ │ │ │ 'num_steps': 50, │ │ │ │ │ 'solver': 'af3', │ │ │ │ │ 'early_stopping_plddt_threshold': 0.5, │ │ │ │ │ ... +13 │ │ │ │ } │ │ │ │ node = {'ckpt_path': 'rf3_latest.pt', 'inputs': 'docs/rf3/2GB1/31_108_single_D.json', 'out_dir': './', 'num_nodes': 1, │ │ │ │ 'devices_per_node': 1, 'target': 'modelhub.inference_engines.rf3.RF3InferenceEngine', 'n_recycles': 10, │ │ │ │ 'diffusion_batch_size': 5, 'num_steps': 50, 'solver': 'af3', 'early_stopping_plddt_threshold': 0.5, 'residue_renaming_dict': │ │ │ │ None, 'template_selection': None, 'ground_truth_conformer_selection': None, 'seed': None, 'skip_existing': False, │ │ │ │ 'print_config': True, 'raise_if_missing_msa_for_protein_of_length_n': None, 'dump_predictions': True, 'dump_trajectories': │ │ │ │ False, 'one_model_per_file': False, 'annotate_b_factor_with_plddt': True, 'metrics_cfg': {'ptm': {'target': │ │ │ │ 'modelhub.metrics.predicted_error.ComputePTM'}, 'iptm': {'target': 'modelhub.metrics.predicted_error.ComputeIPTM'}, │ │ │ │ 'count_clashing_chains': {'target': 'modelhub.metrics.clashing_chains.CountClashingChains'}}, 'temp_dir': │ │ │ │ PosixPath('/tmp/tmp22l2ihqh')} │ │ │ │ partial = False │ │ │ │ recursive = False │ │ │ │ value = PosixPath('/tmp/tmp22l2ihqh') │ │ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ /gpfs/gsfs12/users/samdintd/modelforge/.venv/lib/python3.12/site-packages/hydra/_internal/instantiate/instantiate2.py:97 in call_target │ │ │ │ 94 │ │ │ msg = f"Error in call to target '{_convert_target_to_string(target)}':\n{r │ │ 95 │ │ │ if full_key: │ │ 96 │ │ │ │ msg += f"\nfull_key: {full_key}" │ │ ❱ 97 │ │ │ raise InstantiationException(msg) from e │ │ 98 │ │ 99 │ │ 100 def convert_target_to_string(t: Any) -> Any: │ │ │ │ ╭────────────────────────────────────────────── locals ───────────────────────────────────────────────╮ │ │ │ partial = False │ │ │ │ args = () │ │ │ │ full_key = '' │ │ │ │ kwargs = { │ │ │ │ │ 'ckpt_path': 'rf3_latest.pt', │ │ │ │ │ 'inputs': 'docs/rf3/2GB1/31_108_single_D.json', │ │ │ │ │ 'out_dir': './', │ │ │ │ │ 'num_nodes': 1, │ │ │ │ │ 'devices_per_node': 1, │ │ │ │ │ 'n_recycles': 10, │ │ │ │ │ 'diffusion_batch_size': 5, │ │ │ │ │ 'num_steps': 50, │ │ │ │ │ 'solver': 'af3', │ │ │ │ │ 'early_stopping_plddt_threshold': 0.5, │ │ │ │ │ ... +13 │ │ │ │ } │ │ │ │ msg = "Error in call to target 'modelhub.inference_engines.rf3.RF3InferenceEngine':\nVal"+390 │ │ │ │ v = PosixPath('/tmp/tmp22l2ihqh') │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ **InstantiationException: Error in call to target 'modelhub.inference_engines.rf3.RF3InferenceEngine': ValueError("Invalid chain_type=<ChainType.POLYPEPTIDE_L: 6> for chem_comp_types={np.str('PEPTIDE LINKING'), np.str('D-PEPTIDE LINKING'), np.str('L-PEPTIDE LINKING')}. Valid are valid_chem_comp_types=frozenset({'L-PEPTIDE LINKING', 'L-PEPTIDE NH3 AMINO TERMINUS', 'L-GAMMA-PEPTIDE, C-DELTA LINKING', 'PEPTIDE LINKING', 'L-BETA-PEPTIDE, C-GAMMA LINKING', 'L-PEPTIDE COOH CARBOXY TERMINUS'})")*

tsamdin avatar Oct 21 '25 14:10 tsamdin