diff --git a/src/nextflow_file.py b/src/nextflow_file.py index b3aa8fd27a4f2d2a1f8f9974ff130c210b9acf1d..234614be4360fbe1bff7f89dcc0c917879e06e17 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