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

small update to DSL1 to DSL2 conversion

parent e0c11b77
No related branches found
No related tags found
No related merge requests found
Pipeline #14474 failed with stage
in 2 minutes and 1 second
...@@ -261,6 +261,7 @@ class Process(Nextflow_Building_Blocks): ...@@ -261,6 +261,7 @@ class Process(Nextflow_Building_Blocks):
for line in code.split("\n"): for line in code.split("\n"):
placed = False
#Case there is a single channel as an input -> doesn't use from to import channel -> uses file (see https://github.com/nextflow-io/nextflow/blob/45ceadbdba90b0b7a42a542a9fc241fb04e3719d/docs/process.rst) #Case there is a single channel as an input -> doesn't use from to import channel -> uses file (see https://github.com/nextflow-io/nextflow/blob/45ceadbdba90b0b7a42a542a9fc241fb04e3719d/docs/process.rst)
patterns = [constant.FILE, constant.PATH] patterns = [constant.FILE, constant.PATH]
...@@ -271,25 +272,30 @@ class Process(Nextflow_Building_Blocks): ...@@ -271,25 +272,30 @@ class Process(Nextflow_Building_Blocks):
extracted = match.group(1).strip() extracted = match.group(1).strip()
except: except:
extracted = match.group(2).strip() extracted = match.group(2).strip()
placed = True
add_channel(extracted) add_channel(extracted)
self.raw_input_names.append(extracted) self.raw_input_names.append(extracted)
if(not placed):
#Case there are multiple channels as input (e.g. channel1.mix(channel2)) #Case there are multiple channels as input (e.g. channel1.mix(channel2))
pattern = constant.FROM pattern = constant.FROM
for match in re.finditer(pattern, line+"\n"): for match in re.finditer(pattern, line+"\n"):
extracted = match.group(1).strip() extracted = match.group(1).strip()
self.raw_input_names.append(extracted) self.raw_input_names.append(extracted)
placed = True
if(bool(re.fullmatch(constant.WORD, extracted))): if(bool(re.fullmatch(constant.WORD, extracted))):
add_channel(extracted) add_channel(extracted)
else: else:
from .operation import Operation from .operation import Operation
operation = Operation(code=extracted, origin=self.origin) operation = Operation(code=extracted, origin=self.origin)
operation.initialise() operation.initialise()
operation.is_defined_in_process(self) operation.is_defined_in_process(self)
self.inputs+=operation.get_origins() self.inputs+=operation.get_origins()
if(not placed):
if(re.fullmatch(constant.WORD, line.strip())):
add_channel(line)
self.raw_input_names.append(line)
#self.inputs = list(set(self.inputs))#TODO Check this #self.inputs = list(set(self.inputs))#TODO Check this
...@@ -453,6 +459,7 @@ class Process(Nextflow_Building_Blocks): ...@@ -453,6 +459,7 @@ class Process(Nextflow_Building_Blocks):
for line in code.split("\n"): for line in code.split("\n"):
temp = process_2_DSL2(line.split(" from ")[0]) temp = process_2_DSL2(line.split(" from ")[0])
lines.append(temp) lines.append(temp)
#TODO -> need to determine if it's on it's own is it either a path or val
code = "\n".join(lines) code = "\n".join(lines)
return code return code
......
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