Skip to content

Conversation

sevyharris
Copy link

Overview

The geometries for conformer generation aren't deterministic: #94

I added a random seed so that every time you generate a species conformer, TS, or set the chirality, you will get the same result.

This is important if you want to generate conformers in AutoTST and then go back and analyze them later. If you want to rebuild the AutoTST species objects in memory, you want to get the same result each time.

Testing

Here's the code I used to test species conformers:

all_atoms = ase.Atoms()
for i in range(3):
    my_species = autotst.species.Species(smiles=['CCCC'])
    all_atoms += my_species.conformers['CCCC'][0].get_ase_mol()
    
ase.visualize.view(all_atoms, viewer='x3d')

And setting the chirality:

# need chiral center example
all_atoms = ase.Atoms()
for i in range(10):

    my_chiral_smiles = 'ClC=C(C(Cl)N)O'
    my_chiral_species = autotst.species.Species(smiles=[my_chiral_smiles])
    
    chiral_centers = my_chiral_species.conformers[my_chiral_smiles][0].get_chiral_centers()
    my_chiral_species.conformers[my_chiral_smiles][0].set_chirality(chiral_centers[0].index, 'R')
    
    all_atoms += my_chiral_species.conformers[my_chiral_smiles][0].get_ase_mol()
  
ase.visualize.view(all_atoms, viewer='x3d')

And making the TS object:

all_atoms = ase.Atoms()
my_reaction_smiles = 'CCCC+[OH]_O+[CH2]CCC'
for i in range(5):
    
    my_reaction = autotst.reaction.Reaction(label=my_reaction_smiles)
    my_reaction.ts

    all_atoms += my_reaction.ts['forward'][0].ase_molecule

@sevyharris
Copy link
Author

Unclear whether setting the random seed is causing embed failure in old tests or whether tests are just old. Will investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant