From 57afc5e1db0d8e8c15df4b192635ddf50778cebe Mon Sep 17 00:00:00 2001 From: Bryan Raubenolt Date: Thu, 11 Nov 2021 13:50:28 -0500 Subject: [PATCH 1/4] added a new tool with an accessory python script, and also modified the macros.xml file --- tools/gromacs/insertmol.xml | 126 ++++++++++++++++++++++++++++++++++++ tools/gromacs/macros.xml | 1 + tools/gromacs/nmols.py | 15 +++++ 3 files changed, 142 insertions(+) create mode 100644 tools/gromacs/insertmol.xml create mode 100644 tools/gromacs/nmols.py diff --git a/tools/gromacs/insertmol.xml b/tools/gromacs/insertmol.xml new file mode 100644 index 00000000..5bf03db0 --- /dev/null +++ b/tools/gromacs/insertmol.xml @@ -0,0 +1,126 @@ + + to structure and topology files + + macros.xml + 0 + + + + python + + + > verbose.txt 2>&1 + && python '$__tool_directory__/nmols.py' + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/gromacs/macros.xml b/tools/gromacs/macros.xml index eec53d22..8d4a5de8 100644 --- a/tools/gromacs/macros.xml +++ b/tools/gromacs/macros.xml @@ -3,6 +3,7 @@ gromacs + diff --git a/tools/gromacs/nmols.py b/tools/gromacs/nmols.py new file mode 100644 index 00000000..f546e830 --- /dev/null +++ b/tools/gromacs/nmols.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +'#this script extracts the number of molecules succesfully added by gmx insert-molecules, and saves it as a string in a text file. This value can then be used to update topology information later on before running a simulation.' + +import re + + +inFile = open('verbose.txt', 'r') +outFile = open("addedmols.txt", "w") +lines = inFile.read() +result = re.search('Added(.*)molecules', lines) + +inFile.close() +outFile.write(str(result.group(1))) +outFile.close() From 1c63c775b63d25864d806fde73af65a1946f1d1d Mon Sep 17 00:00:00 2001 From: Bryan Raubenolt Date: Thu, 11 Nov 2021 14:16:20 -0500 Subject: [PATCH 2/4] new tool gmx insert-molecules and small edit to macros.xml --- tools/gromacs/insertmol.xml | 2 +- tools/gromacs/macros.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gromacs/insertmol.xml b/tools/gromacs/insertmol.xml index 5bf03db0..c653a721 100644 --- a/tools/gromacs/insertmol.xml +++ b/tools/gromacs/insertmol.xml @@ -15,7 +15,7 @@ ln -s '$mol_input' ./mol_input.gro && gmx insert-molecules -f ./gro_input.gro -ci ./mol_input.gro -o multiples.gro -nmol '$nmols' - #if $box.config == "true": + #if $str($box.config) == "true": -box $box.dim #end if diff --git a/tools/gromacs/macros.xml b/tools/gromacs/macros.xml index 8d4a5de8..d22e27fc 100644 --- a/tools/gromacs/macros.xml +++ b/tools/gromacs/macros.xml @@ -3,7 +3,7 @@ gromacs - + From fb0b511fa5de3ed172f3e0594772feaee35cf693 Mon Sep 17 00:00:00 2001 From: Bryan Raubenolt Date: Thu, 11 Nov 2021 14:31:32 -0500 Subject: [PATCH 3/4] changed required python version to 3.7, so it passes test --- tools/gromacs/insertmol.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gromacs/insertmol.xml b/tools/gromacs/insertmol.xml index c653a721..5fc6b8b4 100644 --- a/tools/gromacs/insertmol.xml +++ b/tools/gromacs/insertmol.xml @@ -6,7 +6,7 @@ - python + python Date: Thu, 11 Nov 2021 16:29:34 -0500 Subject: [PATCH 4/4] changed back to python3.8 and fixed the flake8 issue that was caussing a problem passing test on github --- tools/gromacs/insertmol.xml | 2 +- tools/gromacs/nmols.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gromacs/insertmol.xml b/tools/gromacs/insertmol.xml index 5fc6b8b4..c653a721 100644 --- a/tools/gromacs/insertmol.xml +++ b/tools/gromacs/insertmol.xml @@ -6,7 +6,7 @@ - python + python