update
This commit is contained in:
@@ -19,8 +19,13 @@ def generate_gmx_top_files(directory, num_cores, forcefield="amber99sb-ildn", wa
|
||||
# Iterate over each PDB file and execute the GROMACS command
|
||||
for pdb_file in pdb_files:
|
||||
name = pdb_file.stem # Extract the name without the '.pdb' extension
|
||||
parent = pdb_file.parent
|
||||
output_gro = f"{name}.gro"
|
||||
topol_file = "topol.top"
|
||||
topol_file = f"{name}_topol.top"
|
||||
|
||||
# Check if topol_file already exists, and if so, skip this task
|
||||
if Path(topol_file).exists():
|
||||
continue
|
||||
|
||||
# Construct the command
|
||||
cmd = [
|
||||
@@ -35,7 +40,7 @@ def generate_gmx_top_files(directory, num_cores, forcefield="amber99sb-ildn", wa
|
||||
]
|
||||
|
||||
# Run the command and capture the standard error (stderr) to a log file
|
||||
log_file = pdb_file.absolute().parent.joinpath(f"{name}_gentop.log")
|
||||
log_file = parent.joinpath(f"{name}_topol.log")
|
||||
with open(log_file, "w") as log:
|
||||
subprocess.run(cmd, check=True, cwd=directory, stderr=log)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user