kate-fie / syndirella

Generates and scores synthetically practical elaborations from fragment screens
https://syndirella.readthedocs.io/en/latest/
4 stars 0 forks source link

SMARTS-errors to fix #60

Closed kate-fie closed 1 week ago

kate-fie commented 4 weeks ago

There are a number of elaborations via pipeline that are ending in errors due to SMARTS handling or Reaction handling. I'll list some examples I've seen here to fix:

2024-08-08 16:31:24,680 - syndirella.Cobbler.Cobbler - INFO - Final product: CCC(=O)c1ccc2c(c1)NC(=O)CO2
2024-08-08 16:31:24,684 - syndirella.cobblers_workshop.CobblersWorkshop.CobblersWorkshop - INFO - Step 1 in this route using Amidation
2024-08-08 16:31:24,686 - syndirella.SMARTSHandler.SMARTSHandler - ERROR - Reactant could not be matched to only SMARTS in reaction.
2024-08-08 16:31:24,695 - syndirella.cobblers_workshop.CobblersWorkshop.CobblersWorkshop - ERROR - An error occurred in the route elaboration: Traceback (most recent call last):
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/CobblersWorkshop.py", line 66, in get_final_library
    current_library = cobbler_bench.find_analogues()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/CobblerBench.py", line 77, in find_analogues
    self.reaction.find_reaction_atoms_for_all_reactants()
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/Reaction.py", line 188, in find_reaction_atoms_for_all_reactants
    if len(self.matched_smarts_to_reactant) == 0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()
2024-08-10 17:03:25,256 - syndirella.Cobbler.Cobbler - INFO - Final product: CC(=O)c1ccc2c(c1)NC(=O)CO2
2024-08-10 17:03:25,700 - syndirella.cobblers_workshop.CobblersWorkshop.CobblersWorkshop - INFO - Step 1 in this route using Williamson_ether_synthesis
2024-08-10 17:03:25,996 - syndirella.cobblers_workshop.CobblersWorkshop.CobblersWorkshop - ERROR - An error occurred in the route elaboration: Traceback (most recent call last):
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/CobblersWorkshop.py", line 66, in get_final_library
    current_library = cobbler_bench.find_analogues()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/CobblerBench.py", line 75, in find_analogues
    self.reaction.find_attachment_ids_for_all_reactants()
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/Reaction.py", line 175, in find_attachment_ids_for_all_reactants
    raise ReactionError("No attachment points found for reaction {}".format(self.reaction_name))
syndirella.error.ReactionError: No attachment points found for reaction Williamson_ether_synthesis
2024-08-13 15:17:54,391 - syndirella.Cobbler.Cobbler - INFO - Final product: CC(C)(C)OC1CC(NC(=O)N2CCCC2CS(N)(=O)=O)C1
2024-08-13 15:17:54,395 - syndirella.cobblers_workshop.CobblersWorkshop.CobblersWorkshop - INFO - Step 1 in this route using Formation_of_urea_from_two_amines
2024-08-13 15:17:54,396 - syndirella.SMARTSHandler.SMARTSHandler - ERROR - The reactants are the same in reaction Formation_of_urea_from_two_amines in mol NS(=O)(=O)CC1CCCN1 and CC(C)(C)OC1CC(N)C1.
2024-08-13 15:17:54,406 - syndirella.cobblers_workshop.CobblersWorkshop.CobblersWorkshop - ERROR - An error occurred in the route elaboration: Traceback (most recent call last):
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/CobblersWorkshop.py", line 66, in get_final_library
    current_library = cobbler_bench.find_analogues()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/CobblerBench.py", line 77, in find_analogues
    self.reaction.find_reaction_atoms_for_all_reactants()
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/Reaction.py", line 188, in find_reaction_atoms_for_all_reactants
    if len(self.matched_smarts_to_reactant) == 0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()
