Write a standard OpenMM script when -x option is selected#17
Write a standard OpenMM script when -x option is selected#17mcancade wants to merge 4 commits intopaduagroup:masterfrom
Conversation
Write a standard OpenMM script when -x option is selected
agiliopadua
left a comment
There was a problem hiding this comment.
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.
I think it's clear to leave it as A000
| i = i - declim + hexlim | ||
| return f'{i:X}' | ||
|
|
||
| def intfromhexiflarge(a): |
|
|
||
| # f.write('\n') | ||
|
|
||
| def writeopenmm(self): |
There was a problem hiding this comment.
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.
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 |
|
|
||
| ET.indent(root, space=' ') | ||
| ftree.write('field.xml') | ||
|
|
There was a problem hiding this comment.
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') | ||
|
|
| 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 '\ |
| .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) |
No description provided.