Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Commit

Permalink
minor fixes for gromacs file parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jharrymoore committed Feb 1, 2022
1 parent 49c7bcf commit ca44eaf
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![License](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://opensource.org/licenses/Apache-2.0)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![GitHub contributors](https://badgen.net/github/contributors/MolecularAI/Icolos)](https://GitHub.com/MolecularAI/Icolos/graphs/contributors/)
[![Latest tag](https://badgen.net/github/tag/MolecularAI/Icolos)](https://github.com/MolecularAI/Icolos/tag)
Expand Down
2 changes: 1 addition & 1 deletion src/icolos/core/flow_control/iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _initialize_steps(self) -> Union[List, StepBase]:

elif self.iter_settings.iter_mode == _IE.SINGLE:
# for n different settings, iterate through each, returning n steps
steps += self._initialize_single()
steps += self._initialize_settings()
elif self.iter_settings.iter_mode == _IE.ALL:
raise NotImplementedError
# initialise all combinations of steps by combining settings
Expand Down
8 changes: 2 additions & 6 deletions src/icolos/core/workflow_steps/gromacs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,8 @@ def _write_input_files(self, tmp_dir):
self._logger.log(
f"Writing input files to working directory at {tmp_dir}", _LE.DEBUG
)
# if we have an empty tmpdir:
if next(os.scandir(tmp_dir), None):
for file in self.data.generic.get_flattened_files():
file.write(tmp_dir)
else:
self._parse_output(tmp_dir)
for file in self.data.generic.get_flattened_files():
file.write(tmp_dir)

def _parse_arguments(self, flag_dict: dict, args: list = None) -> List:
arguments = args if args is not None else []
Expand Down
1 change: 0 additions & 1 deletion src/icolos/core/workflow_steps/gromacs/editconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def __init__(self, **data):
def execute(self):
tmp_dir = self._make_tmpdir()
self._write_input_files(tmp_dir)

structure_file = self.data.generic.get_argument_by_extension(
_SGE.FIELD_KEY_STRUCTURE
)
Expand Down
4 changes: 1 addition & 3 deletions src/icolos/core/workflow_steps/gromacs/mmpbsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ def _generate_amber_input_file(self) -> None:
else:
self._logger.log("No input file found, defaulting to template", _LE.WARNING)
# parses user arguments and creates the formatted amber input file from the user specification
with open(
attach_root_path("icolos/config/amber/default_mmpbsa.in"), "r"
) as f:
with open(attach_root_path(_SGE.DEFAULT_MMPBSA_IN), "r") as f:
template = GenericData(file_name="mmpbsa.in", file_data=f.read())

self.data.generic.add_file(template)
Expand Down
1 change: 1 addition & 0 deletions src/icolos/utils/enums/step_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ class StepGromacsEnum:
CLUSTERS_NUMBER = "clustersNumber"
LENGTHS = "lengths"
COUPLING_GROUPS = "coupling_groups"
DEFAULT_MMPBSA_IN = "src/icolos/config/amber/default_mmpbsa.in"

def __getattr__(self, name):
if name in self:
Expand Down

0 comments on commit ca44eaf

Please sign in to comment.