2024-08-10 20:27:23,823 - syndirella.Cobbler.Cobbler - INFO - Final product: CC(=O)Nc1nn(C)c(NC(C)=O)c1CC(=O)NC(CNC(=O)CCl)c1cccnc1
2024-08-10 20:27:23,827 - syndirella.cobblers_workshop.CobblersWorkshop.CobblersWorkshop - INFO - Step 1 in this route using Amidation
2024-08-10 20:27:23,829 - syndirella.SMARTSHandler.SMARTSHandler - ERROR - The reactants are the same in reaction Amidation in mol Cn1nc(Br)c(CC(=O)O)c1N and CC(=O)O.
2024-08-10 20:27:23,831 - syndirella.cobblers_workshop.CobblersWorkshop.CobblersWorkshop - ERROR - An error occurred in the route elaboration: Traceback (most recent call last):
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/CobblersWorkshop.py", line 66, in get_final_library
    current_library = cobbler_bench.find_analogues()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/CobblerBench.py", line 77, in find_analogues
    self.reaction.find_reaction_atoms_for_all_reactants()
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/Reaction.py", line 188, in find_reaction_atoms_for_all_reactants
    if len(self.matched_smarts_to_reactant) == 0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()
2024-08-08 04:29:54,271 - syndirella.Cobbler.Cobbler - INFO - Final product: CC(=O)Nc1cc(CC(=O)NC(CNC(=O)CN)c2ccc3ccccc3c2)cnn1
2024-08-08 04:29:54,276 - syndirella.cobblers_workshop.CobblersWorkshop.CobblersWorkshop - INFO - Step 1 in this route using N-nucleophilic_aromatic_substitution
2024-08-08 04:29:54,278 - syndirella.SMARTSHandler.SMARTSHandler - ERROR - The reactants do not match the reaction SMARTS in reaction N-nucleophilic_aromatic_substitution in mol O=C(O)Cc1cnnc(Cl)c1 and N.
2024-08-08 04:29:54,285 - syndirella.cobblers_workshop.CobblersWorkshop.CobblersWorkshop - ERROR - An error occurred in the route elaboration: Traceback (most recent call last):
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/CobblersWorkshop.py", line 66, in get_final_library
    current_library = cobbler_bench.find_analogues()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/CobblerBench.py", line 77, in find_analogues
    self.reaction.find_reaction_atoms_for_all_reactants()
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/Reaction.py", line 188, in find_reaction_atoms_for_all_reactants
    if len(self.matched_smarts_to_reactant) == 0:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()
2024-08-08 06:31:43,975 - syndirella.Cobbler.Cobbler - INFO - Running retrosynthesis analysis for CC(=O)Nc1cncc(CC(=O)N[C@@H](CNC(=O)CCl)c2ccc3ccccc3c2)c1 |a:13|...
2024-08-08 06:31:46,230 - syndirella.Fairy.Fairy - INFO - The first route found is 3 steps. The forward synthesis is: ['Amide_Schotten-Baumann_with_amine', 'Ester_amidation', 'Amide_Schotten-Baumann_with_amine']
2024-08-08 06:31:46,230 - syndirella.Fairy.Fairy - INFO - Additional reaction for 'Amide_Schotten-Baumann_with_amine' found in fairy filters. Getting additional routes containing 'Amidation'...
2024-08-08 06:31:46,230 - syndirella.Fairy.Fairy - INFO - Additional reaction for 'Amide_Schotten-Baumann_with_amine' found in fairy filters. Getting additional routes containing 'Amidation'...
2024-08-08 06:31:46,230 - syndirella.Cobbler.Cobbler - INFO - Syndirella šŸ‘‘ will elaborate the following route:
2024-08-08 06:31:46,230 - syndirella.Cobbler.Cobbler - INFO - 
 Step 1: 
 ['CCOC(=O)Cc1cncc(N)c1', 'CC(=O)Cl'] -> Amide_Schotten-Baumann_with_amine
2024-08-08 06:31:46,230 - syndirella.Cobbler.Cobbler - INFO - 
 Step 2: 
 ['NCC(N)c1ccc2ccccc2c1', 'CCOC(=O)Cc1cncc(NC(C)=O)c1'] -> Ester_amidation
