Created
December 4, 2017 13:26
-
-
Save jhjensen2/5b11757cb1e82c70137bd937f1595d28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rdkit import Chem | |
from rdkit.Chem import AllChem | |
#reactant_smiles = "C12=CC=CC=CC1CC=C2" | |
#reactant_smiles = "N#CC1(C#N)C2C=CC=CC=C2C=C1C3=CC=CC=C3" | |
reactant_smiles = "N#CC1(C#N)C2C=CC=C(C=CC=C3)C3=C2C=C1C4=CC=CC=C4" | |
reactant = Chem.MolFromSmiles(reactant_smiles) | |
print Chem.MolToSmiles(reactant) | |
Chem.Kekulize(reactant,clearAromaticFlags=True) | |
print Chem.MolToSmiles(reactant) | |
rxn_smarts = "[C:1]12=[C:2][C:3]=[C:4][C:5]=[C:6][C:7]1[C:8][C:9]=[C:10]2>>[C:8]=[C:9][C:10]=[C:1]1[C:2]=[C:3][C:4]=[C:5][C:6]=[C:7]1" | |
rxn = AllChem.ReactionFromSmarts(rxn_smarts) | |
product = rxn.RunReactants((reactant,)) | |
print Chem.MolToSmiles(product[0][0]) | |
molecules = [] | |
molecules.append(reactant) | |
molecules.append(product[0][0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment