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
0858c4e0
Commit
0858c4e0
authored
1 month ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
Small update to DSL1 converter
parent
6ad5b661
No related branches found
No related tags found
No related merge requests found
Pipeline
#14689
failed with stage
Stage:
in 3 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/workflow.py
+10
-4
10 additions, 4 deletions
src/workflow.py
with
10 additions
and
4 deletions
src/workflow.py
+
10
−
4
View file @
0858c4e0
...
...
@@ -328,6 +328,15 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
nextflow_file
=
self
.
get_first_file
()
code
=
nextflow_file
.
get_code
()
#Move the workflow.complete to end of the workflow if it's not already done
for
match
in
re
.
finditer
(
r
"
workflow\.onComplete\s*{
"
,
code
):
start
=
match
.
span
(
0
)[
0
]
end
=
extract_curly
(
code
,
match
.
span
(
0
)[
1
])
#This function is defined in the functions file
workflow_on_complete
=
code
[
start
:
end
]
code
=
code
.
replace
(
workflow_on_complete
,
""
)
code
+=
"
\n
"
*
2
+
workflow_on_complete
start_code
=
r
"
#!/usr/bin/env nextflow
"
start_code_pattern
=
r
"
\#\!\s*\/usr\/bin\/env\s+nextflow
"
end_code
=
"
workflow.onComplete
"
...
...
@@ -340,14 +349,13 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
pos_start
=
match
.
span
(
0
)[
1
]
+
1
#if(code.find(start_code)!=-1):
# pos_start = code.find(start_code)+len(start_code)
body
=
code
[
pos_start
:
pos_end
]
#.replace('\n', '\n\t')
body
=
code
[
pos_start
:
pos_end
]
.
strip
()
#.replace('\n', '\n\t')
include_section
=
f
"
//INCLUDE_SECTION_
{
tag
}
"
params_section
=
f
"
//PARAMS_SECTION_
{
tag
}
"
function_section
=
f
"
//FUNCTION_SECTION_
{
tag
}
"
process_section
=
f
"
//PROCESS_SECTION_
{
tag
}
"
code
=
code
.
replace
(
code_to_replace
,
f
"""
{
start_code
}
\n\n\n
{
include_section
}
\n\n\n
{
params_section
}
\n\n\n
{
function_section
}
\n\n\n
{
process_section
}
\n\n\n
workflow{{
\n\n
{
body
}
\n
}}
\n\n
"""
)
##I've out this in a comment cause since it's a DSL1
...
...
@@ -1632,8 +1640,6 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
pattern
=
fr
"
[\s\(,](
{
re
.
escape
(
old
)
}
)[^\w]
"
temp
=
code
code
=
replace_group1
(
code
,
pattern
,
new
)
if
(
temp
==
code
and
old
!=
new
):
raise
Exception
(
"
The old wasn
'
t update
"
)
#code = code.replace(old, new)
#Since i've added the conditions myself -> i can just count them by searching for this simple pattern
...
...
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