-
Notifications
You must be signed in to change notification settings - Fork 14
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
Tleap InterMol support #146
Changes from 12 commits
56194a9
cd7d2d5
d1c94bd
abb9dcc
4a5ad58
954d74a
6500c26
fb2e5c1
ecc5b5f
1c53df6
50650d2
36e4568
dc094be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -392,3 +392,76 @@ def test_multiple_pdb_files(clean_files): | |
assert "b = loadpdb cb6-but-minimized.pdb" in lines | ||
assert "combine" in lines | ||
assert "savepdb model multi.pdb" in lines | ||
|
||
|
||
def test_conversions(clean_files): | ||
""" Test that conversion methods work in Tleap module. """ | ||
temporary_directory = os.path.join(os.path.dirname(__file__), "tmp") | ||
|
||
but_frcmod = os.path.abspath( | ||
os.path.join(os.path.dirname(__file__), "../data/cb6-but/but.frcmod") | ||
) | ||
but_mol2 = os.path.abspath( | ||
os.path.join(os.path.dirname(__file__), "../data/cb6-but/but.mol2") | ||
) | ||
|
||
sys = System() | ||
sys.template_lines = [ | ||
"source leaprc.gaff", | ||
f"loadamberparams {but_frcmod}", | ||
f"BUT = loadmol2 {but_mol2}", | ||
f"model = loadmol2 {but_mol2}", | ||
] | ||
sys.output_path = temporary_directory | ||
sys.output_prefix = "but" | ||
sys.pbc_type = None | ||
sys.neutralize = False | ||
sys.build() | ||
|
||
from paprika.utils import is_file_and_not_empty | ||
|
||
# Gromacs ParmEd test | ||
sys.convert_to_gromacs(overwrite=True) | ||
top_file = os.path.join(sys.output_path, sys.output_prefix + ".top") | ||
gro_file = os.path.join(sys.output_path, sys.output_prefix + ".gro") | ||
assert is_file_and_not_empty(top_file) is True | ||
assert is_file_and_not_empty(gro_file) is True | ||
|
||
# Gromacs InterMol test | ||
sys.convert_to_gromacs(toolkit=System.ConversionToolkit.InterMol) | ||
assert is_file_and_not_empty(top_file) is True | ||
assert is_file_and_not_empty(gro_file) is True | ||
top_file = os.path.join(sys.output_path, sys.output_prefix + "_from_amber.top") | ||
gro_file = os.path.join(sys.output_path, sys.output_prefix + "_from_amber.gro") | ||
assert is_file_and_not_empty(top_file) is True | ||
assert is_file_and_not_empty(gro_file) is True | ||
Comment on lines
+437
to
+438
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Totally out of scope here, but if for any reason you find yourself needing to also compare the energies before and after conversion, InterMol does that pretty well. I'll be working on doing this independently elsewhere in the next month or two, so it could possibly be something you can get for free in the future. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that would be a better way for testing, but you would need the MD executables to evaluate the energies? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but they're mostly/all conda installable (save Desmond, I think) so it's possible to do that in a separate CI build There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will (most) probably need help in configuring the CI build (sometime in the future). This will be useful to test the simulation wrappers as well. |
||
|
||
# CHARMM ParmEd test | ||
sys.convert_to_charmm() | ||
psf_file = os.path.join(sys.output_path, sys.output_prefix + ".psf") | ||
crd_file = os.path.join(sys.output_path, sys.output_prefix + ".crd") | ||
|
||
assert is_file_and_not_empty(psf_file) is True | ||
assert is_file_and_not_empty(crd_file) is True | ||
|
||
# CHARMM Intermol test | ||
sys.convert_to_charmm(toolkit=System.ConversionToolkit.InterMol) | ||
rtf_file = os.path.join(sys.output_path, sys.output_prefix + ".rtf") | ||
prm_file = os.path.join(sys.output_path, sys.output_prefix + ".prm") | ||
|
||
assert is_file_and_not_empty(psf_file) is True | ||
assert is_file_and_not_empty(crd_file) is True | ||
assert is_file_and_not_empty(rtf_file) is True | ||
assert is_file_and_not_empty(prm_file) is True | ||
|
||
# LAMMPS test | ||
sys.convert_to_lammps() | ||
input_file = os.path.join(sys.output_path, sys.output_prefix + ".input") | ||
lmp_file = os.path.join(sys.output_path, sys.output_prefix + ".lmp") | ||
assert is_file_and_not_empty(input_file) is True | ||
assert is_file_and_not_empty(lmp_file) is True | ||
|
||
# DESMOND test | ||
sys.convert_to_desmond() | ||
cms_file = os.path.join(sys.output_path, sys.output_prefix + ".cms") | ||
assert is_file_and_not_empty(cms_file) is True |
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.
Any thought about getting
intermol
ontoconda-forge
? I can't even find this channel after spending five minutes of Googling.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.
Yeah, that's just my "personal" channel where I dump stuff from time to time. It's not really intended to be used by others, although I didn't put anything in place to prevent that. I don't believe I advertised this build, but again there's nothing hidden about it.
Putting it on
conda-forge
is something that probably should be done at some point. It should be feasible - the deps are really light - but some of the package structure might need a refresh. I can take it on.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.
Ah! I didn't even connect
mwt
with @mattwthompson. Ha.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.
Yeah, I found the package by searching
Intermol
on the anaconda website. It's not urgent, but if you can get it toconda-forge
then 😍