Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BioFlow-Insight
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shareFAIR
BioFlow-Insight
Commits
962d7480
Commit
962d7480
authored
3 months ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
Updated the DSL1 conversion
parent
3f14e951
No related branches found
No related tags found
No related merge requests found
Pipeline
#14457
failed with stage
Stage:
in 2 minutes and 18 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/nextflow_file.py
+9
-2
9 additions, 2 deletions
src/nextflow_file.py
src/process.py
+4
-2
4 additions, 2 deletions
src/process.py
src/workflow.py
+11
-4
11 additions, 4 deletions
src/workflow.py
with
24 additions
and
8 deletions
src/nextflow_file.py
+
9
−
2
View file @
962d7480
...
@@ -333,9 +333,16 @@ class Nextflow_File(Nextflow_Building_Blocks):
...
@@ -333,9 +333,16 @@ class Nextflow_File(Nextflow_Building_Blocks):
#Replacing the processes and functions defined with their identifiers -> this is to simplifly the analysis with the conditions
#Replacing the processes and functions defined with their identifiers -> this is to simplifly the analysis with the conditions
for
process
in
self
.
processes
:
for
process
in
self
.
processes
:
code
=
code
.
replace
(
process
.
get_code
(),
f
"
process:
{
str
(
process
)
}
"
)
temp
=
code
code
=
code
.
replace
(
process
.
get_code
(
get_OG
=
True
),
f
"
process:
{
str
(
process
)
}
"
)
if
(
temp
==
code
):
print
(
process
.
get_code
())
raise
Exception
(
"
Something went wrong the code hasn
'
t changed
"
)
for
function
in
self
.
functions
:
for
function
in
self
.
functions
:
code
=
code
.
replace
(
function
.
get_code
(),
f
"
function:
{
str
(
function
)
}
"
)
temp
=
code
code
=
code
.
replace
(
function
.
get_code
(
get_OG
=
True
),
f
"
function:
{
str
(
function
)
}
"
)
if
(
temp
==
code
):
raise
Exception
(
"
Something went wrong the code hasn
'
t changed
"
)
self
.
main
=
Main
(
code
=
code
,
nextflow_file
=
self
)
self
.
main
=
Main
(
code
=
code
,
nextflow_file
=
self
)
self
.
main
.
initialise
()
self
.
main
.
initialise
()
...
...
This diff is collapsed.
Click to expand it.
src/process.py
+
4
−
2
View file @
962d7480
...
@@ -499,8 +499,10 @@ class Process(Nextflow_Building_Blocks):
...
@@ -499,8 +499,10 @@ class Process(Nextflow_Building_Blocks):
else
:
else
:
code
=
self
.
get_code
()
code
=
self
.
get_code
()
call
=
[
f
"
{
self
.
get_name
()
}
(
{
self
.
get_parameters_call
()
}
)
"
]
call
=
[
f
"
{
self
.
get_name
()
}
(
{
self
.
get_parameters_call
()
}
)
"
]
code
=
code
.
replace
(
self
.
input_code
,
self
.
convert_input_code_to_DSL2
())
if
(
self
.
input_code
!=
""
):
code
=
code
.
replace
(
self
.
output_code
,
self
.
convert_output_code_to_DSL2
())
code
=
code
.
replace
(
self
.
input_code
,
self
.
convert_input_code_to_DSL2
())
if
(
self
.
output_code
!=
""
):
code
=
code
.
replace
(
self
.
output_code
,
self
.
convert_output_code_to_DSL2
())
channels_to_flatten
=
self
.
get_channels_to_flatten
()
channels_to_flatten
=
self
.
get_channels_to_flatten
()
...
...
This diff is collapsed.
Click to expand it.
src/workflow.py
+
11
−
4
View file @
962d7480
...
@@ -347,7 +347,7 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
...
@@ -347,7 +347,7 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
for
p
in
nextflow_file
.
get_processes
():
for
p
in
nextflow_file
.
get_processes
():
new_process
,
call
=
p
.
convert_to_DSL2
()
new_process
,
call
=
p
.
convert_to_DSL2
()
processes
.
append
(
new_process
)
processes
.
append
(
new_process
)
to_replace
.
append
((
p
.
get_code
(),
call
))
to_replace
.
append
((
p
.
get_code
(
get_OG
=
True
),
call
))
for
r
in
to_replace
:
for
r
in
to_replace
:
code
=
code
.
replace
(
r
[
0
],
r
[
1
])
code
=
code
.
replace
(
r
[
0
],
r
[
1
])
...
@@ -363,7 +363,14 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
...
@@ -363,7 +363,14 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
#Putting || back
#Putting || back
code
=
code
.
replace
(
"
$OR$
"
,
"
||
"
)
code
=
code
.
replace
(
"
$OR$
"
,
"
||
"
)
self
.
rewrite_and_initialise
(
code
,
self
.
processes_2_remove
,
render_graphs
=
False
)
#Somethimes this is incorrect but that's due to the fact that the DSL1 analysis isn't as clean as the DSL2 analyse (concerning the conditions)
#What i mean that when searching for channels, DSL1 doesn't consider the conditions when searching from the processes while DSL2 does
#The conversion works well but it's just comparing to the old DSL1 workflow doesn't make sense
#If you want to put this line back you need #TODO update the DSL1 parsing to consider the blocks when defining the processes
#A good example is KevinMenden/hybrid-assembly
#self.rewrite_and_initialise(code, self.processes_2_remove, render_graphs=True)
return
code
return
code
#This methods generates a random set of processes to consider as relavant
#This methods generates a random set of processes to consider as relavant
...
@@ -474,7 +481,7 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
...
@@ -474,7 +481,7 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
raise
Exception
(
"
This shoudn
'
t happen
"
)
raise
Exception
(
"
This shoudn
'
t happen
"
)
#Simplifying main
#Simplifying main
code
=
code
.
replace
(
self
.
get_workflow_main
().
get_code
(),
self
.
get_workflow_main
().
simplify_code
())
code
=
code
.
replace
(
self
.
get_workflow_main
().
get_code
(
get_OG
=
True
),
self
.
get_workflow_main
().
simplify_code
())
#Adding processes into code
#Adding processes into code
...
@@ -576,7 +583,7 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
...
@@ -576,7 +583,7 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
def
rewrite_subworkflow_call
(
self
,
code
,
subworklfow
):
def
rewrite_subworkflow_call
(
self
,
code
,
subworklfow
):
#Remove the defintion from the code
#Remove the defintion from the code
code
=
code
.
replace
(
subworklfow
.
get_code
(),
""
)
code
=
code
.
replace
(
subworklfow
.
get_code
(
get_OG
=
True
),
""
)
OG_call
=
subworklfow
.
get_call
()
OG_call
=
subworklfow
.
get_call
()
OG_body
=
subworklfow
.
get_work
()
OG_body
=
subworklfow
.
get_work
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment