diff --git a/changelog.md b/changelog.md index 2f7a1267..ac16d66f 100644 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,10 @@ - `Concoct`: Clustering metagenomic assembled comtigs with coverage and composition - `MetaBAT2`: A robust statistical framework for reconstructing genomes from metagenomic data +### Minor/Other changes + +- added manifest information to the `nextflow.config` file to allow for remote execution + ## 1.4.1 ### New features diff --git a/flowcraft/flowcraft.py b/flowcraft/flowcraft.py index 48d30f63..69a5d5ff 100755 --- a/flowcraft/flowcraft.py +++ b/flowcraft/flowcraft.py @@ -279,10 +279,6 @@ def copy_project(path): # Copy bin scripts copy_tree(join(repo_dir, "bin"), join(target_dir, "bin")) - # Copy default config file - shutil.copy(join(repo_dir, "nextflow.config"), - join(target_dir, "nextflow.config")) - # Copy static profiles file shutil.copy(join(repo_dir, "profiles.config"), join(target_dir, "profiles.config")) diff --git a/flowcraft/generator/engine.py b/flowcraft/generator/engine.py index 59c4764c..f2ff2e32 100644 --- a/flowcraft/generator/engine.py +++ b/flowcraft/generator/engine.py @@ -150,10 +150,10 @@ class of the component. See :func:`NextflowGenerator._get_params_string` """ - self.manifest = "" + self.config = "" """ - str: Stores de manifest directives string for the nextflow pipeline. - See :func:`NextflowGenerator._get_manifest_string` + str: Stores de configuration for the nextflow pipeline. + See :func:`NextflowGenerator._get_config_string` """ self.user_config = "" @@ -1234,24 +1234,6 @@ def _get_merged_params_help(self): return help_list - def _get_manifest_string(self): - """Returns the nextflow manifest config string to include in the - config file from the information on the pipeline. - - Returns - ------- - str - Nextflow manifest configuration string - """ - - config_str = "" - - config_str += '\n\tname = "{}"'.format(self.pipeline_name) - config_str += '\n\tmainScript = "{}"'.format(self.nf_file) - - return config_str - - @staticmethod def _render_config(template, context): @@ -1277,7 +1259,7 @@ def _set_configurations(self): resources = "" containers = "" params = "" - manifest = "" + config = "" if self.merge_params: params += self._get_merged_params_string() @@ -1297,8 +1279,6 @@ def _set_configurations(self): resources += self._get_resources_string(p.directives, p.pid) containers += self._get_container_string(p.directives, p.pid) - manifest = self._get_manifest_string() - self.resources = self._render_config("resources.config", { "process_info": resources }) @@ -1308,8 +1288,9 @@ def _set_configurations(self): self.params = self._render_config("params.config", { "params_info": params }) - self.manifest = self._render_config("manifest.config", { - "manifest_info": manifest + self.config = self._render_config("nextflow.config", { + "pipeline_name": self.pipeline_name, + "nf_file": self.nf_file }) self.help = self._render_config("Helper.groovy", { "nf_file": basename(self.nf_file), @@ -1426,9 +1407,9 @@ def write_configs(self, project_root): with open(join(project_root, "params.config"), "w") as fh: fh.write(self.params) - # Write manifest config - with open(join(project_root, "manifest.config"), "w") as fh: - fh.write(self.manifest) + # Write nextflow config + with open(join(project_root, "nextflow.config"), "w") as fh: + fh.write(self.config) # Write user config if not present in the project directory if not exists(join(project_root, "user.config")): diff --git a/flowcraft/generator/templates/manifest.config b/flowcraft/generator/templates/manifest.config deleted file mode 100644 index bbdea919..00000000 --- a/flowcraft/generator/templates/manifest.config +++ /dev/null @@ -1,5 +0,0 @@ -manifest { - -{{ manifest_info }} - -} \ No newline at end of file diff --git a/flowcraft/nextflow.config b/flowcraft/generator/templates/nextflow.config similarity index 98% rename from flowcraft/nextflow.config rename to flowcraft/generator/templates/nextflow.config index e85f2bbf..a0d0d32f 100644 --- a/flowcraft/nextflow.config +++ b/flowcraft/generator/templates/nextflow.config @@ -1,3 +1,8 @@ +manifest { + name = "{{ pipeline_name }}" + mainScript = "{{ nf_file }}" +} + params { platformHTTP = null reportHTTP = null @@ -172,5 +177,4 @@ includeConfig "profiles.config" includeConfig "resources.config" includeConfig "containers.config" includeConfig "params.config" -includeConfig "manifest.config" includeConfig "user.config" diff --git a/flowcraft/tests/test_assemblerflow.py b/flowcraft/tests/test_assemblerflow.py index 402b584b..684b6ed6 100644 --- a/flowcraft/tests/test_assemblerflow.py +++ b/flowcraft/tests/test_assemblerflow.py @@ -53,7 +53,7 @@ def test_build_file_2(tmp): assert sorted(os.listdir(tmp)) == [".forkTree.json", ".treeDag.json", "containers.config", - "lib", "manifest.config", "params.config", + "lib", "nextflow.config", "params.config", "resources.config", "teste.html", "teste.nf", "user.config"]