-
Notifications
You must be signed in to change notification settings - Fork 61
Write a standard OpenMM script when -x option is selected #17
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
base: master
Are you sure you want to change the base?
Conversation
Write a standard OpenMM script when -x option is selected
agiliopadua
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we want to keep the functionality of PDB with hex for large-ish systems?
|
|
||
| def hexiflarge(i, ndig): | ||
| """ | ||
| Convert number to hex starting with A000... if more than n digits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's clear to leave it as A000
| i = i - declim + hexlim | ||
| return f'{i:X}' | ||
|
|
||
| def intfromhexiflarge(a): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is needed
|
|
||
| # f.write('\n') | ||
|
|
||
| def writeopenmm(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not elegant.
If the omm.py is immutable then we can supply it as a file in some directory with fftool.
In python the way to write chunks of text is as a multiline string """..."""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation is lost when using the multiline string notation. I'm not sure that it is clearer.
Supply a standard omm.py file with fftool is also a good option. For me, the workflow seems simpler if fftool writes the input files (such for LAMMPS); but for sure it depends on the user.
| c4 = -4 * dit.par[3] + eps | ||
| c5 = 0.0 | ||
| dimpr = ET.SubElement(torsionforce, 'Improper') | ||
| # in OpenMM atom 1 (not 3) is the central atom of an improper dihedral |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about this?
|
|
||
| ET.indent(root, space=' ') | ||
| ftree.write('field.xml') | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you think we should suppress the ability to handle pdf files with large-ish systems. Shouldn't we leave this for vmd for example?
|
|
||
| ET.indent(root, space=' ') | ||
| ftree.write('field.xml') | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above (line 2250)
| help = 'connect bonds across periodic boundaries in '\ | ||
| 'x, xy, xyz, etc. (default: none)') | ||
| parser.add_argument('-x', '--xml', action = 'store_true', | ||
| help = 'create OpenMM files .xml .pdb or .mmcif '\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep mmcif?
| .format(zfile, spec[i].name, spec[i].nmol, spec[i].ffile, | ||
| len(spec[i].atom), len(spec[i].bond), spec[i].topol, | ||
| spec[i].charge())) | ||
| natom += spec[i].nmol * len(spec[i].atom) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not using this anymore?
No description provided.