Example #1
0
def find_ts():
    """Find the transition state for the [4+2] Diels-Alder reaction between
    ethene and butadiene"""
    ade.Config.n_cores = 8
    ade.Config.ORCA.keywords.set_functional('PBE')

    rxn = ade.Reaction('C=CC=C.C=C>>C1=CCCCC1', name='DA')
    rxn.locate_transition_state()
    rxn.ts.print_xyz_file(filename='ts.xyz')
    return None
Example #2
0
    def add_smiles_rxns_from_file(filename):
        """Add reactions from a file with lines in the format:
         name  XX.YY>>ZZ"""

        with open(filename, 'r') as rxn_file:
            for line in rxn_file:
                solvent = None if len(line.split()) < 3 else line.split()[2]
                rxn = ade.Reaction(smiles=line.split()[1],
                                   name=line.split()[0],
                                   solvent_name=solvent)
                reactions.append(rxn)

        return None
Example #3
0
def test_prune_small_rings2():
    reaction = ade.Reaction('CCCC=C>>C=C.C=CC')
    reaction.find_complexes()

    ade.Config.skip_small_ring_tss = False
    bond_rearrs = br.get_bond_rearrangs(reactant=reaction.reactant,
                                        product=reaction.product,
                                        name='tmp',
                                        save=False)
    assert len(bond_rearrs) > 2

    ade.Config.skip_small_ring_tss = True

    br.prune_small_ring_rearrs(bond_rearrs, reaction.reactant)
    assert len(bond_rearrs) == 2

    # Should find the 6-membered TS
    assert (bond_rearrs[0].n_membered_rings(reaction.reactant) == [6]
            or bond_rearrs[1].n_membered_rings(reaction.reactant) == [6])
Example #4
0
    def add_xyz_rxns_from_file(filename):
        """Add reactions from a file with lines in the format:
         name  XX.YY>>ZZ"""

        with open(filename, 'r') as rxn_file:
            for line in rxn_file:
                name, rxn_str = line.split()
                reac_names, prod_names = rxn_str.split('>>')
                reacs = [
                    ade.Reactant(os.path.join(data_path, f'{name}.xyz'))
                    for name in reac_names.split('.')
                ]
                prods = [
                    ade.Product(os.path.join(data_path, f'{name}.xyz'))
                    for name in prod_names.split('.')
                ]

                rxn = ade.Reaction(*reacs, *prods, name=name)
                reactions.append(rxn)

        return None
Example #5
0
import autode as ade

ade.Config.n_cores = 8

reactant = ade.Reactant(name='3,4-dimethylhexa-1,5-diene',
                        smiles='C=C[C@H](C)[C@@H](C)C=C')
product = ade.Product(name='octa-2,6-diene', smiles='C/C=C/CC/C=C/C')

reaction = ade.Reaction(reactant, product, name='cope_rearrangement')
reaction.calculate_reaction_profile()
Example #6
0
import autode as ade

ade.Config.n_cores = 8

reaction = ade.Reaction('C=CC=C.C=C>>C1C=CCCC1', name='diels_alder')
reaction.calculate_reaction_profile()
Example #7
0
import autode as ade

ade.Config.n_cores = 8

ade.Config.ORCA.keywords.set_opt_basis_set('ma-def2-SVP')
ade.Config.ORCA.keywords.sp.basis_set = 'ma-def2-TZVP'

methoxide = ade.Reactant(name='methoxide', smiles='C[O-]')
propyl_chloride = ade.Reactant(name='propyl_chloride', smiles='CCCCl')
chloride = ade.Product(name='Cl-', smiles='[Cl-]')
propene = ade.Product(name='propene', smiles='CC=C')
methanol = ade.Product(name='methanol', smiles='CO')

reaction = ade.Reaction(methoxide,
                        propyl_chloride,
                        chloride,
                        propene,
                        methanol,
                        name='E2',
                        solvent_name='water')
reaction.calculate_reaction_profile()
Example #8
0
import autode as ade

ade.Config.n_cores = 8
ade.Config.hcode = 'g09'       # Use Gaussian09 as the high-level method

# For hydroxide to be not too reactive requires diffuse functions; set all the
ade.Config.G09.keywords.set_opt_basis_set('6-31+G(d)')
ade.Config.G09.keywords.sp.basis_set = '6-311+G(d,p)'

# Set up the first step in the hydrolysis of the ester, attack of OH- to get a
# tetrahedral intermediate
r1 = ade.Reactant(name='ester', smiles='CC(OC)=O')
r2 = ade.Reactant(name='hydroxide', smiles='[OH-]')
tet_int = ade.Product(name='tet_intermediate', smiles='CC([O-])(OC)O')

step1 = ade.Reaction(r1, r2, tet_int, solvent_name='water')

# Second step is collapse of the tetrahedral intermediate to the acid and
# methoxide
tet_int = ade.Reactant(name='tet_intermediate', smiles='CC([O-])(OC)O')
p1 = ade.Product(name='acid', smiles='CC(O)=O')
p2 = ade.Product(name='methodixe', smiles='[O-]C')

step2 = ade.Reaction(tet_int, p1, p2, solvent_name='water')

# Calculate the reactions in sequence, so the conformers of the tetrahedral
# intermediate do not need to be found again
reaction = ade.MultiStepReaction(step1, step2)
reaction.calculate_reaction_profile()
Example #9
0
import autode as ade

ade.Config.n_cores = 8

# Use a basis set with diffuse functions this reaction involving anionic CN-
ade.Config.ORCA.keywords.set_opt_basis_set('ma-def2-SVP')
ade.Config.ORCA.keywords.sp.basis_set = 'ma-def2-TZVP'

# Define a reaction as a single string, with reactants and products seperated
# by '>>'
reaction = ade.Reaction('CC(C)=O.[C-]#N>>CC([O-])(C#N)C', solvent_name='water')
reaction.calculate_reaction_profile()
Example #10
0
import autode as ade

ade.Config.n_cores = 8

flouride = ade.Reactant(name='F-', smiles='[F-]')
methyl_chloride = ade.Reactant(name='CH3Cl', smiles='ClC')
chloride = ade.Product(name='Cl-', smiles='[Cl-]')
methyl_flouride = ade.Product(name='CH3F', smiles='CF')

reaction = ade.Reaction(flouride,
                        methyl_chloride,
                        chloride,
                        methyl_flouride,
                        name='sn2',
                        solvent_name='water')
reaction.calculate_reaction_profile()