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
f94017c2
Commit
f94017c2
authored
1 year ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
Add to comments
parent
fb25010d
No related branches found
No related tags found
No related merge requests found
Pipeline
#13535
passed with stages
in 2 minutes and 27 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/bioflowinsighterror.py
+9
-0
9 additions, 0 deletions
src/bioflowinsighterror.py
src/channel.py
+52
-0
52 additions, 0 deletions
src/channel.py
src/workflow.py
+25
-25
25 additions, 25 deletions
src/workflow.py
with
86 additions
and
25 deletions
src/bioflowinsighterror.py
+
9
−
0
View file @
f94017c2
# creating a custom exception
# creating a custom exception
class
BioFlowInsightError
(
Exception
):
class
BioFlowInsightError
(
Exception
):
"""
This is the custom BioFlow-Insight error class, from this class, errors can be made.
Attributes:
error: A string indicating the error message to the user
num: An integers indicating the type of error (see below)
origin: A
"
Nextflow Building Bloc
"
derived type object, from this the file address can be given to the user
"""
def
__init__
(
self
,
error
,
num
,
origin
=
None
):
def
__init__
(
self
,
error
,
num
,
origin
=
None
):
self
.
origin
=
origin
self
.
origin
=
origin
#TODO -> add message at the end
#TODO -> add message at the end
...
...
This diff is collapsed.
Click to expand it.
src/channel.py
+
52
−
0
View file @
f94017c2
#Import dependencies
#Local
from
.nextflow_building_blocks
import
Nextflow_Building_Blocks
from
.nextflow_building_blocks
import
Nextflow_Building_Blocks
from
.bioflowinsighterror
import
BioFlowInsightError
from
.bioflowinsighterror
import
BioFlowInsightError
class
Channel
(
Nextflow_Building_Blocks
):
class
Channel
(
Nextflow_Building_Blocks
):
"""
This is the channel class, from this class, channels can be made and manipulated.
Attributes:
name: A string indicating the error message to the user
origin: A
"
Nextflow Building Bloc
"
derived type object, indicating from what the channel originated from
"""
def
__init__
(
self
,
name
,
origin
):
def
__init__
(
self
,
name
,
origin
):
self
.
name
=
name
self
.
name
=
name
self
.
origin
=
origin
self
.
origin
=
origin
...
@@ -13,36 +24,77 @@ class Channel(Nextflow_Building_Blocks):
...
@@ -13,36 +24,77 @@ class Channel(Nextflow_Building_Blocks):
def
get_code
(
self
):
def
get_code
(
self
):
"""
Method that returns the channels code
Keyword arguments:
"""
return
self
.
name
.
strip
()
return
self
.
name
.
strip
()
def
add_source
(
self
,
source
):
def
add_source
(
self
,
source
):
"""
Method that adds an element to the channel
'
s source
Keyword arguments:
source: element which is gonna be added to the list of sources
"""
self
.
source
.
append
(
source
)
self
.
source
.
append
(
source
)
def
add_sink
(
self
,
sink
):
def
add_sink
(
self
,
sink
):
"""
Method that adds an element to the channel
'
s sink
Keyword arguments:
sink: element which is gonna be added to the list of sinks
"""
self
.
sink
.
append
(
sink
)
self
.
sink
.
append
(
sink
)
def
set_sink_null
(
self
):
def
set_sink_null
(
self
):
"""
Method that sets the channel
'
s sink to an empty list
"""
self
.
sink
=
[]
self
.
sink
=
[]
def
get_type
(
self
):
def
get_type
(
self
):
"""
Method that returns the channel
'
s type which is
"
Channel
"
"""
return
"
Channel
"
return
"
Channel
"
def
equal
(
self
,
channel
):
def
equal
(
self
,
channel
):
"""
Method that checks if two channels are equal
Keyword arguments:
channel: element (preferably of channel type) which is gonna be tested against the channel
"""
return
(
self
.
name
==
channel
.
name
and
self
.
origin
==
self
.
origin
)
return
(
self
.
name
==
channel
.
name
and
self
.
origin
==
self
.
origin
)
def
get_source
(
self
):
def
get_source
(
self
):
"""
Method that returns the channel
'
s sources
"""
return
self
.
source
return
self
.
source
def
remove_element_from_sink
(
self
,
ele
):
def
remove_element_from_sink
(
self
,
ele
):
"""
Method that removes an element from the channel
'
s sink
Keyword arguments:
channel: element which is gonna be removed
"""
self
.
sink
.
remove
(
ele
)
self
.
sink
.
remove
(
ele
)
def
get_sink
(
self
):
def
get_sink
(
self
):
"""
Method that returns the channel
'
s sink
"""
return
self
.
sink
return
self
.
sink
def
get_name
(
self
):
def
get_name
(
self
):
"""
Method that returns the channel
'
s name
"""
return
self
.
name
return
self
.
name
def
get_structure
(
self
,
dico
,
B
):
def
get_structure
(
self
,
dico
,
B
):
"""
Method that adds the channel to the structure
Keyword arguments:
dico: dictionnary which is decribing the workflow strutcure
B: element which should be connected to the channel, so that for every source element in the channels source, there is source->B
"""
for
source
in
self
.
get_source
():
for
source
in
self
.
get_source
():
dico
[
"
edges
"
].
append
({
'
A
'
:
str
(
source
),
'
B
'
:
str
(
B
),
"
label
"
:
self
.
get_name
()})
dico
[
"
edges
"
].
append
({
'
A
'
:
str
(
source
),
'
B
'
:
str
(
B
),
"
label
"
:
self
.
get_name
()})
...
...
This diff is collapsed.
Click to expand it.
src/workflow.py
+
25
−
25
View file @
f94017c2
...
@@ -90,7 +90,7 @@ class Workflow:
...
@@ -90,7 +90,7 @@ class Workflow:
self
.
get_dico
()
self
.
get_dico
()
def
get_repo_adress
(
self
):
def
get_repo_adress
(
self
):
"""
Function
that returns the adress of the workflow repository
"""
Method
that returns the adress of the workflow repository
Keyword arguments:
Keyword arguments:
...
@@ -102,7 +102,7 @@ class Workflow:
...
@@ -102,7 +102,7 @@ class Workflow:
return
repo
return
repo
def
get_processes_annotation
(
self
):
def
get_processes_annotation
(
self
):
"""
Function
the dictionnary of the process annotations
"""
Method
the dictionnary of the process annotations
Keyword arguments:
Keyword arguments:
...
@@ -110,7 +110,7 @@ class Workflow:
...
@@ -110,7 +110,7 @@ class Workflow:
return
self
.
processes_annotation
return
self
.
processes_annotation
def
fill_log
(
self
):
def
fill_log
(
self
):
"""
Function
that reads the git log and saves it
"""
Method
that reads the git log and saves it
Keyword arguments:
Keyword arguments:
...
@@ -127,7 +127,7 @@ class Workflow:
...
@@ -127,7 +127,7 @@ class Workflow:
os
.
chdir
(
current_directory
)
os
.
chdir
(
current_directory
)
def
get_address
(
self
):
def
get_address
(
self
):
"""
Function
that returns the adress of the workflow main
"""
Method
that returns the adress of the workflow main
Keyword arguments:
Keyword arguments:
...
@@ -135,7 +135,7 @@ class Workflow:
...
@@ -135,7 +135,7 @@ class Workflow:
return
self
.
address
return
self
.
address
def
set_address
(
self
):
def
set_address
(
self
):
"""
Function
that sets the adress of the workflow main
"""
Method
that sets the adress of the workflow main
Keyword arguments:
Keyword arguments:
...
@@ -154,7 +154,7 @@ class Workflow:
...
@@ -154,7 +154,7 @@ class Workflow:
self
.
address
=
match
.
group
(
1
)
self
.
address
=
match
.
group
(
1
)
def
get_dico
(
self
):
def
get_dico
(
self
):
"""
Function
that returns a dictionnary containg information regarding the github repository
"""
Method
that returns a dictionnary containg information regarding the github repository
Keyword arguments:
Keyword arguments:
...
@@ -174,7 +174,7 @@ class Workflow:
...
@@ -174,7 +174,7 @@ class Workflow:
def
get_name
(
self
):
def
get_name
(
self
):
"""
Function
that returns the name of the workflow
"""
Method
that returns the name of the workflow
Keyword arguments:
Keyword arguments:
...
@@ -187,7 +187,7 @@ class Workflow:
...
@@ -187,7 +187,7 @@ class Workflow:
#Format yyyy-mm-dd
#Format yyyy-mm-dd
#Here i return the first commit date
#Here i return the first commit date
def
get_datePublished
(
self
):
def
get_datePublished
(
self
):
"""
Function
that returns the date of publication
"""
Method
that returns the date of publication
Keyword arguments:
Keyword arguments:
...
@@ -203,7 +203,7 @@ class Workflow:
...
@@ -203,7 +203,7 @@ class Workflow:
def
get_description
(
self
):
def
get_description
(
self
):
"""
Function
that returns the description
"""
Method
that returns the description
Keyword arguments:
Keyword arguments:
...
@@ -220,7 +220,7 @@ class Workflow:
...
@@ -220,7 +220,7 @@ class Workflow:
def
get_main_file
(
self
):
def
get_main_file
(
self
):
"""
Function
that returns the name of the main file
"""
Method
that returns the name of the main file
Keyword arguments:
Keyword arguments:
...
@@ -229,7 +229,7 @@ class Workflow:
...
@@ -229,7 +229,7 @@ class Workflow:
def
get_license
(
self
):
def
get_license
(
self
):
"""
Function
that returns the license
"""
Method
that returns the license
Keyword arguments:
Keyword arguments:
...
@@ -254,7 +254,7 @@ class Workflow:
...
@@ -254,7 +254,7 @@ class Workflow:
def
get_authors
(
self
):
def
get_authors
(
self
):
"""
Function
that returns a list of the authors
"""
Method
that returns a list of the authors
Keyword arguments:
Keyword arguments:
...
@@ -278,7 +278,7 @@ class Workflow:
...
@@ -278,7 +278,7 @@ class Workflow:
#Need to follow this format : "rna-seq, nextflow, bioinformatics, reproducibility, workflow, reproducible-research, bioinformatics-pipeline"
#Need to follow this format : "rna-seq, nextflow, bioinformatics, reproducibility, workflow, reproducible-research, bioinformatics-pipeline"
def
get_keywords
(
self
):
def
get_keywords
(
self
):
"""
Function
that returns the keywords
"""
Method
that returns the keywords
Keyword arguments:
Keyword arguments:
...
@@ -295,7 +295,7 @@ class Workflow:
...
@@ -295,7 +295,7 @@ class Workflow:
def
get_producer
(
self
):
def
get_producer
(
self
):
"""
Function
that returns the producer
"""
Method
that returns the producer
Keyword arguments:
Keyword arguments:
...
@@ -311,7 +311,7 @@ class Workflow:
...
@@ -311,7 +311,7 @@ class Workflow:
def
get_publisher
(
self
):
def
get_publisher
(
self
):
"""
Function
that returns the publisher
"""
Method
that returns the publisher
Keyword arguments:
Keyword arguments:
...
@@ -322,7 +322,7 @@ class Workflow:
...
@@ -322,7 +322,7 @@ class Workflow:
return
None
return
None
def
get_output_dir
(
self
):
def
get_output_dir
(
self
):
"""
Function
that returns the output directory
"""
Method
that returns the output directory
Keyword arguments:
Keyword arguments:
...
@@ -330,7 +330,7 @@ class Workflow:
...
@@ -330,7 +330,7 @@ class Workflow:
return
self
.
nextflow_file
.
get_output_dir
()
return
self
.
nextflow_file
.
get_output_dir
()
def
get_file_address
(
self
):
def
get_file_address
(
self
):
"""
Function
that returns the adress of the workflow main
"""
Method
that returns the adress of the workflow main
Keyword arguments:
Keyword arguments:
...
@@ -343,7 +343,7 @@ class Workflow:
...
@@ -343,7 +343,7 @@ class Workflow:
self
.
nextflow_file
.
add_2_rocrate
(
dico
)
self
.
nextflow_file
.
add_2_rocrate
(
dico
)
def
get_processes_defined
(
self
):
def
get_processes_defined
(
self
):
"""
Function
that returns a list of the processes defined
"""
Method
that returns a list of the processes defined
Keyword arguments:
Keyword arguments:
...
@@ -352,7 +352,7 @@ class Workflow:
...
@@ -352,7 +352,7 @@ class Workflow:
return
list
(
processes
)
return
list
(
processes
)
def
get_processes_called
(
self
):
def
get_processes_called
(
self
):
"""
Function
that returns a list of the processes called/used during the workflow execution
"""
Method
that returns a list of the processes called/used during the workflow execution
Keyword arguments:
Keyword arguments:
...
@@ -360,7 +360,7 @@ class Workflow:
...
@@ -360,7 +360,7 @@ class Workflow:
return
self
.
nextflow_file
.
get_processes_called
()
return
self
.
nextflow_file
.
get_processes_called
()
def
get_tools
(
self
):
def
get_tools
(
self
):
"""
Function
that returns a list of the tools used by the workflow
"""
Method
that returns a list of the tools used by the workflow
Keyword arguments:
Keyword arguments:
...
@@ -372,7 +372,7 @@ class Workflow:
...
@@ -372,7 +372,7 @@ class Workflow:
return
list
(
set
(
tab
))
return
list
(
set
(
tab
))
def
get_commands
(
self
):
def
get_commands
(
self
):
"""
Function
that returns a list of the commands used by the workflow
"""
Method
that returns a list of the commands used by the workflow
Keyword arguments:
Keyword arguments:
...
@@ -384,7 +384,7 @@ class Workflow:
...
@@ -384,7 +384,7 @@ class Workflow:
return
list
(
set
(
tab
))
return
list
(
set
(
tab
))
def
get_modules
(
self
):
def
get_modules
(
self
):
"""
Function
that returns a list of the modules used by the workflow
"""
Method
that returns a list of the modules used by the workflow
Keyword arguments:
Keyword arguments:
...
@@ -396,7 +396,7 @@ class Workflow:
...
@@ -396,7 +396,7 @@ class Workflow:
return
list
(
set
(
tab
))
return
list
(
set
(
tab
))
def
initialise_rocrate
(
self
):
def
initialise_rocrate
(
self
):
"""
Function
that initialises the RO-Crate file
"""
Method
that initialises the RO-Crate file
Keyword arguments:
Keyword arguments:
...
@@ -481,7 +481,7 @@ class Workflow:
...
@@ -481,7 +481,7 @@ class Workflow:
def
initialise
(
self
,
create_rocrate
=
True
):
def
initialise
(
self
,
create_rocrate
=
True
):
"""
Function
that initialises the analysis of the worflow
"""
Method
that initialises the analysis of the worflow
Keyword arguments:
Keyword arguments:
...
@@ -491,7 +491,7 @@ class Workflow:
...
@@ -491,7 +491,7 @@ class Workflow:
self
.
initialise_rocrate
()
self
.
initialise_rocrate
()
def
generate_all_graphs
(
self
,
render_graphs
=
True
):
def
generate_all_graphs
(
self
,
render_graphs
=
True
):
"""
Function
that generates all graphs representing the workflow
"""
Method
that generates all graphs representing the workflow
Keyword arguments:
Keyword arguments:
...
...
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