diff --git a/README.md b/README.md index 82851966e06fe025b1836f4d43f1b85e386de06a..5154196e1e4a441d1e96ff28b15d5bb63874dfa9 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The latest documentation of this package can be found in our readthedocs site: [latest API documentation](http://biobb_common.readthedocs.io/en/latest/). ### Version -v3.6.0 2021.2 +v3.7.0 2021.3 ### Copyright & Licensing This software has been developed in the [MMB group](http://mmb.irbbarcelona.org) at the [BSC](http://www.bsc.es/) & [IRB](https://www.irbbarcelona.org/) for the [European BioExcel](http://bioexcel.eu/), funded by the European Commission (EU H2020 [823830](http://cordis.europa.eu/projects/823830), EU H2020 [675728](http://cordis.europa.eu/projects/675728)). diff --git a/biobb_common/docs/source/conf.py b/biobb_common/docs/source/conf.py index 23ab44db9cc5b7f1193070c2420370d2b9eb65e9..ba7cb776fa1331d695a3b919d60cf24eab867315 100644 --- a/biobb_common/docs/source/conf.py +++ b/biobb_common/docs/source/conf.py @@ -67,7 +67,7 @@ master_doc = 'index' # General information about the project. project = u'biobb_common' -copyright = u'2019, Bioexcel Project' +copyright = u'2021, Bioexcel Project' author = u'Bioexcel Project' # The version info for the project you're documenting, acts as replacement for @@ -75,9 +75,9 @@ author = u'Bioexcel Project' # built documents. # # The short X.Y version. -version = u'2.0.1' +version = u'3.7.0' # The full version, including alpha/beta/rc tags. -release = u'2.0.1' +release = u'2021.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/biobb_common/docs/source/readme.md b/biobb_common/docs/source/readme.md index 82851966e06fe025b1836f4d43f1b85e386de06a..5154196e1e4a441d1e96ff28b15d5bb63874dfa9 100644 --- a/biobb_common/docs/source/readme.md +++ b/biobb_common/docs/source/readme.md @@ -16,7 +16,7 @@ The latest documentation of this package can be found in our readthedocs site: [latest API documentation](http://biobb_common.readthedocs.io/en/latest/). ### Version -v3.6.0 2021.2 +v3.7.0 2021.3 ### Copyright & Licensing This software has been developed in the [MMB group](http://mmb.irbbarcelona.org) at the [BSC](http://www.bsc.es/) & [IRB](https://www.irbbarcelona.org/) for the [European BioExcel](http://bioexcel.eu/), funded by the European Commission (EU H2020 [823830](http://cordis.europa.eu/projects/823830), EU H2020 [675728](http://cordis.europa.eu/projects/675728)). diff --git a/biobb_common/docs/source/schema.html b/biobb_common/docs/source/schema.html index a1c6fde9a015e5b6003d15647d8000f7f598eb5a..d0ee8a81acfecdba028c862d0486795ef8813cdc 100644 --- a/biobb_common/docs/source/schema.html +++ b/biobb_common/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": "3.6.0", + "softwareVersion": "3.7.0", "applicationSuite": "BioBB BioExcel Building Blocks", "codeRepository": "https://github.com/bioexcel/biobb_common", "isAccessibleForFree": "True", diff --git a/biobb_common/generic/biobb_object.py b/biobb_common/generic/biobb_object.py index 9a5ed062c7497fe89601f329c4e5d9bb853b915b..274b80ee8240bfa7870360f804346a582c82400b 100644 --- a/biobb_common/generic/biobb_object.py +++ b/biobb_common/generic/biobb_object.py @@ -39,7 +39,9 @@ class BiobbObject: self.container_working_dir = properties.get('container_working_dir') self.container_user_id = properties.get('container_user_id') self.container_shell_path = properties.get('container_shell_path', '/bin/bash') - self.container_io_dict = { "in": {}, "out": {} } + + # stage + self.stage_io_dict = { "in": {}, "out": {} } # Properties common in all BB self.can_write_console_log = properties.get('can_write_console_log', True) @@ -70,15 +72,15 @@ class BiobbObject: def check_restart(self) -> bool: if self.restart: - if fu.check_complete_files(output_file_list): + if fu.check_complete_files(self.io_dict["out"].values()): fu.log('Restart is enabled, this step: %s will the skipped' % self.step, self.out_log, self.global_log) return True return False - def copy_to_container(self): + def stage_files(self): if self.container_path: unique_dir = str(Path(fu.create_unique_dir()).resolve()) - self.container_io_dict = {"in": {}, "out": {}, "unique_dir": unique_dir} + self.stage_io_dict = {"in": {}, "out": {}, "unique_dir": unique_dir} # IN files COPY and assign INTERNAL PATH for file_ref, file_path in self.io_dict["in"].items(): @@ -86,21 +88,21 @@ class BiobbObject: if Path(file_path).exists(): shutil.copy2(file_path, unique_dir) fu.log(f'Copy: {file_path} to {unique_dir}', self.out_log) - self.container_io_dict["in"][file_ref] = str(Path(self.container_volume_path).joinpath(Path(file_path).name)) + self.stage_io_dict["in"][file_ref] = str(Path(self.container_volume_path).joinpath(Path(file_path).name)) else: # Default files in GMXLIB path like gmx_solvate -> input_solvent_gro_path (spc216.gro) - self.container_io_dict["in"][file_ref] = file_path + self.stage_io_dict["in"][file_ref] = file_path # OUT files assign INTERNAL PATH for file_ref, file_path in self.io_dict["out"].items(): if file_path: - self.container_io_dict["out"][file_ref] = str(Path(self.container_volume_path).joinpath(Path(file_path).name)) + self.stage_io_dict["out"][file_ref] = str(Path(self.container_volume_path).joinpath(Path(file_path).name)) else: - self.container_io_dict = self.io_dict + self.stage_io_dict = self.io_dict def create_cmd_line(self): self.container_path = self.container_path or '' - host_volume = self.container_io_dict.get("unique_dir") + host_volume = self.stage_io_dict.get("unique_dir") if self.container_path.endswith('singularity'): fu.log('Using Singularity image %s' % self.container_image, self.out_log, self.global_log) if not Path(container_image).exists(): @@ -163,7 +165,7 @@ class BiobbObject: pcocc_cmd.append(self.container_user_id) cmd = ['\\"' + " ".join(self.cmd) + '\\"'] - pcocc_cmd.extend([container_shell_path, '-c']) + pcocc_cmd.extend([self.container_shell_path, '-c']) self.cmd = pcocc_cmd + cmd else: @@ -177,12 +179,17 @@ class BiobbObject: return # OUT files COPY - for file_ref, file_path in self.container_io_dict["out"].items(): + for file_ref, file_path in self.stage_io_dict["out"].items(): if file_path: - container_file_path = str(Path(self.container_io_dict["unique_dir"]).joinpath(Path(file_path).name)) + container_file_path = str(Path(self.stage_io_dict["unique_dir"]).joinpath(Path(file_path).name)) if Path(container_file_path).exists(): shutil.copy2(container_file_path, self.io_dict["out"][file_ref]) + + def run_biobb(self): + self.create_cmd_line() + self.execute_command() + def remove_tmp_files(self): if self.remove_tmp: fu.rm_file_list(self.tmp_files, self.out_log) diff --git a/biobb_common/json_schemas/biobb_common.json b/biobb_common/json_schemas/biobb_common.json index 1e7d52c2dab7b8a85061e9211bc9f5fcc03c741c..36505b93274922241bd2f2c0a098a61c70ca26d8 100644 --- a/biobb_common/json_schemas/biobb_common.json +++ b/biobb_common/json_schemas/biobb_common.json @@ -6,7 +6,7 @@ "conda": "https://anaconda.org/bioconda/biobb_common", "docker": "https://quay.io/biocontainers/biobb_common", "singularity": "https://www.singularity-hub.org/collections/2734/usage", - "version": "3.6.0", + "version": "3.7.0", "tools" : [ { "block" : "", diff --git a/setup.py b/setup.py index 2d97b8856f592092ca5f4c2cd1412b1644f40e2e..a18a69ce98d6b8dc7bdeddb44f2e4befae5cb948 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r") as fh: setuptools.setup( name="biobb_common", - version="3.6.0", + version="3.7.0", author="Biobb developers", author_email="pau.andrio@bsc.es", description="Biobb_common is the base package required to use the biobb packages.",