Skip to content

Commit

Permalink
resolve conflict for merging
Browse files Browse the repository at this point in the history
  • Loading branch information
TieuLongPhan committed Dec 9, 2024
2 parents 9feecea + af0dc37 commit 110c5f9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Test/SynITS/test_its_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ def test_unsanitize_smiles(self):
self.assertEqual(len(its_true["ITSGraph"][2].nodes()), 2)
self.assertEqual(len(its_false["ITSGraph"][2].nodes()), 4)

def test_unsanitize_smiles(self):
test_2 = {
"R_ID": "R_1",
"Map": "[CH2:1]=[CH2:2].[H:3][H:4]>>[CH2:1]([H:3])[CH2:2]([H:4])",
}
its_true, _ = ITSExtraction.process_mapped_smiles(test_2, ["Map"])
its_false, _ = ITSExtraction.process_mapped_smiles(
test_2, ["Map"], sanitize=False
)
self.assertNotEqual(
len(its_true["ITSGraph"][2].nodes()), len(its_false["ITSGraph"][2].nodes())
)
self.assertEqual(len(its_true["ITSGraph"][2].nodes()), 2)
self.assertEqual(len(its_false["ITSGraph"][2].nodes()), 4)


if __name__ == "__main__":
unittest.main()
16 changes: 16 additions & 0 deletions syntemp/SynITS/its_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ def process_mapped_smiles(
- symbol (str): The symbol used to separate reactants and products in the
reaction SMILES string. Defaults to '>>'.
- sanitize (bool): Whether to sanitize the molecule(s).
- id_column (str): The name of the column in the dataframe that contains the
reaction ID. Defaults to 'R-id'.
- ignore_aromaticity (bool): Whether to ignore aromaticity in the reaction
graphs. Defaults to False.
- confident_mapper (str): The name of the mapper that was used to generate the
reaction graphs. Defaults to 'graphormer'.
- symbol (str): The symbol used to separate reactants and products in the
reaction SMILES string. Defaults to '>>'.
- sanitize (bool): Whether to sanitize the molecule(s).
Returns:
- Dict[str, any]: A dictionary containing graph representations for each reaction
Expand Down Expand Up @@ -217,6 +226,13 @@ def parallel_process_smiles(
Defaults to 'graphormer'.
- symbol (str): The symbol to use if the check_method is 'RC'. Defaults to '>>'.
- sanitize (bool): Whether to sanitize the molecule(s). Defaults to True.
- export_full (bool): Whether to export the full results. Defaults to False.
- ignore_aromaticity (bool): Whether to ignore aromaticity in the graph.
Defaults to False.
- confident_mapper (str): The mapper name to use if the check_method is 'RC'.
Defaults to 'graphormer'.
- symbol (str): The symbol to use if the check_method is 'RC'. Defaults to '>>'.
- sanitize (bool): Whether to sanitize the molecule(s). Defaults to True.
Returns:
- List[Dict[str, any]]: A list of dictionaries containing graph representations
Expand Down

0 comments on commit 110c5f9

Please sign in to comment.