Skip to content

Commit

Permalink
adding workflow functions to parameterize entire box
Browse files Browse the repository at this point in the history
  • Loading branch information
tlfobe authored and tlfobe committed Mar 2, 2024
1 parent 4eaa011 commit 38ecae7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 5 additions & 3 deletions terphenyl_simulations/analysis_workflows/remd.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ def build_system(job):
packmol_builder.solvate_system()
os.chdir(top_dir)

@FlowProject.operation
def parameterize_solvated_system(job):
pass


@FlowProject.pre.after(build_foldamer)
@FlowProject.post(
Expand All @@ -113,14 +117,12 @@ def minimize_foldamer(job):
os.chdir(job.fn(""))
gmx_wrapper = terphenyl_simulations.gromacs_wrapper.GromacsWrapper(job.sp['gromacs_exe'])
out_name = job.doc['foldamer_gro'].split('.gro')[0] + '_centered.gro'
gmx_wrapper.center(job.doc['foldamer_gro'], out_name)
gmx_wrapper.center_configuration(job.doc['foldamer_gro'], out_name)
job.doc['foldamer_gro'] = out_name
gmx_wrapper.minimize(job.doc['foldamer_gro'], job.doc['foldamer_topology'])

os.chdir(top_dir)



@FlowProject.pre.after(build_system)
@FlowProject.operation
def parameterize_system(job):
Expand Down
10 changes: 9 additions & 1 deletion terphenyl_simulations/gromacs_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,21 @@ def __init__(self, gromacs_exe = None, path = '.'):
self.mpi = True
self.gmx = 'mpirun -np 1 ' + self.gmx

def center(self, gro_file, out_file):
def center_configuration(self, gro_file, out_file):
editconf_call = self.gmx + ' editconf -f ' + gro_file + \
' -c yes' + \
' -o ' + out_file
process = subprocess.Popen(editconf_call.split(' '))
process.wait()

def add_box(self, gro_file, box_size, out_file):
editconf_call = self.gmx + ' editconf -f ' + gro_file + \
' -box ' + str(box_size) + \
' -o ' + out_file
process = subprocess.Popen(editconf_call.split(' '))
process.wait()


def minimize(self, gro_file, top_file, prefix = 'em', mdp = 'em.mdp'):
# Check for mdp file
if not mdp in os.listdir(self.path):
Expand Down

0 comments on commit 38ecae7

Please sign in to comment.