diff --git a/README.md b/README.md index d7d58a0..18b74e5 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![](https://img.shields.io/conda/vn/bioconda/biobb_gromacs?label=Conda)](https://anaconda.org/bioconda/biobb_gromacs) [![](https://img.shields.io/conda/dn/bioconda/biobb_gromacs?label=Conda%20Downloads)](https://anaconda.org/bioconda/biobb_gromacs) [![](https://img.shields.io/badge/Docker-Quay.io-blue)](https://quay.io/repository/biocontainers/biobb_gromacs?tab=tags) -[![](https://img.shields.io/badge/Singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_gromacs:4.2.0--pyhdfd78af_0) +[![](https://img.shields.io/badge/Singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_gromacs:5.0.0--pyhdfd78af_0) [![](https://img.shields.io/badge/OS-Unix%20%7C%20MacOS-blue)](https://github.com/bioexcel/biobb_gromacs) [![](https://img.shields.io/pypi/pyversions/biobb-gromacs.svg?label=Python%20Versions)](https://pypi.org/project/biobb-gromacs/) @@ -42,7 +42,7 @@ The latest documentation of this package can be found in our readthedocs site: [latest API documentation](http://biobb-gromacs.readthedocs.io/en/latest/). ### Version -v4.2.0 2024.2 +v5.0.0 2024.2 ### Installation Using PIP: @@ -52,7 +52,7 @@ Using PIP: * Installation: - pip install "biobb_gromacs>=4.2.0" + pip install "biobb_gromacs>=5.0.0" * Usage: [Python API documentation](https://biobb-gromacs.readthedocs.io/en/latest/modules.html) @@ -62,7 +62,7 @@ Using ANACONDA: * Installation: - conda install -c bioconda "biobb_gromacs>=4.2.0" + conda install -c bioconda "biobb_gromacs>=5.0.0" * Usage: With conda installation BioBBs can be used with the [Python API documentation](https://biobb-gromacs.readthedocs.io/en/latest/modules.html) and the [Command Line documentation](https://biobb-gromacs.readthedocs.io/en/latest/command_line.html) @@ -72,13 +72,13 @@ Using DOCKER: * Installation: - docker pull quay.io/biocontainers/biobb_gromacs:4.2.0--pyhdfd78af_0 + docker pull quay.io/biocontainers/biobb_gromacs:5.0.0--pyhdfd78af_0 * Usage: - docker run quay.io/biocontainers/biobb_gromacs:4.2.0--pyhdfd78af_0 + docker run quay.io/biocontainers/biobb_gromacs:5.0.0--pyhdfd78af_0 Using SINGULARITY: @@ -88,7 +88,7 @@ Using SINGULARITY: * Installation: - singularity pull --name biobb_gromacs.sif https://depot.galaxyproject.org/singularity/biobb_gromacs:4.2.0--pyhdfd78af_0 + singularity pull --name biobb_gromacs.sif https://depot.galaxyproject.org/singularity/biobb_gromacs:5.0.0--pyhdfd78af_0 * Usage: diff --git a/biobb_gromacs/__init__.py b/biobb_gromacs/__init__.py index 77a8a50..235ee1c 100644 --- a/biobb_gromacs/__init__.py +++ b/biobb_gromacs/__init__.py @@ -1,6 +1,5 @@ -from . import gromacs -from . import gromacs_extra +from . import gromacs, gromacs_extra name = "biobb_gromacs" __all__ = ["gromacs", "gromacs_extra"] -__version__ = "4.2.0" +__version__ = "5.0.0" diff --git a/biobb_gromacs/docs/source/change_log.md b/biobb_gromacs/docs/source/change_log.md index 702a692..6f9c3bf 100644 --- a/biobb_gromacs/docs/source/change_log.md +++ b/biobb_gromacs/docs/source/change_log.md @@ -1,5 +1,22 @@ # Biobb GROMACS changelog +## What's new in version [5.0.0](https://github.com/bioexcel/biobb_gromacs/releases/tag/v5.0.0)? + +### Changes + +* [CI/CD](env.yaml): Update biobb_common version. +* [Typing](ALL): Update typing from python 3.8 style to python 3.9 +* [CI/CD](conf.yml): Adding global properties to test yaml configuration +* [CI/CD](linting_and_testing.yaml): Update GA test workflow to Python >3.9 +* [DOCS](.readthedocs.yaml): Updating to Python 3.9 +* [CI/CD](GITIGNORE): Update .gitignore to include the new file extensions to ignore +* [CI/CD](conf.yml): Change test conf.yml to adapt to new settings configuration +* [CI/CD](py.typed): Adding the py.typed +* [FIX] Adding execution permissions to append_ligand +* [UPDATE] Adding sandbox_path property to the json schemas +* [FEATURE] New sandbox_path property +* [CI/CD] Update grompp reference files and GA WF + ## What's new in version [4.2.0](https://github.com/bioexcel/biobb_gromacs/releases/tag/v4.2.0)? ### Changes diff --git a/biobb_gromacs/docs/source/conf.py b/biobb_gromacs/docs/source/conf.py index 1832a1e..29368de 100644 --- a/biobb_gromacs/docs/source/conf.py +++ b/biobb_gromacs/docs/source/conf.py @@ -18,7 +18,7 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, str(Path('../../').resolve())) +sys.path.insert(0, str(Path("../../").resolve())) # -- General configuration ------------------------------------------------ @@ -29,14 +29,14 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.coverage', - 'sphinx.ext.mathjax', - 'sphinx.ext.ifconfig', - 'sphinx.ext.viewcode', - 'sphinx.ext.napoleon', - 'sphinx_rtd_theme', - 'recommonmark' + "sphinx.ext.autodoc", + "sphinx.ext.coverage", + "sphinx.ext.mathjax", + "sphinx.ext.ifconfig", + "sphinx.ext.viewcode", + "sphinx.ext.napoleon", + "sphinx_rtd_theme", + "recommonmark", ] # Using Google docstring style @@ -44,7 +44,7 @@ napoleon_google_docstring = True # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: @@ -55,7 +55,7 @@ # '.md': 'recommonmark.parser.CommonMarkParser', # } -source_suffix = ['.rst', '.md'] +source_suffix = [".rst", ".md"] # source_suffix = { # '.rst': 'restructuredtext', @@ -66,21 +66,21 @@ # source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. -project = u'biobb_gromacs' -copyright = u'2024, Bioexcel Project' -author = u'Bioexcel Project' +project = "biobb_gromacs" +copyright = "2024, Bioexcel Project" +author = "Bioexcel Project" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = u'4.2.0' +version = "5.0.0" # The full version, including alpha/beta/rc tags. -release = u'4.2.0' +release = "5.0.0" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -97,7 +97,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = [] +exclude_patterns: list = [] # The reST default role (used for this markup: `text`) to use for all # documents. @@ -115,7 +115,7 @@ # show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] @@ -129,14 +129,13 @@ # -- Options for HTML output ---------------------------------------------- def setup(app): - - app.add_css_file('theme_overrides.css') - app.add_js_file('theme_overrides.js') + app.add_css_file("theme_overrides.css") + app.add_js_file("theme_overrides.js") # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'sphinx_rtd_theme' +html_theme = "sphinx_rtd_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -165,7 +164,7 @@ def setup(app): # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied @@ -228,20 +227,17 @@ def setup(app): # html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. -htmlhelp_basename = 'biobb_gromacs_doc' +htmlhelp_basename = "biobb_gromacs_doc" # -- Options for LaTeX output --------------------------------------------- -latex_elements = { +latex_elements: dict = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. # 'preamble': '', - # Latex figure (float) alignment # 'figure_align': 'htbp', } @@ -250,8 +246,13 @@ def setup(app): # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'biobb_gromacs.tex', u'biobb_gromacs Documentation', - u'Bioexcel Project', 'manual'), + ( + master_doc, + "biobb_gromacs.tex", + "biobb_gromacs Documentation", + "Bioexcel Project", + "manual", + ), ] # The name of an image file (relative to this directory) to place at the top of @@ -279,10 +280,7 @@ def setup(app): # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'biobb_gromacs', u'biobb_gromacs Documentation', - [author], 1) -] +man_pages = [(master_doc, "biobb_gromacs", "biobb_gromacs Documentation", [author], 1)] # If true, show URL addresses after external links. # man_show_urls = False @@ -294,10 +292,15 @@ def setup(app): # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'biobb_gromacs', u'biobb_gromacs Documentation', - author, 'biobb_gromacs', - 'biobb_gromacs molecular dynamics building blocks', - 'Miscellaneous'), + ( + master_doc, + "biobb_gromacs", + "biobb_gromacs Documentation", + author, + "biobb_gromacs", + "biobb_gromacs molecular dynamics building blocks", + "Miscellaneous", + ), ] # Documents to append as an appendix to all manuals. diff --git a/biobb_gromacs/docs/source/readme.md b/biobb_gromacs/docs/source/readme.md index a34cf3a..18b74e5 100644 --- a/biobb_gromacs/docs/source/readme.md +++ b/biobb_gromacs/docs/source/readme.md @@ -3,7 +3,7 @@ [![](https://img.shields.io/conda/vn/bioconda/biobb_gromacs?label=Conda)](https://anaconda.org/bioconda/biobb_gromacs) [![](https://img.shields.io/conda/dn/bioconda/biobb_gromacs?label=Conda%20Downloads)](https://anaconda.org/bioconda/biobb_gromacs) [![](https://img.shields.io/badge/Docker-Quay.io-blue)](https://quay.io/repository/biocontainers/biobb_gromacs?tab=tags) -[![](https://img.shields.io/badge/Singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_gromacs:4.2.0--pyhdfd78af_0) +[![](https://img.shields.io/badge/Singularity-GalaxyProject-blue)](https://depot.galaxyproject.org/singularity/biobb_gromacs:5.0.0--pyhdfd78af_0) [![](https://img.shields.io/badge/OS-Unix%20%7C%20MacOS-blue)](https://github.com/bioexcel/biobb_gromacs) [![](https://img.shields.io/pypi/pyversions/biobb-gromacs.svg?label=Python%20Versions)](https://pypi.org/project/biobb-gromacs/) @@ -12,7 +12,7 @@ [![](https://readthedocs.org/projects/biobb-gromacs/badge/?version=latest&label=Docs)](https://biobb-gromacs.readthedocs.io/en/latest/?badge=latest) [![](https://img.shields.io/website?down_message=Offline&label=Biobb%20Website&up_message=Online&url=https%3A%2F%2Fmmb.irbbarcelona.org%2Fbiobb%2F)](https://mmb.irbbarcelona.org/biobb/) -[![](https://img.shields.io/badge/Youtube-tutorial-blue?logo=youtube&logoColor=red)](https://www.youtube.com/watch?v=ou1DOGNs0xM) +[![](https://img.shields.io/badge/Youtube-tutorials-blue?logo=youtube&logoColor=red)](https://www.youtube.com/@BioExcelCoE/search?query=biobb) [![](https://zenodo.org/badge/DOI/10.1038/s41597-019-0177-4.svg)](https://doi.org/10.1038/s41597-019-0177-4) [![](https://img.shields.io/endpoint?color=brightgreen&url=https%3A%2F%2Fapi.juleskreuer.eu%2Fcitation-badge.php%3Fshield%26doi%3D10.1038%2Fs41597-019-0177-4)](https://www.nature.com/articles/s41597-019-0177-4#citeas) @@ -42,7 +42,7 @@ The latest documentation of this package can be found in our readthedocs site: [latest API documentation](http://biobb-gromacs.readthedocs.io/en/latest/). ### Version -v4.2.0 2024.2 +v5.0.0 2024.2 ### Installation Using PIP: @@ -52,7 +52,7 @@ Using PIP: * Installation: - pip install "biobb_gromacs>=4.2.0" + pip install "biobb_gromacs>=5.0.0" * Usage: [Python API documentation](https://biobb-gromacs.readthedocs.io/en/latest/modules.html) @@ -62,7 +62,7 @@ Using ANACONDA: * Installation: - conda install -c bioconda "biobb_gromacs>=4.2.0" + conda install -c bioconda "biobb_gromacs>=5.0.0" * Usage: With conda installation BioBBs can be used with the [Python API documentation](https://biobb-gromacs.readthedocs.io/en/latest/modules.html) and the [Command Line documentation](https://biobb-gromacs.readthedocs.io/en/latest/command_line.html) @@ -72,13 +72,13 @@ Using DOCKER: * Installation: - docker pull quay.io/biocontainers/biobb_gromacs:4.2.0--pyhdfd78af_0 + docker pull quay.io/biocontainers/biobb_gromacs:5.0.0--pyhdfd78af_0 * Usage: - docker run quay.io/biocontainers/biobb_gromacs:4.2.0--pyhdfd78af_0 + docker run quay.io/biocontainers/biobb_gromacs:5.0.0--pyhdfd78af_0 Using SINGULARITY: @@ -88,7 +88,7 @@ Using SINGULARITY: * Installation: - singularity pull --name biobb_gromacs.sif https://depot.galaxyproject.org/singularity/biobb_gromacs:4.2.0--pyhdfd78af_0 + singularity pull --name biobb_gromacs.sif https://depot.galaxyproject.org/singularity/biobb_gromacs:5.0.0--pyhdfd78af_0 * Usage: diff --git a/biobb_gromacs/docs/source/schema.html b/biobb_gromacs/docs/source/schema.html index 29669e0..1bca1cc 100644 --- a/biobb_gromacs/docs/source/schema.html +++ b/biobb_gromacs/docs/source/schema.html @@ -10,7 +10,7 @@ "applicationSubCategory": "http://www.edamontology.org/topic_3892", "citation": "https://www.nature.com/articles/s41597-019-0177-4", "license": "https://www.apache.org/licenses/LICENSE-2.0", - "softwareVersion": "4.2.0", + "softwareVersion": "5.0.0", "applicationSuite": "BioBB BioExcel Building Blocks", "codeRepository": "https://github.com/bioexcel/biobb_gromacs", "isAccessibleForFree": "True", diff --git a/biobb_gromacs/gromacs/editconf.py b/biobb_gromacs/gromacs/editconf.py index a6408fc..92debe4 100755 --- a/biobb_gromacs/gromacs/editconf.py +++ b/biobb_gromacs/gromacs/editconf.py @@ -1,14 +1,16 @@ #!/usr/bin/env python3 """Module containing the Editconf class and the command line interface.""" + import argparse from typing import Optional -from biobb_common.generic.biobb_object import BiobbObject + from biobb_common.configuration import settings +from biobb_common.generic.biobb_object import BiobbObject from biobb_common.tools import file_utils as fu from biobb_common.tools.file_utils import launchlogger + from biobb_gromacs.gromacs.common import get_gromacs_version -from typing import Optional class Editconf(BiobbObject): @@ -57,7 +59,13 @@ class Editconf(BiobbObject): * schema: http://edamontology.org/EDAM.owl """ - def __init__(self, input_gro_path: str, output_gro_path: str, properties: Optional[dict] = None, **kwargs) -> None: + def __init__( + self, + input_gro_path: str, + output_gro_path: str, + properties: Optional[dict] = None, + **kwargs, + ) -> None: properties = properties or {} # Call parent class constructor @@ -67,24 +75,24 @@ def __init__(self, input_gro_path: str, output_gro_path: str, properties: Option # Input/Output files self.io_dict = { "in": {"input_gro_path": input_gro_path}, - "out": {"output_gro_path": output_gro_path} + "out": {"output_gro_path": output_gro_path}, } # Properties specific for BB - self.distance_to_molecule = properties.get('distance_to_molecule', 1.0) - self.box_vector_lenghts = properties.get('box_vector_lenghts') - self.box_type = properties.get('box_type', 'cubic') - self.center_molecule = properties.get('center_molecule', True) + self.distance_to_molecule = properties.get("distance_to_molecule", 1.0) + self.box_vector_lenghts = properties.get("box_vector_lenghts") + self.box_type = properties.get("box_type", "cubic") + self.center_molecule = properties.get("center_molecule", True) # Properties common in all GROMACS BB - self.gmx_lib = properties.get('gmx_lib', None) - self.binary_path: str = properties.get('binary_path', 'gmx') - self.gmx_nobackup = properties.get('gmx_nobackup', True) - self.gmx_nocopyright = properties.get('gmx_nocopyright', True) + self.gmx_lib = properties.get("gmx_lib", None) + self.binary_path: str = properties.get("binary_path", "gmx") + self.gmx_nobackup = properties.get("gmx_nobackup", True) + self.gmx_nocopyright = properties.get("gmx_nocopyright", True) if self.gmx_nobackup: - self.binary_path += ' -nobackup' + self.binary_path += " -nobackup" if self.gmx_nocopyright: - self.binary_path += ' -nocopyright' + self.binary_path += " -nocopyright" if not self.container_path: self.gmx_version = get_gromacs_version(self.binary_path) @@ -102,10 +110,16 @@ def launch(self) -> int: self.stage_files() # Create command line - self.cmd = [self.binary_path, 'editconf', - '-f', self.stage_io_dict["in"]["input_gro_path"], - '-o', self.stage_io_dict["out"]["output_gro_path"], - '-bt', self.box_type] + self.cmd = [ + self.binary_path, + "editconf", + "-f", + self.stage_io_dict["in"]["input_gro_path"], + "-o", + self.stage_io_dict["out"]["output_gro_path"], + "-bt", + self.box_type, + ] if self.box_vector_lenghts: if not isinstance(self.box_vector_lenghts, str): @@ -113,13 +127,17 @@ def launch(self) -> int: self.cmd.append("-box") self.cmd.append(self.box_vector_lenghts) else: - self.cmd.append('-d') + self.cmd.append("-d") self.cmd.append(str(self.distance_to_molecule)) - fu.log("Distance of the box to molecule: %6.2f" % self.distance_to_molecule, self.out_log, self.global_log) + fu.log( + "Distance of the box to molecule: %6.2f" % self.distance_to_molecule, + self.out_log, + self.global_log, + ) if self.center_molecule: - self.cmd.append('-c') - fu.log('Centering molecule in the box.', self.out_log, self.global_log) + self.cmd.append("-c") + fu.log("Centering molecule in the box.", self.out_log, self.global_log) fu.log("Box type: %s" % self.box_type, self.out_log, self.global_log) @@ -140,32 +158,51 @@ def launch(self) -> int: return self.return_code -def editconf(input_gro_path: str, output_gro_path: str, properties: Optional[dict] = None, **kwargs) -> int: +def editconf( + input_gro_path: str, + output_gro_path: str, + properties: Optional[dict] = None, + **kwargs, +) -> int: """Create :class:`Editconf ` class and execute the :meth:`launch() ` method.""" - return Editconf(input_gro_path=input_gro_path, output_gro_path=output_gro_path, - properties=properties, **kwargs).launch() + return Editconf( + input_gro_path=input_gro_path, + output_gro_path=output_gro_path, + properties=properties, + **kwargs, + ).launch() def main(): - parser = argparse.ArgumentParser(description="Wrapper of the GROMACS gmx editconf module.", - formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999)) - parser.add_argument('-c', '--config', required=False, help="This file can be a YAML file, JSON file or JSON string") + parser = argparse.ArgumentParser( + description="Wrapper of the GROMACS gmx editconf module.", + formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999), + ) + parser.add_argument( + "-c", + "--config", + required=False, + help="This file can be a YAML file, JSON file or JSON string", + ) # Specific args of each building block - required_args = parser.add_argument_group('required arguments') - required_args.add_argument('--input_gro_path', required=True) - required_args.add_argument('--output_gro_path', required=True) + required_args = parser.add_argument_group("required arguments") + required_args.add_argument("--input_gro_path", required=True) + required_args.add_argument("--output_gro_path", required=True) args = parser.parse_args() config = args.config if args.config else None properties = settings.ConfReader(config=config).get_prop_dic() # Specific call of each building block - editconf(input_gro_path=args.input_gro_path, output_gro_path=args.output_gro_path, - properties=properties) + editconf( + input_gro_path=args.input_gro_path, + output_gro_path=args.output_gro_path, + properties=properties, + ) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/biobb_gromacs/gromacs/genion.py b/biobb_gromacs/gromacs/genion.py index 2683bbb..30060f9 100755 --- a/biobb_gromacs/gromacs/genion.py +++ b/biobb_gromacs/gromacs/genion.py @@ -1,16 +1,18 @@ #!/usr/bin/env python3 """Module containing the Genion class and the command line interface.""" -import shutil + import argparse -from typing import Optional +import shutil from pathlib import Path -from biobb_common.generic.biobb_object import BiobbObject +from typing import Optional, Union + from biobb_common.configuration import settings +from biobb_common.generic.biobb_object import BiobbObject from biobb_common.tools import file_utils as fu from biobb_common.tools.file_utils import launchlogger + from biobb_gromacs.gromacs.common import get_gromacs_version -from typing import Optional, Union class Genion(BiobbObject): @@ -64,8 +66,16 @@ class Genion(BiobbObject): * schema: http://edamontology.org/EDAM.owl """ - def __init__(self, input_tpr_path: Union[str, Path], output_gro_path: Union[str, Path], input_top_zip_path: Union[str, Path], - output_top_zip_path: Union[str, Path], input_ndx_path: Optional[Union[str, Path]] = None, properties: Optional[dict] = None, **kwargs) -> None: + def __init__( + self, + input_tpr_path: Union[str, Path], + output_gro_path: Union[str, Path], + input_top_zip_path: Union[str, Path], + output_top_zip_path: Union[str, Path], + input_ndx_path: Optional[Union[str, Path]] = None, + properties: Optional[dict] = None, + **kwargs, + ) -> None: properties = properties or {} # Call parent class constructor @@ -75,23 +85,28 @@ def __init__(self, input_tpr_path: Union[str, Path], output_gro_path: Union[str, # Input/Output files self.io_dict = { "in": {"input_tpr_path": input_tpr_path, "input_ndx_path": input_ndx_path}, - "out": {"output_gro_path": output_gro_path, "output_top_zip_path": output_top_zip_path} + "out": { + "output_gro_path": output_gro_path, + "output_top_zip_path": output_top_zip_path, + }, } # Should not be copied inside container self.input_top_zip_path = input_top_zip_path # Properties specific for BB - self.output_top_path = properties.get('output_top_path', 'gio.top') # Not in documentation for clarity - self.replaced_group = properties.get('replaced_group', 'SOL') - self.neutral = properties.get('neutral', False) - self.concentration = properties.get('concentration', 0.05) - self.seed = properties.get('seed', 1993) + self.output_top_path = properties.get( + "output_top_path", "gio.top" + ) # Not in documentation for clarity + self.replaced_group = properties.get("replaced_group", "SOL") + self.neutral = properties.get("neutral", False) + self.concentration = properties.get("concentration", 0.05) + self.seed = properties.get("seed", 1993) # Properties common in all GROMACS BB - self.gmx_lib = properties.get('gmx_lib', None) - self.binary_path = properties.get('binary_path', 'gmx') - self.gmx_nobackup = properties.get('gmx_nobackup', True) - self.gmx_nocopyright = properties.get('gmx_nocopyright', True) + self.gmx_lib = properties.get("gmx_lib", None) + self.binary_path = properties.get("binary_path", "gmx") + self.gmx_nobackup = properties.get("gmx_nobackup", True) + self.gmx_nocopyright = properties.get("gmx_nocopyright", True) if self.gmx_nobackup: self.binary_path = f"{self.binary_path} -nobackup" if self.gmx_nocopyright: @@ -111,7 +126,9 @@ def launch(self) -> int: if self.check_restart(): return 0 - self.io_dict['in']['stdin_file_path'] = fu.create_stdin_file(f'{self.replaced_group}') + self.io_dict["in"]["stdin_file_path"] = fu.create_stdin_file( + f"{self.replaced_group}" + ) self.stage_files() # Unzip topology to topology_out @@ -119,37 +136,58 @@ def launch(self) -> int: top_dir = str(Path(top_file).parent) if self.container_path: - shutil.copytree(top_dir, Path(str(self.stage_io_dict.get("unique_dir", ""))).joinpath(Path(top_dir).name)) - top_file = str(Path(self.container_volume_path).joinpath(Path(top_dir).name, Path(top_file).name)) - - self.cmd = [str(self.binary_path), 'genion', - '-s', self.stage_io_dict["in"]["input_tpr_path"], - '-o', self.stage_io_dict["out"]["output_gro_path"], - '-p', top_file] - - if self.stage_io_dict["in"].get("input_ndx_path") and Path( - self.stage_io_dict["in"].get("input_ndx_path")).exists(): - self.cmd.append('-n') + shutil.copytree( + top_dir, + Path(str(self.stage_io_dict.get("unique_dir", ""))).joinpath( + Path(top_dir).name + ), + ) + top_file = str( + Path(self.container_volume_path).joinpath( + Path(top_dir).name, Path(top_file).name + ) + ) + + self.cmd = [ + str(self.binary_path), + "genion", + "-s", + self.stage_io_dict["in"]["input_tpr_path"], + "-o", + self.stage_io_dict["out"]["output_gro_path"], + "-p", + top_file, + ] + + if ( + self.stage_io_dict["in"].get("input_ndx_path") + and Path(self.stage_io_dict["in"].get("input_ndx_path")).exists() + ): + self.cmd.append("-n") self.cmd.append(self.stage_io_dict["in"].get("input_ndx_path")) if self.neutral: - self.cmd.append('-neutral') + self.cmd.append("-neutral") if self.concentration: - self.cmd.append('-conc') + self.cmd.append("-conc") self.cmd.append(str(self.concentration)) - fu.log('To reach up %g mol/litre concentration' % self.concentration, self.out_log, self.global_log) + fu.log( + "To reach up %g mol/litre concentration" % self.concentration, + self.out_log, + self.global_log, + ) if self.seed is not None: - self.cmd.append('-seed') + self.cmd.append("-seed") self.cmd.append(str(self.seed)) # Add stdin input file - self.cmd.append('<') + self.cmd.append("<") self.cmd.append(self.stage_io_dict["in"]["stdin_file_path"]) if self.gmx_lib: - self.env_vars_dict['GMXLIB'] = self.gmx_lib + self.env_vars_dict["GMXLIB"] = self.gmx_lib # Run Biobb block self.run_biobb() @@ -158,53 +196,96 @@ def launch(self) -> int: self.copy_to_host() if self.container_path: - top_file = str(Path(str(self.stage_io_dict.get("unique_dir", ""))).joinpath(Path(top_dir).name, Path(top_file).name)) + top_file = str( + Path(str(self.stage_io_dict.get("unique_dir", ""))).joinpath( + Path(top_dir).name, Path(top_file).name + ) + ) # zip topology - fu.log('Compressing topology to: %s' % self.stage_io_dict["out"]["output_top_zip_path"], - self.out_log, self.global_log) - fu.zip_top(zip_file=self.io_dict["out"]["output_top_zip_path"], top_file=top_file, out_log=self.out_log) + fu.log( + "Compressing topology to: %s" + % self.stage_io_dict["out"]["output_top_zip_path"], + self.out_log, + self.global_log, + ) + fu.zip_top( + zip_file=self.io_dict["out"]["output_top_zip_path"], + top_file=top_file, + out_log=self.out_log, + ) # Remove temporal files - self.tmp_files.extend([str(self.stage_io_dict.get("unique_dir", "")), top_dir, str(self.io_dict['in'].get("stdin_file_path"))]) + self.tmp_files.extend( + [ + str(self.stage_io_dict.get("unique_dir", "")), + top_dir, + str(self.io_dict["in"].get("stdin_file_path")), + ] + ) self.remove_tmp_files() self.check_arguments(output_files_created=True, raise_exception=True) return self.return_code -def genion(input_tpr_path: Union[str, Path], output_gro_path: Union[str, Path], input_top_zip_path: Union[str, Path], - output_top_zip_path: Union[str, Path], input_ndx_path: Optional[Union[str, Path]] = None, properties: Optional[dict] = None, **kwargs) -> int: +def genion( + input_tpr_path: Union[str, Path], + output_gro_path: Union[str, Path], + input_top_zip_path: Union[str, Path], + output_top_zip_path: Union[str, Path], + input_ndx_path: Optional[Union[str, Path]] = None, + properties: Optional[dict] = None, + **kwargs, +) -> int: """Create :class:`Genion ` class and - execute the :meth:`launch() ` method.""" - return Genion(input_tpr_path=input_tpr_path, output_gro_path=output_gro_path, - input_top_zip_path=input_top_zip_path, output_top_zip_path=output_top_zip_path, - input_ndx_path=input_ndx_path, properties=properties, **kwargs).launch() + execute the :meth:`launch() ` method.""" + return Genion( + input_tpr_path=input_tpr_path, + output_gro_path=output_gro_path, + input_top_zip_path=input_top_zip_path, + output_top_zip_path=output_top_zip_path, + input_ndx_path=input_ndx_path, + properties=properties, + **kwargs, + ).launch() def main(): """Command line execution of this building block. Please check the command line documentation.""" - parser = argparse.ArgumentParser(description="Wrapper for the GROMACS genion module.", - formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999)) - parser.add_argument('-c', '--config', required=False, help="This file can be a YAML file, JSON file or JSON string") + parser = argparse.ArgumentParser( + description="Wrapper for the GROMACS genion module.", + formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999), + ) + parser.add_argument( + "-c", + "--config", + required=False, + help="This file can be a YAML file, JSON file or JSON string", + ) # Specific args of each building block - required_args = parser.add_argument_group('required arguments') - required_args.add_argument('--input_tpr_path', required=True) - required_args.add_argument('--output_gro_path', required=True) - required_args.add_argument('--input_top_zip_path', required=True) - required_args.add_argument('--output_top_zip_path', required=True) - parser.add_argument('--input_ndx_path', required=False) + required_args = parser.add_argument_group("required arguments") + required_args.add_argument("--input_tpr_path", required=True) + required_args.add_argument("--output_gro_path", required=True) + required_args.add_argument("--input_top_zip_path", required=True) + required_args.add_argument("--output_top_zip_path", required=True) + parser.add_argument("--input_ndx_path", required=False) args = parser.parse_args() config = args.config if args.config else None properties = settings.ConfReader(config=config).get_prop_dic() # Specific call of each building block - genion(input_tpr_path=args.input_tpr_path, output_gro_path=args.output_gro_path, - input_top_zip_path=args.input_top_zip_path, output_top_zip_path=args.output_top_zip_path, - input_ndx_path=args.input_ndx_path, properties=properties) + genion( + input_tpr_path=args.input_tpr_path, + output_gro_path=args.output_gro_path, + input_top_zip_path=args.input_top_zip_path, + output_top_zip_path=args.output_top_zip_path, + input_ndx_path=args.input_ndx_path, + properties=properties, + ) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/biobb_gromacs/gromacs/genrestr.py b/biobb_gromacs/gromacs/genrestr.py index 5215ecb..0ebf47b 100755 --- a/biobb_gromacs/gromacs/genrestr.py +++ b/biobb_gromacs/gromacs/genrestr.py @@ -1,15 +1,17 @@ #!/usr/bin/env python3 """Module containing the Genrestr class and the command line interface.""" + import argparse -from typing import Optional -from biobb_common.generic.biobb_object import BiobbObject +from pathlib import Path +from typing import Optional, Union + from biobb_common.configuration import settings +from biobb_common.generic.biobb_object import BiobbObject from biobb_common.tools import file_utils as fu from biobb_common.tools.file_utils import launchlogger + from biobb_gromacs.gromacs.common import get_gromacs_version -from pathlib import Path -from typing import Union, Optional class Genrestr(BiobbObject): @@ -57,8 +59,14 @@ class Genrestr(BiobbObject): * schema: http://edamontology.org/EDAM.owl """ - def __init__(self, input_structure_path: Union[str, Path], output_itp_path: Union[str, Path], - input_ndx_path: Optional[Union[str, Path]] = None, properties: Optional[dict] = None, **kwargs) -> None: + def __init__( + self, + input_structure_path: Union[str, Path], + output_itp_path: Union[str, Path], + input_ndx_path: Optional[Union[str, Path]] = None, + properties: Optional[dict] = None, + **kwargs, + ) -> None: properties = properties or {} # Call parent class constructor @@ -67,19 +75,22 @@ def __init__(self, input_structure_path: Union[str, Path], output_itp_path: Unio # Input/Output files self.io_dict = { - "in": {"input_structure_path": input_structure_path, "input_ndx_path": input_ndx_path}, - "out": {"output_itp_path": output_itp_path} + "in": { + "input_structure_path": input_structure_path, + "input_ndx_path": input_ndx_path, + }, + "out": {"output_itp_path": output_itp_path}, } # Properties specific for BB - self.force_constants = str(properties.get('force_constants', '500 500 500')) - self.restrained_group = properties.get('restrained_group', 'system') + self.force_constants = str(properties.get("force_constants", "500 500 500")) + self.restrained_group = properties.get("restrained_group", "system") # Properties common in all GROMACS BB - self.gmx_lib = properties.get('gmx_lib', None) - self.binary_path = properties.get('binary_path', 'gmx') - self.gmx_nobackup = properties.get('gmx_nobackup', True) - self.gmx_nocopyright = properties.get('gmx_nocopyright', True) + self.gmx_lib = properties.get("gmx_lib", None) + self.binary_path = properties.get("binary_path", "gmx") + self.gmx_nobackup = properties.get("gmx_nobackup", True) + self.gmx_nocopyright = properties.get("gmx_nocopyright", True) if self.gmx_nobackup: self.binary_path = f"{self.binary_path} -nobackup" if self.gmx_nocopyright: @@ -99,12 +110,19 @@ def launch(self) -> int: if self.check_restart(): return 0 - self.io_dict['in']['stdin_file_path'] = fu.create_stdin_file(f'{self.restrained_group}') + self.io_dict["in"]["stdin_file_path"] = fu.create_stdin_file( + f"{self.restrained_group}" + ) self.stage_files() - self.cmd = [str(self.binary_path), "genrestr", - "-f", self.stage_io_dict["in"]["input_structure_path"], - "-o", self.stage_io_dict["out"]["output_itp_path"]] + self.cmd = [ + str(self.binary_path), + "genrestr", + "-f", + self.stage_io_dict["in"]["input_structure_path"], + "-o", + self.stage_io_dict["out"]["output_itp_path"], + ] if not isinstance(self.force_constants, str): self.force_constants = " ".join(map(str, self.force_constants)) @@ -113,15 +131,15 @@ def launch(self) -> int: self.cmd.append(self.force_constants) if self.stage_io_dict["in"].get("input_ndx_path"): - self.cmd.append('-n') + self.cmd.append("-n") self.cmd.append(self.stage_io_dict["in"]["input_ndx_path"]) # Add stdin input file - self.cmd.append('<') + self.cmd.append("<") self.cmd.append(self.stage_io_dict["in"]["stdin_file_path"]) if self.gmx_lib: - self.env_vars_dict['GMXLIB'] = self.gmx_lib + self.env_vars_dict["GMXLIB"] = self.gmx_lib # Run Biobb block self.run_biobb() @@ -130,42 +148,68 @@ def launch(self) -> int: self.copy_to_host() # Remove temporal files - self.tmp_files.extend([str(self.stage_io_dict.get("unique_dir", "")), str(self.io_dict['in'].get("stdin_file_path"))]) + self.tmp_files.extend( + [ + str(self.stage_io_dict.get("unique_dir", "")), + str(self.io_dict["in"].get("stdin_file_path")), + ] + ) self.remove_tmp_files() self.check_arguments(output_files_created=True, raise_exception=False) return self.return_code -def genrestr(input_structure_path: Union[str, Path], output_itp_path: Union[str, Path], - input_ndx_path: Optional[Union[str, Path]] = None, properties: Optional[dict] = None, **kwargs) -> int: +def genrestr( + input_structure_path: Union[str, Path], + output_itp_path: Union[str, Path], + input_ndx_path: Optional[Union[str, Path]] = None, + properties: Optional[dict] = None, + **kwargs, +) -> int: """Create :class:`Genrestr ` class and execute the :meth:`launch() ` method.""" - return Genrestr(input_structure_path=input_structure_path, output_itp_path=output_itp_path, - input_ndx_path=input_ndx_path, properties=properties, **kwargs).launch() + return Genrestr( + input_structure_path=input_structure_path, + output_itp_path=output_itp_path, + input_ndx_path=input_ndx_path, + properties=properties, + **kwargs, + ).launch() def main(): """Command line execution of this building block. Please check the command line documentation.""" - parser = argparse.ArgumentParser(description="Wrapper for the GROMACS genion module.", - formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999)) - parser.add_argument('-c', '--config', required=False, help="This file can be a YAML file, JSON file or JSON string") + parser = argparse.ArgumentParser( + description="Wrapper for the GROMACS genion module.", + formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999), + ) + parser.add_argument( + "-c", + "--config", + required=False, + help="This file can be a YAML file, JSON file or JSON string", + ) # Specific args of each building block - required_args = parser.add_argument_group('required arguments') - required_args.add_argument('--input_structure_path', required=True) - required_args.add_argument('--output_itp_path', required=True) - parser.add_argument('--input_ndx_path', required=False) + required_args = parser.add_argument_group("required arguments") + required_args.add_argument("--input_structure_path", required=True) + required_args.add_argument("--output_itp_path", required=True) + parser.add_argument("--input_ndx_path", required=False) args = parser.parse_args() config = args.config if args.config else None properties = settings.ConfReader(config=config).get_prop_dic() # Specific call of each building block - genrestr(input_structure_path=args.input_structure_path, input_ndx_path=args.input_ndx_path, - output_itp_path=args.output_itp_path, properties=properties) + genrestr( + input_structure_path=args.input_structure_path, + input_ndx_path=args.input_ndx_path, + output_itp_path=args.output_itp_path, + properties=properties, + ) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/biobb_gromacs/gromacs_extra/append_ligand.py b/biobb_gromacs/gromacs_extra/append_ligand.py index ce78977..c45a143 100755 --- a/biobb_gromacs/gromacs_extra/append_ligand.py +++ b/biobb_gromacs/gromacs_extra/append_ligand.py @@ -1,14 +1,15 @@ #!/usr/bin/env python3 """Module containing the AppendLigand class and the command line interface.""" -import re + import argparse -from typing import Optional +import re import shutil from pathlib import Path from typing import Optional -from biobb_common.generic.biobb_object import BiobbObject + from biobb_common.configuration import settings +from biobb_common.generic.biobb_object import BiobbObject from biobb_common.tools import file_utils as fu from biobb_common.tools.file_utils import launchlogger @@ -49,8 +50,15 @@ class AppendLigand(BiobbObject): * schema: http://edamontology.org/EDAM.owl """ - def __init__(self, input_top_zip_path: str, input_itp_path: str, output_top_zip_path: str, - input_posres_itp_path: Optional[str] = None, properties: Optional[dict] = None, **kwargs) -> None: + def __init__( + self, + input_top_zip_path: str, + input_itp_path: str, + output_top_zip_path: str, + input_posres_itp_path: Optional[str] = None, + properties: Optional[dict] = None, + **kwargs, + ) -> None: properties = properties or {} # Call parent class constructor @@ -59,13 +67,16 @@ def __init__(self, input_top_zip_path: str, input_itp_path: str, output_top_zip_ # Input/Output files self.io_dict = { - "in": {"input_top_zip_path": input_top_zip_path, "input_itp_path": input_itp_path, - "input_posres_itp_path": input_posres_itp_path}, - "out": {"output_top_zip_path": output_top_zip_path} + "in": { + "input_top_zip_path": input_top_zip_path, + "input_itp_path": input_itp_path, + "input_posres_itp_path": input_posres_itp_path, + }, + "out": {"output_top_zip_path": output_top_zip_path}, } # Properties specific for BB - self.posres_name = properties.get('posres_name', 'POSRES_LIGAND') + self.posres_name = properties.get("posres_name", "POSRES_LIGAND") # Check the properties self.check_properties(properties) @@ -79,74 +90,103 @@ def launch(self) -> int: return 0 # Unzip topology - top_file = fu.unzip_top(zip_file=str(self.io_dict['in'].get("input_top_zip_path")), out_log=self.out_log) + top_file = fu.unzip_top( + zip_file=str(self.io_dict["in"].get("input_top_zip_path")), + out_log=self.out_log, + ) top_dir = str(Path(top_file).parent) - itp_name = str(Path(str(self.io_dict['in'].get("input_itp_path"))).name) + itp_name = str(Path(str(self.io_dict["in"].get("input_itp_path"))).name) with open(top_file) as top_f: top_lines = top_f.readlines() top_f.close() fu.rm(top_file) - forcefield_pattern = r'#include.*forcefield.itp\"' + forcefield_pattern = r"#include.*forcefield.itp\"" if top_lines: for index, line in enumerate(top_lines): if re.search(forcefield_pattern, line): break else: - fu.log(f'FATAL: Input topfile {top_file} from input_top_zip_path {self.io_dict["in"].get("input_top_zip_path")} is empty.', self.out_log, self.global_log) + fu.log( + f'FATAL: Input topfile {top_file} from input_top_zip_path {self.io_dict["in"].get("input_top_zip_path")} is empty.', + self.out_log, + self.global_log, + ) return 1 - top_lines.insert(index+1, '\n') - top_lines.insert(index+2, '; Including ligand ITP\n') - top_lines.insert(index+3, '#include "' + itp_name + '"\n') - top_lines.insert(index+4, '\n') - if self.io_dict['in'].get("input_posres_itp_path"): - top_lines.insert(index+5, '; Ligand position restraints'+'\n') - top_lines.insert(index+6, '#ifdef '+self.posres_name+'\n') - top_lines.insert(index+7, '#include "'+str(Path(self.io_dict['in'].get("input_posres_itp_path", "")).name)+'"\n') - top_lines.insert(index+8, '#endif'+'\n') - top_lines.insert(index+9, '\n') + top_lines.insert(index + 1, "\n") + top_lines.insert(index + 2, "; Including ligand ITP\n") + top_lines.insert(index + 3, '#include "' + itp_name + '"\n') + top_lines.insert(index + 4, "\n") + if self.io_dict["in"].get("input_posres_itp_path"): + top_lines.insert(index + 5, "; Ligand position restraints" + "\n") + top_lines.insert(index + 6, "#ifdef " + self.posres_name + "\n") + top_lines.insert( + index + 7, + '#include "' + + str(Path(self.io_dict["in"].get("input_posres_itp_path", "")).name) + + '"\n', + ) + top_lines.insert(index + 8, "#endif" + "\n") + top_lines.insert(index + 9, "\n") inside_moleculetype_section = False - with open(self.io_dict['in'].get("input_itp_path", "")) as itp_file: - moleculetype_pattern = r'\[ moleculetype \]' + with open(self.io_dict["in"].get("input_itp_path", "")) as itp_file: + moleculetype_pattern = r"\[ moleculetype \]" for line in itp_file: if re.search(moleculetype_pattern, line): inside_moleculetype_section = True continue - if inside_moleculetype_section and not line.startswith(';'): + if inside_moleculetype_section and not line.startswith(";"): moleculetype = line.strip().split()[0].strip() break - molecules_pattern = r'\[ molecules \]' + molecules_pattern = r"\[ molecules \]" inside_molecules_section = False index_molecule = None - molecule_string = str(moleculetype)+int(20-len(moleculetype))*' '+'1'+'\n' + molecule_string = ( + str(moleculetype) + int(20 - len(moleculetype)) * " " + "1" + "\n" + ) for index, line in enumerate(top_lines): if re.search(molecules_pattern, line): inside_molecules_section = True continue - if inside_molecules_section and not line.startswith(';') and line.upper().startswith('PROTEIN'): + if ( + inside_molecules_section + and not line.startswith(";") + and line.upper().startswith("PROTEIN") + ): index_molecule = index if index_molecule: - top_lines.insert(index_molecule+1, molecule_string) + top_lines.insert(index_molecule + 1, molecule_string) else: top_lines.append(molecule_string) - new_top = fu.create_name(path=top_dir, prefix=self.prefix, step=self.step, name='ligand.top') + new_top = fu.create_name( + path=top_dir, prefix=self.prefix, step=self.step, name="ligand.top" + ) - with open(new_top, 'w') as new_top_f: + with open(new_top, "w") as new_top_f: new_top_f.write("".join(top_lines)) - shutil.copy2(self.io_dict['in'].get("input_itp_path", ""), top_dir) - if self.io_dict['in'].get("input_posres_itp_path"): - shutil.copy2(self.io_dict['in'].get("input_posres_itp_path", ""), top_dir) + shutil.copy2(self.io_dict["in"].get("input_itp_path", ""), top_dir) + if self.io_dict["in"].get("input_posres_itp_path"): + shutil.copy2(self.io_dict["in"].get("input_posres_itp_path", ""), top_dir) # zip topology - fu.log('Compressing topology to: %s' % self.io_dict['out'].get("output_top_zip_path"), self.out_log, self.global_log) - fu.zip_top(zip_file=self.io_dict['out'].get("output_top_zip_path", ""), top_file=new_top, out_log=self.out_log) + fu.log( + "Compressing topology to: %s" + % self.io_dict["out"].get("output_top_zip_path"), + self.out_log, + self.global_log, + ) + fu.zip_top( + zip_file=self.io_dict["out"].get("output_top_zip_path", ""), + top_file=new_top, + out_log=self.out_log, + ) # Remove temporal files self.tmp_files.append(top_dir) @@ -156,39 +196,59 @@ def launch(self) -> int: return 0 -def append_ligand(input_top_zip_path: str, input_itp_path: str, output_top_zip_path: str, - input_posres_itp_path: Optional[str] = None, properties: Optional[dict] = None, **kwargs) -> int: +def append_ligand( + input_top_zip_path: str, + input_itp_path: str, + output_top_zip_path: str, + input_posres_itp_path: Optional[str] = None, + properties: Optional[dict] = None, + **kwargs, +) -> int: """Create :class:`AppendLigand ` class and execute the :meth:`launch() ` method.""" - return AppendLigand(input_top_zip_path=input_top_zip_path, - input_itp_path=input_itp_path, - output_top_zip_path=output_top_zip_path, - input_posres_itp_path=input_posres_itp_path, - properties=properties, **kwargs).launch() + return AppendLigand( + input_top_zip_path=input_top_zip_path, + input_itp_path=input_itp_path, + output_top_zip_path=output_top_zip_path, + input_posres_itp_path=input_posres_itp_path, + properties=properties, + **kwargs, + ).launch() def main(): """Command line execution of this building block. Please check the command line documentation.""" - parser = argparse.ArgumentParser(description="Wrapper of the GROMACS editconf module.", - formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999)) - parser.add_argument('-c', '--config', required=False, help="This file can be a YAML file, JSON file or JSON string") + parser = argparse.ArgumentParser( + description="Wrapper of the GROMACS editconf module.", + formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog, width=99999), + ) + parser.add_argument( + "-c", + "--config", + required=False, + help="This file can be a YAML file, JSON file or JSON string", + ) # Specific args of each building block - required_args = parser.add_argument_group('required arguments') - required_args.add_argument('--input_top_zip_path', required=True) - required_args.add_argument('--input_itp_path', required=True) - required_args.add_argument('--output_top_zip_path', required=True) - parser.add_argument('--input_posres_itp_path', required=False) + required_args = parser.add_argument_group("required arguments") + required_args.add_argument("--input_top_zip_path", required=True) + required_args.add_argument("--input_itp_path", required=True) + required_args.add_argument("--output_top_zip_path", required=True) + parser.add_argument("--input_posres_itp_path", required=False) args = parser.parse_args() config = args.config if args.config else None properties = settings.ConfReader(config=config).get_prop_dic() # Specific call of each building block - append_ligand(input_top_zip_path=args.input_top_zip_path, input_itp_path=args.input_itp_path, - output_top_zip_path=args.output_top_zip_path, input_posres_itp_path=args.input_posres_itp_path, - properties=properties) + append_ligand( + input_top_zip_path=args.input_top_zip_path, + input_itp_path=args.input_itp_path, + output_top_zip_path=args.output_top_zip_path, + input_posres_itp_path=args.input_posres_itp_path, + properties=properties, + ) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/biobb_gromacs/json_schemas/biobb_gromacs.json b/biobb_gromacs/json_schemas/biobb_gromacs.json index 3e059cd..517d621 100644 --- a/biobb_gromacs/json_schemas/biobb_gromacs.json +++ b/biobb_gromacs/json_schemas/biobb_gromacs.json @@ -4,9 +4,9 @@ "github": "https://github.com/bioexcel/biobb_gromacs", "readthedocs": "https://biobb-gromacs.readthedocs.io/en/latest/", "conda": "https://anaconda.org/bioconda/biobb_gromacs", - "docker": "https://quay.io/biocontainers/biobb_gromacs:4.2.0--pyhdfd78af_0", - "singularity": "https://depot.galaxyproject.org/singularity/biobb_gromacs:4.2.0--pyhdfd78af_0", - "version": "4.2.0", + "docker": "https://quay.io/biocontainers/biobb_gromacs:5.0.0--pyhdfd78af_0", + "singularity": "https://depot.galaxyproject.org/singularity/biobb_gromacs:5.0.0--pyhdfd78af_0", + "version": "5.0.0", "rest": false, "tools": [ { @@ -115,12 +115,12 @@ } ], "dep_pypi": [ - "install_requires=['biobb_common==4.2.0']", - "python_requires='>=3.8'" + "install_requires=['biobb_common==5.0.0']", + "python_requires='>=3.9'" ], "dep_conda": [ - "python >=3.8", - "biobb_common ==4.2.0", + "python >=3.9", + "biobb_common ==5.0.0", "gromacs=2022.2=nompi_h1c20066_100" ], "keywords": [ diff --git a/setup.py b/setup.py index 0a51ecb..46c0802 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="biobb_gromacs", - version="4.2.0", + version="5.0.0", author="Biobb developers", author_email="pau.andrio@bsc.es", description="biobb_gromacs is the Biobb module collection to perform molecular dynamics simulations.", @@ -15,12 +15,12 @@ url="https://github.com/bioexcel/biobb_gromacs", project_urls={ "Documentation": "http://biobb-gromacs.readthedocs.io/en/latest/", - "Bioexcel": "https://bioexcel.eu/" + "Bioexcel": "https://bioexcel.eu/", }, - packages=setuptools.find_packages(exclude=['docs', 'test']), - package_data={'biobb_gromacs': ['py.typed']}, - install_requires=['biobb_common==4.2.0'], - python_requires='>=3.8', + packages=setuptools.find_packages(exclude=["docs", "test"]), + package_data={"biobb_gromacs": ["py.typed"]}, + install_requires=["biobb_common==5.0.0"], + python_requires=">=3.9", entry_points={ "console_scripts": [ "editconf = biobb_gromacs.gromacs.editconf:main", @@ -35,17 +35,15 @@ "solvate = biobb_gromacs.gromacs.solvate:main", "trjcat = biobb_gromacs.gromacs.trjcat:main", "ndx2resttop = biobb_gromacs.gromacs_extra.ndx2resttop:main", - "append_ligand = biobb_gromacs.gromacs_extra.append_ligand:main" + "append_ligand = biobb_gromacs.gromacs_extra.append_ligand:main", ] }, classifiers=[ "Development Status :: 5 - Production/Stable", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", - "Operating System :: Unix" + "Operating System :: Unix", ], )