diff --git a/src/call.py b/src/call.py index 1fdeae70be554e22f1886cedad477782337aaa09..adbf2ca07dcc33433a0fa81191eb027e8980723a 100644 --- a/src/call.py +++ b/src/call.py @@ -58,7 +58,8 @@ class Call(Executor): return self.code.get_code() return self.OG_code if(clean_pipe): - return self.clean_pipe_operator(self.code.get_code()) + code, _ = self.clean_pipe_operator(self.code.get_code()) + return code else: return self.code.get_code() diff --git a/src/executor.py b/src/executor.py index 0f7c6a7246354650b54c712326dbfe32262668de..d276bc0b7a903f0fdf28c8f221e593cdd5c0a768 100644 --- a/src/executor.py +++ b/src/executor.py @@ -152,6 +152,7 @@ class Executor(Nextflow_Building_Blocks): to_call.append(m.get_alias()) searching = True to_replace = [] + OG_pipe = pipe.strip() while(searching): if(pipe.find('|')==-1): searching=False @@ -207,7 +208,8 @@ class Executor(Nextflow_Building_Blocks): pipe = pipe.replace(tag, '|') for tag in to_replace_double_pipe: pipe = pipe.replace(tag, '||') - return (head+pipe).replace(str(self), '|', 1) + new_pipe = (pipe).replace(str(self), '|', 1).strip() + return (head+pipe).replace(str(self), '|', 1), {new_pipe: OG_pipe} #This method analyses if the executor if an operation or a call, and returns diff --git a/src/operation.py b/src/operation.py index ce7fd7d67081e4870ff722db5e0aebede057d1bf..624a630c01f33e6faa7ca78b67c22752bafa54d0 100644 --- a/src/operation.py +++ b/src/operation.py @@ -674,7 +674,7 @@ class Operation(Executor): if(clean_pipe): - code = self.clean_pipe_operator(code) + code, self.dico_OG_call_2_new_call = self.clean_pipe_operator(code) if(replace_calls): for call in self.calls: @@ -713,11 +713,10 @@ class Operation(Executor): for m in self.get_modules_defined(): to_call.append(m.get_alias()) pattern_call = constant.BEGINNING_CALL - searching = True + searching = True + text = " "+self.get_code(clean_pipe = clean_pipe) while(searching): searching= False - text = " "+self.get_code(clean_pipe = clean_pipe) - for c in self.calls: text = text.replace(self.calls[c].get_code(), "") for match in re.finditer(pattern_call, text): @@ -726,7 +725,8 @@ class Operation(Executor): #We do this cause the first caracter is a " " start+=1 searching=True - call = Call(code =get_end_call(text, start, end), origin =self) + call_code = get_end_call(text, start, end) + call = Call(code =call_code, origin =self, OG_code=self.dico_OG_call_2_new_call[call_code]) call.initialise() self.calls[str(call)] = call break