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
49cf5812
Commit
49cf5812
authored
1 year ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
Add functionnality to remove processes
parent
c6d97287
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/call.py
+1
-1
1 addition, 1 deletion
src/call.py
src/function.py
+3
-0
3 additions, 0 deletions
src/function.py
src/graph.py
+42
-1
42 additions, 1 deletion
src/graph.py
src/nextflow_file.py
+2
-2
2 additions, 2 deletions
src/nextflow_file.py
src/workflow.py
+2
-2
2 additions, 2 deletions
src/workflow.py
with
50 additions
and
6 deletions
src/call.py
+
1
−
1
View file @
49cf5812
...
...
@@ -52,7 +52,7 @@ class Call(Executor):
tab
+=
[
self
.
first_element_called
]
for
para
in
self
.
parameters
:
if
(
para
.
get_type
()
==
"
Call
"
):
tab
=
para
.
get_elements_called
(
tab
=
tab
.
copy
(),
first_call
=
False
)
tab
=
para
.
get_elements_called
(
tab
_input
=
tab
.
copy
(),
first_call
=
False
)
temp
=
list
(
set
(
tab
))
#del tab
return
temp
...
...
This diff is collapsed.
Click to expand it.
src/function.py
+
3
−
0
View file @
49cf5812
...
...
@@ -23,5 +23,8 @@ class Function(Nextflow_Building_Blocks):
def
get_name
(
self
):
return
self
.
name
def
add_2_rocrate
(
self
,
dico
,
parent_key
):
None
This diff is collapsed.
Click to expand it.
src/graph.py
+
42
−
1
View file @
49cf5812
...
...
@@ -23,7 +23,48 @@ class Graph():
self
.
dico_flattened
=
{}
def
initialise
(
self
):
def
initialise
(
self
,
processes_2_remove
=
[]):
def
get_node_id
(
dico
,
process
):
for
node
in
dico
[
"
nodes
"
]:
if
(
node
[
'
name
'
]
==
process
):
return
node
[
'
id
'
]
for
sub
in
dico
[
'
subworkflows
'
]:
res
=
get_node_id
(
dico
[
'
subworkflows
'
][
sub
],
process
)
if
(
res
!=-
1
):
return
res
return
-
1
#This function removes the process -> by the simpliest way -> it doesn't create new links
def
remove_node
(
dico
,
node_id
):
#Remove nodes
nodes_to_remove
=
[]
for
node
in
dico
[
"
nodes
"
]:
if
(
node
[
'
id
'
]
==
node_id
):
nodes_to_remove
.
append
(
node
)
for
node
in
nodes_to_remove
:
dico
[
"
nodes
"
].
remove
(
node
)
#Remove edges
edges_to_remove
=
[]
for
edge
in
dico
[
"
edges
"
]:
if
(
edge
[
'
A
'
]
==
node_id
):
edges_to_remove
.
append
(
edge
)
if
(
edge
[
'
B
'
]
==
node_id
):
edges_to_remove
.
append
(
edge
)
for
edge
in
edges_to_remove
:
dico
[
"
edges
"
].
remove
(
edge
)
for
sub
in
dico
[
'
subworkflows
'
]:
remove_node
(
dico
[
'
subworkflows
'
][
sub
],
node_id
)
for
process
in
processes_2_remove
:
node_id
=
get_node_id
(
self
.
full_dico
,
process
)
remove_node
(
self
.
full_dico
,
node_id
)
self
.
get_graph_wo_branch_operations
()
self
.
get_graph_wo_operations
()
...
...
This diff is collapsed.
Click to expand it.
src/nextflow_file.py
+
2
−
2
View file @
49cf5812
...
...
@@ -637,9 +637,9 @@ class Nextflow_File(Nextflow_Building_Blocks):
if
(
self
.
graph
==
None
):
self
.
graph
=
Graph
(
self
)
def
generate_all_graphs
(
self
,
render_graphs
=
True
):
def
generate_all_graphs
(
self
,
render_graphs
=
True
,
processes_2_remove
=
[]
):
#Initialisation (obligatory)
self
.
graph
.
initialise
()
self
.
graph
.
initialise
(
processes_2_remove
=
processes_2_remove
)
#Generate the different graphs
self
.
graph
.
get_full_graph
(
render_graphs
=
render_graphs
)
...
...
This diff is collapsed.
Click to expand it.
src/workflow.py
+
2
−
2
View file @
49cf5812
...
...
@@ -123,5 +123,5 @@ class Workflow:
self
.
nextflow_file
.
initialise
()
self
.
initialise_rocrate
()
def
generate_all_graphs
(
self
,
render_graphs
=
True
):
self
.
nextflow_file
.
generate_all_graphs
(
render_graphs
=
render_graphs
)
def
generate_all_graphs
(
self
,
render_graphs
=
True
,
processes_2_remove
=
[]
):
self
.
nextflow_file
.
generate_all_graphs
(
render_graphs
=
render_graphs
,
processes_2_remove
=
processes_2_remove
)
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