diff --git a/src/call.py b/src/call.py index bacbc2031184bf42a7154938820ec8f28da2bff7..be9135cf4a6b8b7a158b0e67841dbbe6b3c67ece 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 426ba4d7b8d82f594653f132dccb6ae8dddf04f9..4718360946f3b6cda9d1f341e3a577de9a0a4053 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 7116f0913939453a95fa4c48ca724d31b01fd040..fdc55357f1c6960c3a406418af124b4e5e9b042d 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 0d0abe077b8de766bba63f6f664c7e2f0dba3f35..ec9c12b538b9a681fc1f7ffb9abfb9f639873b24 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):