From 7a6cc3599a2c29809dbad5baa6da7d36eb82e929 Mon Sep 17 00:00:00 2001 From: George Marchment <georgemarchment@yahoo.fr> Date: Wed, 16 Apr 2025 11:14:04 +0200 Subject: [PATCH] Just updated one or two small things --- src/call.py | 3 +++ src/main.py | 14 +++++++------- src/outils.py | 7 ++++++- src/workflow.py | 4 +--- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/call.py b/src/call.py index bacbc20..be9135c 100644 --- a/src/call.py +++ b/src/call.py @@ -201,6 +201,9 @@ class Call(Executor): raise Exception("This shouldn't happen") return code.split() + def get_artificial_status(self): + return False + def analye_parameters(self, param): #Step 1 -> get parameters diff --git a/src/main.py b/src/main.py index 426ba4d..4718360 100644 --- a/src/main.py +++ b/src/main.py @@ -19,13 +19,13 @@ class Main(Nextflow_Building_Blocks): executors = self.get_all_executors_in_subworkflow() pos = {} for e in executors: - code = e.get_code(get_OG = True) - #We don't have to check the calls -> since there are renamed with their ids when we rewrite the code -> so it solve the issue - if(code in seen and e.get_type()=="Operation"): - raise BioFlowInsightError(f'Operation "{code}" appears twice in the workflow in the exact same way. BioFlow-Insight cannot rewrite the workflow then, try slighly changing how one of the executors is defined', type = "Rewrite Error") - seen[code] = '' - pos[e] = e.get_position_in_main(e) - #TODO add sort here + if(not e.get_artificial_status()): + code = e.get_code(get_OG = True) + #We don't have to check the calls -> since there are renamed with their ids when we rewrite the code -> so it solve the issue + if(code in seen and e.get_type()=="Operation"): + raise BioFlowInsightError(f'Operation "{code}" appears twice in the workflow in the exact same way. BioFlow-Insight cannot rewrite the workflow then, try slighly changing how one of the executors is defined', type = "Rewrite Error") + seen[code] = e + pos[e] = e.get_position_in_main(e) pos = {k: v for k, v in sorted(pos.items(), key=lambda item: item[1])} for e in pos: if(e.get_type()=="Call"): diff --git a/src/outils.py b/src/outils.py index 7116f09..fdc5535 100644 --- a/src/outils.py +++ b/src/outils.py @@ -1620,7 +1620,12 @@ def extract_tools(script, extract_general_tools = False): tools.append("perl") elif(extension==".jl"): tools.append("julia") - elif (ex!="" and len(ex)>1 and ex not in general_tools and ex[-1]!=":" and re.fullmatch(r"\w", ex[0])): + elif (ex!="" + and len(ex)>1 + and ex not in general_tools + and ex[-1]!=":" + and re.fullmatch(r"\w", ex[0]) + and "=" not in ex): tools.append(ex) #If the tool is java -> we search for the jar file in the command if(ex=="java"): diff --git a/src/workflow.py b/src/workflow.py index 0d0abe0..ec9c12b 100644 --- a/src/workflow.py +++ b/src/workflow.py @@ -436,9 +436,7 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen for p in sampled: name_select.append(p.get_alias()) return name_select - else: - print("here") - + #This methods generates a random set of processes to consider as relavant def generate_random_relevant_processes(self, alpha = -1): -- GitLab