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

continued debugging a frw things

parent 566627ee
No related branches found
No related tags found
No related merge requests found
Pipeline #14341 failed with stage
in 2 minutes and 8 seconds
...@@ -388,14 +388,18 @@ class Call(Executor): ...@@ -388,14 +388,18 @@ class Call(Executor):
if(process!=None and subworkflow==None and fun==None): if(process!=None and subworkflow==None and fun==None):
#If the elements need to duplicated -> then we need to duplicate it #If the elements need to duplicated -> then we need to duplicate it
if(self.get_duplicate_status()): if(self.get_duplicate_status()):
temp = process
process = process.copy() process = process.copy()
process.set_alias(temp.get_alias())
process.initialise() process.initialise()
self.first_element_called = process self.first_element_called = process
self.origin.add_element_to_elements_being_called(process) self.origin.add_element_to_elements_being_called(process)
#temp.incremente_number_times_called() #temp.incremente_number_times_called()
if(process==None and subworkflow!=None and fun==None): if(process==None and subworkflow!=None and fun==None):
if(self.get_duplicate_status()): if(self.get_duplicate_status()):
temp = subworkflow
subworkflow = subworkflow.copy() subworkflow = subworkflow.copy()
subworkflow.set_alias(subworkflow.get_alias())
subworkflow.initialise() subworkflow.initialise()
self.first_element_called = subworkflow self.first_element_called = subworkflow
self.origin.add_element_to_elements_being_called(subworkflow) self.origin.add_element_to_elements_being_called(subworkflow)
......
...@@ -29,6 +29,11 @@ class Include(Nextflow_Building_Blocks): ...@@ -29,6 +29,11 @@ class Include(Nextflow_Building_Blocks):
self.defines = {} self.defines = {}
#self.initialise() #self.initialise()
def get_string_line(self, bit_of_code):
return self.nextflow_file_origin.get_string_line(bit_of_code)
def get_file_address(self):
return self.nextflow_file_origin.get_file_address()
def get_duplicate_status(self): def get_duplicate_status(self):
return self.nextflow_file_origin.get_duplicate_status() return self.nextflow_file_origin.get_duplicate_status()
...@@ -111,12 +116,12 @@ class Include(Nextflow_Building_Blocks): ...@@ -111,12 +116,12 @@ class Include(Nextflow_Building_Blocks):
pattern_as = constant.INCLUDE_AS pattern_as = constant.INCLUDE_AS
for match in re.finditer(pattern_as, include): for match in re.finditer(pattern_as, include):
found = True found = True
if(self.get_duplicate_status()): #if(self.get_duplicate_status()):
thing_as = self.nextflow_file.get_element_from_name(match.group(1)).copy() thing_as = self.nextflow_file.get_element_from_name(match.group(1)).copy()
thing_as.set_alias(match.group(3)) thing_as.set_alias(match.group(3))
self.defines[match.group(3)] = thing_as self.defines[match.group(3)] = thing_as
else: #else:
self.defines[match.group(3)] = self.nextflow_file.get_element_from_name(match.group(1)) # self.defines[match.group(3)] = self.nextflow_file.get_element_from_name(match.group(1))
if(not found): if(not found):
raise Exception(f"I was not able to import '{include}' from {self.nextflow_file.get_file_address()}") raise Exception(f"I was not able to import '{include}' from {self.nextflow_file.get_file_address()}")
......
...@@ -17,6 +17,9 @@ class Main(Nextflow_Building_Blocks): ...@@ -17,6 +17,9 @@ class Main(Nextflow_Building_Blocks):
def get_string_line(self, bit_of_code): def get_string_line(self, bit_of_code):
return self.nextflow_file.get_string_line(bit_of_code) return self.nextflow_file.get_string_line(bit_of_code)
#def check_in_channels(self, channel):
# return self.root.check_in_channels(channel)
def get_modules_defined(self): def get_modules_defined(self):
return self.nextflow_file.get_modules_defined() return self.nextflow_file.get_modules_defined()
......
...@@ -195,7 +195,9 @@ class Operation(Executor): ...@@ -195,7 +195,9 @@ class Operation(Executor):
raise Exception("This shoudn't happen! -> a call is taking a value") raise Exception("This shoudn't happen! -> a call is taking a value")
else: else:
print("here")
channel = Channel(name=name, origin=self.origin) channel = Channel(name=name, origin=self.origin)
print(self.get_code(), name, self.get_file_address())
if(not self.origin.check_in_channels(channel)): if(not self.origin.check_in_channels(channel)):
self.origin.add_channel(channel) self.origin.add_channel(channel)
else: else:
......
...@@ -366,7 +366,8 @@ class Process(Nextflow_Building_Blocks): ...@@ -366,7 +366,8 @@ class Process(Nextflow_Building_Blocks):
self.name = match.group(1) self.name = match.group(1)
self.name = self.name.replace("'", "") self.name = self.name.replace("'", "")
self.name = self.name.replace('"', '') self.name = self.name.replace('"', '')
self.alias = self.name if(self.alias==""):
self.alias = self.name
self.printed_name = self.name self.printed_name = self.name
def get_name_to_print(self): def get_name_to_print(self):
......
...@@ -49,7 +49,15 @@ class Workflow: ...@@ -49,7 +49,15 @@ class Workflow:
with open(file, 'r') as f: with open(file, 'r') as f:
txt= f.read() txt= f.read()
except: except:
raise BioFlowInsightError("No 'main.nf' file found at the root of the prohject") None
#raise BioFlowInsightError("No 'main.nf' file found at the root of the prohject")
if(len(nextflow_files)==1):
file = nextflow_files[0]
with open(file, 'r') as f:
txt= f.read()
else:
raise BioFlowInsightError("Multiple Nextflow files found at the root with no 'main.nf' file: I don't know which want to select")
self.duplicate = duplicate self.duplicate = duplicate
......
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