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
0
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
aa312abc
Commit
aa312abc
authored
9 months ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
Started implementing external script extraction
parent
28069901
No related branches found
No related tags found
No related merge requests found
Pipeline
#13850
passed with stage
Stage:
in 1 minute and 1 second
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/nextflow_building_blocks.py
+5
-0
5 additions, 0 deletions
src/nextflow_building_blocks.py
src/nextflow_file.py
+8
-0
8 additions, 0 deletions
src/nextflow_file.py
src/process.py
+31
-0
31 additions, 0 deletions
src/process.py
src/workflow.py
+10
-0
10 additions, 0 deletions
src/workflow.py
with
54 additions
and
0 deletions
src/nextflow_building_blocks.py
+
5
−
0
View file @
aa312abc
...
@@ -80,6 +80,11 @@ class Nextflow_Building_Blocks:
...
@@ -80,6 +80,11 @@ class Nextflow_Building_Blocks:
def
get_rocrate_key
(
self
,
dico
):
def
get_rocrate_key
(
self
,
dico
):
return
f
"
{
self
.
get_file_address
()[
len
(
dico
[
'
temp_directory
'
])
+
1
:
]
}
#
{
self
.
get_name
()
}
"
return
f
"
{
self
.
get_file_address
()[
len
(
dico
[
'
temp_directory
'
])
+
1
:
]
}
#
{
self
.
get_name
()
}
"
def
get_address
(
self
):
return
self
.
origin
.
get_address
()
def
get_workflow_address
(
self
):
return
self
.
origin
.
get_workflow_address
()
...
...
This diff is collapsed.
Click to expand it.
src/nextflow_file.py
+
8
−
0
View file @
aa312abc
...
@@ -115,6 +115,13 @@ class Nextflow_File(Nextflow_Building_Blocks):
...
@@ -115,6 +115,13 @@ class Nextflow_File(Nextflow_Building_Blocks):
return
self
.
display_info
return
self
.
display_info
else
:
else
:
return
self
.
origin
.
get_display_info
()
return
self
.
origin
.
get_display_info
()
def
get_workflow_address
(
self
):
if
(
self
.
origin
==
None
):
return
self
.
workflow
.
get_workflow_directory
()
else
:
return
self
.
origin
.
get_workflow_address
()
...
@@ -259,6 +266,7 @@ class Nextflow_File(Nextflow_Building_Blocks):
...
@@ -259,6 +266,7 @@ class Nextflow_File(Nextflow_Building_Blocks):
def
get_DSL
(
self
):
def
get_DSL
(
self
):
return
self
.
DSL
return
self
.
DSL
#Method which returns the DSL of the workflow -> by default it's DSL2
#Method which returns the DSL of the workflow -> by default it's DSL2
#I use the presence of include, subworkflows and into/from in processes as a proxy
#I use the presence of include, subworkflows and into/from in processes as a proxy
def
which_DSL
(
self
):
def
which_DSL
(
self
):
...
...
This diff is collapsed.
Click to expand it.
src/process.py
+
31
−
0
View file @
aa312abc
import
re
import
re
import
glob
from
.code_
import
Code
from
.code_
import
Code
from
.nextflow_building_blocks
import
Nextflow_Building_Blocks
from
.nextflow_building_blocks
import
Nextflow_Building_Blocks
...
@@ -53,6 +54,36 @@ class Process(Nextflow_Building_Blocks):
...
@@ -53,6 +54,36 @@ class Process(Nextflow_Building_Blocks):
return
self
.
tools
return
self
.
tools
def
get_external_scripts_call
(
self
):
code
=
self
.
get_script_code
()
tab
=
[]
for
match
in
re
.
finditer
(
r
"
([^\s\\\*]+\.(sh|py|R|r|pl))[^\w]
"
,
code
):
tab
.
append
(
match
.
group
(
1
))
return
list
(
set
(
tab
))
def
get_external_scripts_code
(
self
):
calls
=
self
.
get_external_scripts_call
()
#workflow_directory = self.origin.get_address()
#print(workflow_directory)
#import os
#print(os.getcwd(), self.origin.get_address(), self.get_workflow_address())
for
call
in
calls
:
#Check first if the file is in the bin
file
=
glob
.
glob
(
f
'
{
self
.
get_workflow_address
()
}
/bin/**/
{
call
}
'
,
recursive
=
True
)
if
(
len
(
file
)
>
1
):
print
(
file
)
print
(
"
More than one file found!
"
)
#If not we search again
if
(
len
(
file
)
==
0
):
file
=
glob
.
glob
(
f
'
{
self
.
get_workflow_address
()
}
/**/
{
call
}
'
,
recursive
=
True
)
if
(
len
(
file
)
>
1
):
print
(
file
)
print
(
"
More than one file found!
"
)
#def get_source(self):
#def get_source(self):
# return [self]
# return [self]
...
...
This diff is collapsed.
Click to expand it.
src/workflow.py
+
10
−
0
View file @
aa312abc
...
@@ -67,6 +67,7 @@ class Workflow:
...
@@ -67,6 +67,7 @@ class Workflow:
output_dir
=
output_dir
,
output_dir
=
output_dir
,
workflow
=
self
workflow
=
self
)
)
self
.
workflow_directory
=
'
/
'
.
join
(
file
.
split
(
'
/
'
)[:
-
1
])
self
.
output_dir
=
Path
(
output_dir
)
self
.
output_dir
=
Path
(
output_dir
)
self
.
rocrate
=
None
self
.
rocrate
=
None
self
.
name
=
name
self
.
name
=
name
...
@@ -133,6 +134,15 @@ class Workflow:
...
@@ -133,6 +134,15 @@ class Workflow:
"""
"""
return
self
.
address
return
self
.
address
def
get_workflow_directory
(
self
):
"""
Method that returns the workflow directory
Keyword arguments:
"""
return
self
.
workflow_directory
def
set_address
(
self
):
def
set_address
(
self
):
"""
Method that sets the adress of the workflow main
"""
Method that sets the adress of the workflow main
...
...
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