2024-08-08 06:31:46,230 - syndirella.Cobbler.Cobbler - INFO - 
 Step 3: 
 ['O=C(Cl)CCl', 'CC(=O)Nc1cncc(CC(=O)NC(CN)c2ccc3ccccc3c2)c1'] -> Amide_Schotten-Baumann_with_amine
2024-08-08 06:31:46,230 - syndirella.Cobbler.Cobbler - INFO - Final product: CC(=O)Nc1cncc(CC(=O)NC(CNC(=O)CCl)c2ccc3ccccc3c2)c1
2024-08-08 06:31:46,235 - syndirella.Cobbler.Cobbler - INFO - Syndirella šŸ‘‘ will elaborate the following route:
2024-08-08 06:31:46,235 - syndirella.Cobbler.Cobbler - INFO - 
 Step 1: 
 ['CCOC(=O)Cc1cncc(N)c1', 'CC(=O)Cl'] -> Amide_Schotten-Baumann_with_amine
2024-08-08 06:31:46,235 - syndirella.Cobbler.Cobbler - INFO - 
 Step 2: 
 ['NCC(N)c1ccc2ccccc2c1', 'CCOC(=O)Cc1cncc(NC(C)=O)c1'] -> Ester_amidation
2024-08-08 06:31:46,235 - syndirella.Cobbler.Cobbler - INFO - 
 Step 3: 
 ['O=C(O)CCl', 'CC(=O)Nc1cncc(CC(=O)NC(CN)c2ccc3ccccc3c2)c1'] -> Amidation
2024-08-08 06:36:22,819 - syndirella.slipper.slipper_synthesizer.SlipperSynthesizer.SlipperSynthesizer - INFO - Filtering analogues of reactants on SMARTS...
2024-08-08 06:36:22,821 - syndirella.slipper.slipper_synthesizer.SlipperSynthesizer.SlipperSynthesizer - INFO - Filtered 802 rows (100.0%) from r1 dataframe.
2024-08-08 06:36:22,821 - syndirella.slipper.slipper_synthesizer.SlipperSynthesizer.SlipperSynthesizer - INFO - Ordering analogues of r1 before finding products...
2024-08-08 06:36:22,828 - syndirella.cobblers_workshop.CobblersWorkshop.CobblersWorkshop - ERROR - An error occurred in the route elaboration: Traceback (most recent call last):
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/cobblers_workshop/CobblersWorkshop.py", line 70, in get_final_library
    slipper.get_products()
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/slipper/Slipper.py", line 59, in get_products
    self.products: pd.DataFrame = slipper_synth.get_products()
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/slipper/slipper_synthesizer/SlipperSynthesizer.py", line 60, in get_products
    self.filter_analogues()
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/slipper/slipper_synthesizer/SlipperSynthesizer.py", line 120, in filter_analogues
    df = self.order_analogues(df, reactant_prefix)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/xchem-fragalysis-2/kfieseler/syndirella/syndirella/slipper/slipper_synthesizer/SlipperSynthesizer.py", line 132, in order_analogues
    base_reactant = df[f"{reactant_prefix}_mol"].iloc[0]
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/opt/xchem-fragalysis-2/kfieseler/conda/envs/syndirella/lib/python3.12/site-packages/pandas/core/indexing.py", line 1191, in __getitem__
    return self._getitem_axis(maybe_callable, axis=axis)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/xchem-fragalysis-2/kfieseler/conda/envs/syndirella/lib/python3.12/site-packages/pandas/core/indexing.py", line 1752, in _getitem_axis
    self._validate_integer(key, axis)
  File "/opt/xchem-fragalysis-2/kfieseler/conda/envs/syndirella/lib/python3.12/site-packages/pandas/core/indexing.py", line 1685, in _validate_integer
    raise IndexError("single positional indexer is out-of-bounds")
IndexError: single positional indexer is out-of-bounds