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
''' | |
Written by Jan H. Jensen, 2020 | |
''' | |
from rdkit import Chem | |
import networkx as nx | |
def get_graph(mol): | |
Chem.Kekulize(mol) | |
atoms = [atom.GetAtomicNum() for atom in mol.GetAtoms()] |
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
#!/usr/bin/env python | |
import copy | |
import numpy as np | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
import itertools | |
smiles = 'CNCC[NH+](C)CC(F)C' | |
mol = Chem.MolFromSmiles(smiles) | |
N_atoms = mol.GetSubstructMatches(Chem.MolFromSmarts('N([*])[*]')) | |
chiral = Chem.FindMolChiralCenters(mol, includeUnassigned=True) |
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 Draw | |
from rdkit.Chem.Draw import IPythonConsole | |
import string | |
filename_smiles = "/Users/jan/Desktop/diels_alder.smiles" | |
molecules = [] | |
names = [] |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
from IPython.display import clear_output | |
import time | |
n_particles = 100 | |
for x in range(50): | |
clear_output(wait=True) | |
positions_x = [np.random.random() for i in range(n_particles)] |
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
#!/usr/bin/env python | |
import copy | |
import numpy as np | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
""" |
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 | |
from itertools import islice | |
raw_smiles = ['NCCN'] | |
smiles_list = ['NCCN'] | |
rxn_smarts_list = ['[C:1][*:2][C:3]>>[C:1]1[*:2][C:3]1','[C:1][C:2]>>[C:1][C][C:2]'] | |
molecules = [] | |
mol = Chem.MolFromSmiles(smiles_list[0]) |
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 | |
import itertools | |
atoms = ["C","N","O","F","Si","P","S","Cl","Br","I"] | |
bonds = ["","=","#"] | |
raw_smiles = [] | |
mols = [] | |
smiles_list = [] |
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 | |
from itertools import islice | |
smiles_list = ['C12=CC=CC=CC1CC=C2'] | |
#smiles_list = ['C1=CC2CC=CC2=c2ccccc2=C1'] | |
rxn_smarts_list = ['[CX3,cX3;H1:1]~[CX3,cX3;H1:2]>>[c:1]1[c:2]cccc1'] | |
molecules = [] | |
mol = Chem.MolFromSmiles(smiles_list[0]) | |
molecules.append(mol) |
NewerOlder