Skip to content
Snippets Groups Projects
Commit b1fd31f1 authored by George Marchment's avatar George Marchment
Browse files

fix minor bug

parent f94017c2
No related branches found
No related tags found
No related merge requests found
Pipeline #13730 passed with stages
in 1 minute and 48 seconds
......@@ -739,6 +739,13 @@ class Operation(Executor):
def check_if_empty_call(self):
return self.get_code()==""
#This method returns the element which is defined after the call
def get_element_after_call(self, call):
for match in re.finditer(str(call)+r"\s*\.\s*(\w+)\s*\.", self.get_code()):
return match.group(1)
def initialise_from_call(self):
......@@ -806,7 +813,24 @@ class Operation(Executor):
if(sub.get_nb_emit()==0):
raise BioFlowInsightError(f"The subworkflow '{sub.get_name()}' doesn't emit anything. It is given to an operation{self.get_string_line(call.get_code())}.", num=20, origin=self)
elif(sub.get_nb_emit()>1):
raise BioFlowInsightError(f"To much to unpack : The subworkflow '{sub.get_name()}' emits over one channel in a operation{self.get_string_line(call.get_code())}.", num=20, origin=self)
#In the case test().a.view() and test is a subworkflow
added = False
element_after_call = self.get_element_after_call(o)
emits = sub.get_emit()
for e in emits:
if(e.get_gives()==[]):
for o in e.get_origins():
if(o.get_code()==element_after_call):
dico["edges"].append({'A':str(e), 'B':str(self), "label":e.get_code()})
added =True
else:
for g in e.get_gives():
if(g.get_code()==element_after_call):
dico["edges"].append({'A':str(e), 'B':str(self), "label":e.get_code()})
added =True
if(not added):
raise BioFlowInsightError(f"To much to unpack : The subworkflow '{sub.get_name()}' emits over one channel in a operation{self.get_string_line(call.get_code())}.", num=20, origin=self)
#TODO recommendation -> try using an emit subworkflow.out
else:
emit = sub.get_emit()[0]
......
......@@ -31,6 +31,9 @@ class Process(Nextflow_Building_Blocks):
def get_alias(self):
return self.alias
def get_script_code(self):
return self.script_code
def get_name(self):
return self.name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment