From 9f110efe44ee0662dcd33e2380c21e732db14d70 Mon Sep 17 00:00:00 2001 From: George Marchment <georgemarchment@yahoo.fr> Date: Mon, 19 Feb 2024 14:16:21 +0100 Subject: [PATCH] Update generation RO-Crate DSL1 --- src/nextflow_file.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/nextflow_file.py b/src/nextflow_file.py index b3aa8fd..234614b 100644 --- a/src/nextflow_file.py +++ b/src/nextflow_file.py @@ -657,6 +657,22 @@ class Nextflow_File(Nextflow_Building_Blocks): #def get_metadata_graph_wo_operations(self): # self.graph.get_metadata_graph_wo_operations() + def add_main_DSL1_2_rocrate(self, dico, file_dico, file_name): + main_key = f"{file_name}/main" + file_dico["hasPart"].append(main_key) + dico_main = {} + dico_main["@id"] = main_key + dico_main["name"] = "Main Workflow" + dico_main["@type"] = ["SoftwareSourceCode", "ComputationalWorkflow"] + #TODO -> check if this remains true + #dico_main["conformsTo"] = {"@id": "https://bioschemas.org/profiles/ComputationalWorkflow/0.5-DRAFT-2020_07_21"} + #dico_main["dct:conformsTo"]= "https://bioschemas.org/profiles/ComputationalWorkflow/1.0-RELEASE/" + dico_main["input"] = [] + dico_main["output"] = [] + dico_main["isPartOf"] = [{"@id": file_name}] + dico_main["hasPart"] = [] + self.add_processes_2_rocrate(dico, dico_main, main_key) + dico["@graph"].append(dico_main) def add_processes_2_rocrate(self, dico, file_dico, file_name): for p in self.processes: @@ -687,7 +703,8 @@ class Nextflow_File(Nextflow_Building_Blocks): #Case DSL1 if(self.get_DSL()=="DSL1"): - file_dico["@type"].append("ComputationalWorkflow") + #file_dico["@type"].append("ComputationalWorkflow") + self.add_main_DSL1_2_rocrate(dico, file_dico, file_name) self.add_processes_2_rocrate(dico, file_dico, file_name) #Case DSL2 -- GitLab