Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-reproducible behaviour of addMissingAtoms #176

Open
JoaoRodrigues opened this issue Oct 3, 2018 · 0 comments
Open

Non-reproducible behaviour of addMissingAtoms #176

JoaoRodrigues opened this issue Oct 3, 2018 · 0 comments

Comments

@JoaoRodrigues
Copy link
Contributor

Running addMissingAtoms() gives different results because the LocalEnergyMinimizer does not allow setting a random seed from pdbfixer. The end result is that re-built sidechains are pointing in different directions at every different try, which is not good for reproducibilty. Setting random.seed and np.random.seed does not help. The following code snippet ran on any structure missing heavy atoms will reproduce the problem.

for i in range(5):
    random.seed(917)

    import pdbfixer as pf
    from simtk.openmm.app import PDBFile

    mol = pf.PDBFixer('../example/4xt1_AB.pdb')
    mol.findMissingResidues()
    mol.findMissingAtoms()
    mol.addMissingAtoms()

    with open('output_{}.pdb'.format(i), 'w') as handle:
        PDBFile.writeFile(mol.topology, mol.positions, handle)

My suggestion would be add an optional seed parameter to addMissingAtoms that then sets the integrator seed. I'll follow with a pull request.

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

No branches or pull requests

1 participant