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
dde31389
Commit
dde31389
authored
4 months ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
First workflow (EpiDiverse/snp) works A to Z by rewritting and then running
parent
68168d9f
No related branches found
No related tags found
No related merge requests found
Pipeline
#14469
failed with stage
in 2 minutes and 30 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/nextflow_file.py
+20
-0
20 additions, 0 deletions
src/nextflow_file.py
src/workflow.py
+18
-13
18 additions, 13 deletions
src/workflow.py
with
38 additions
and
13 deletions
src/nextflow_file.py
+
20
−
0
View file @
dde31389
...
@@ -273,6 +273,26 @@ class Nextflow_File(Nextflow_Building_Blocks):
...
@@ -273,6 +273,26 @@ class Nextflow_File(Nextflow_Building_Blocks):
modules
+=
list
(
include
.
defines
.
values
())
modules
+=
list
(
include
.
defines
.
values
())
return
modules
return
modules
def
get_calls_made_outside_of_main
(
self
):
#Code without processes
code
=
self
.
get_code
()
for
proecess
in
self
.
processes
:
code
=
code
.
replace
(
proecess
.
get_code
(),
""
)
for
sub
in
self
.
subworkflows
:
code
=
code
.
replace
(
sub
.
get_code
(),
""
)
for
fun
in
self
.
functions
:
code
=
code
.
replace
(
fun
.
get_code
(),
""
)
if
(
self
.
first_file
and
self
.
main
!=
None
):
code
=
code
.
replace
(
self
.
main
.
get_code
(),
""
)
for
include
in
self
.
includes
:
code
=
code
.
replace
(
include
.
get_code
(),
""
)
from
.root
import
Root
self
.
root
=
Root
(
code
=
code
,
origin
=
self
,
modules_defined
=
self
.
get_modules_defined
(),
subworkflow_inputs
=
[])
self
.
root
.
initialise
()
calls
=
{}
self
.
root
.
get_all_calls_in_subworkflow
(
calls
=
calls
)
return
list
(
calls
.
keys
())
#----------------------
#----------------------
#INITIALISE
#INITIALISE
...
...
This diff is collapsed.
Click to expand it.
src/workflow.py
+
18
−
13
View file @
dde31389
...
@@ -461,21 +461,18 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
...
@@ -461,21 +461,18 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
ankers
=
function_section
+
"
\n
"
*
3
+
process_section
+
"
\n
"
*
3
+
subworkflow_section
ankers
=
function_section
+
"
\n
"
*
3
+
process_section
+
"
\n
"
*
3
+
subworkflow_section
to_replace
=
[]
for
match
in
re
.
finditer
(
constant
.
FULL_INLCUDE_2
,
code
):
to_replace
.
append
(
match
.
group
(
0
))
if
(
to_replace
==
[]):
#Place ankers
pos_start
=
0
pos_start
=
0
start_code_pattern
=
r
"
\#\!\s*\/usr\/bin\/env\s+nextflow
"
start_code_pattern
=
r
"
\#\!\s*\/usr\/bin\/env\s+nextflow
"
for
match
in
re
.
finditer
(
start_code_pattern
,
code
):
for
match
in
re
.
finditer
(
start_code_pattern
,
code
):
pos_start
=
match
.
span
(
0
)[
1
]
+
1
pos_start
=
match
.
span
(
0
)[
1
]
+
1
code
=
code
[:
pos_start
]
+
ankers
+
code
[
pos_start
:]
code
=
code
[:
pos_start
]
+
ankers
+
code
[
pos_start
:]
else
:
for
r
in
to_replace
:
code
=
code
.
replace
(
r
,
ankers
)
ankers
=
""
#Remove the includes
for
match
in
re
.
finditer
(
constant
.
FULL_INLCUDE_2
,
code
):
code
=
re
.
sub
(
fr
"
{
re
.
escape
(
match
.
group
(
0
))
}
.*
"
,
""
,
code
)
processes
,
subworkflows
,
functions
=
[],
[],
[]
processes
,
subworkflows
,
functions
=
[],
[],
[]
for
c
in
self
.
get_workflow_main
().
get_all_calls_in_workflow
():
for
c
in
self
.
get_workflow_main
().
get_all_calls_in_workflow
():
...
@@ -488,6 +485,14 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
...
@@ -488,6 +485,14 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
functions
.
append
(
ele
)
functions
.
append
(
ele
)
else
:
else
:
raise
Exception
(
"
This shoudn
'
t happen
"
)
raise
Exception
(
"
This shoudn
'
t happen
"
)
#Get calls to functions made outside of themain which might have been imported -> so we need to add them
for
c
in
self
.
get_first_file
().
get_calls_made_outside_of_main
():
ele
=
c
.
get_first_element_called
()
if
(
ele
.
get_type
()
==
"
Function
"
):
functions
.
append
(
ele
)
else
:
raise
Exception
(
"
This shoudn
'
t happen -> either a call to a process or subworkflow outside of main or subworkflow
"
)
#Simplifying main
#Simplifying main
code
=
code
.
replace
(
self
.
get_workflow_main
().
get_code
(
get_OG
=
True
),
self
.
get_workflow_main
().
simplify_code
())
code
=
code
.
replace
(
self
.
get_workflow_main
().
get_code
(
get_OG
=
True
),
self
.
get_workflow_main
().
simplify_code
())
...
...
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