diff --git a/doranet/modules/post_processing/post_processing.py b/doranet/modules/post_processing/post_processing.py index a7b03ea..0abda20 100644 --- a/doranet/modules/post_processing/post_processing.py +++ b/doranet/modules/post_processing/post_processing.py @@ -1651,7 +1651,7 @@ def path_eco( for ( i ) in left_dict: # find idx for a intermediate molecule to produce - if i not in starters: + if i not in starters | set(has_bio): popkey = i break # num_mol = left_dict.pop(popkey) @@ -1700,7 +1700,7 @@ def path_eco( key_list = list() for key in left_dict: # balance left and right dict - if key not in starters and key in right_dict: + if key not in starters | set(has_bio) and key in right_dict: key_list.append(key) for key in key_list: if left_dict[key] == right_dict[key]: @@ -1717,7 +1717,8 @@ def path_eco( done_flag = True for key in left_dict: - if key not in starters: # check if left only contain starters + if key not in starters | set(has_bio): + # check if left only contain starters done_flag = False if done_flag is True or timecount == timeout: repeat_flag = False @@ -1772,7 +1773,7 @@ def path_eco( print("Min_eco", min_eco) print("Max_eco", max_eco) - # print("none_eco", none_eco) + print("None_eco", none_eco) diff_eco = max_eco - min_eco for i in eco_list: if diff_eco != 0: diff --git a/doranet/modules/synthetic/generate_network.py b/doranet/modules/synthetic/generate_network.py index 12918ae..306451f 100644 --- a/doranet/modules/synthetic/generate_network.py +++ b/doranet/modules/synthetic/generate_network.py @@ -488,7 +488,10 @@ def generate_network( for smarts in smarts_list: if smarts.kekulize_flag is False: network.add_op( - engine.op.rdkit(smarts.smarts), + engine.op.rdkit( + smarts.smarts, + drop_errors=True, + ), meta={ "name": smarts.name, "reactants_stoi": smarts.reactants_stoi, @@ -508,6 +511,7 @@ def generate_network( engine.op.rdkit( smarts.smarts, kekulize=True, + drop_errors=True, ), meta={ "name": smarts.name,