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
11 months 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
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
):
self
.
origin
=
origin
#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
.bioflowinsighterror
import
BioFlowInsightError
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
):
self
.
name
=
name
self
.
origin
=
origin
...
...
@@ -13,36 +24,77 @@ class Channel(Nextflow_Building_Blocks):
def
get_code
(
self
):
"""
Method that returns the channels code
Keyword arguments:
"""
return
self
.
name
.
strip
()
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
)
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
)
def
set_sink_null
(
self
):
"""
Method that sets the channel
'
s sink to an empty list
"""
self
.
sink
=
[]
def
get_type
(
self
):
"""
Method that returns the channel
'
s type which is
"
Channel
"
"""
return
"
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
)
def
get_source
(
self
):
"""
Method that returns the channel
'
s sources
"""
return
self
.
source
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
)
def
get_sink
(
self
):
"""
Method that returns the channel
'
s sink
"""
return
self
.
sink
def
get_name
(
self
):
"""
Method that returns the channel
'
s name
"""
return
self
.
name
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
():
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:
self
.
get_dico
()
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:
...
...
@@ -102,7 +102,7 @@ class Workflow:
return
repo
def
get_processes_annotation
(
self
):
"""
Function
the dictionnary of the process annotations
"""
Method
the dictionnary of the process annotations
Keyword arguments:
...
...
@@ -110,7 +110,7 @@ class Workflow:
return
self
.
processes_annotation
def
fill_log
(
self
):
"""
Function
that reads the git log and saves it
"""
Method
that reads the git log and saves it
Keyword arguments:
...
...
@@ -127,7 +127,7 @@ class Workflow:
os
.
chdir
(
current_directory
)
def
get_address
(
self
):
"""
Function
that returns the adress of the workflow main
"""
Method
that returns the adress of the workflow main
Keyword arguments:
...
...
@@ -135,7 +135,7 @@ class Workflow:
return
self
.
address
def
set_address
(
self
):
"""
Function
that sets the adress of the workflow main
"""
Method
that sets the adress of the workflow main
Keyword arguments:
...
...
@@ -154,7 +154,7 @@ class Workflow:
self
.
address
=
match
.
group
(
1
)
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:
...
...
@@ -174,7 +174,7 @@ class Workflow:
def
get_name
(
self
):
"""
Function
that returns the name of the workflow
"""
Method
that returns the name of the workflow
Keyword arguments:
...
...
@@ -187,7 +187,7 @@ class Workflow:
#Format yyyy-mm-dd
#Here i return the first commit date
def
get_datePublished
(
self
):
"""
Function
that returns the date of publication
"""
Method
that returns the date of publication
Keyword arguments:
...
...
@@ -203,7 +203,7 @@ class Workflow:
def
get_description
(
self
):
"""
Function
that returns the description
"""
Method
that returns the description
Keyword arguments:
...
...
@@ -220,7 +220,7 @@ class Workflow:
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:
...
...
@@ -229,7 +229,7 @@ class Workflow:
def
get_license
(
self
):
"""
Function
that returns the license
"""
Method
that returns the license
Keyword arguments:
...
...
@@ -254,7 +254,7 @@ class Workflow:
def
get_authors
(
self
):
"""
Function
that returns a list of the authors
"""
Method
that returns a list of the authors
Keyword arguments:
...
...
@@ -278,7 +278,7 @@ class Workflow:
#Need to follow this format : "rna-seq, nextflow, bioinformatics, reproducibility, workflow, reproducible-research, bioinformatics-pipeline"
def
get_keywords
(
self
):
"""
Function
that returns the keywords
"""
Method
that returns the keywords
Keyword arguments:
...
...
@@ -295,7 +295,7 @@ class Workflow:
def
get_producer
(
self
):
"""
Function
that returns the producer
"""
Method
that returns the producer
Keyword arguments:
...
...
@@ -311,7 +311,7 @@ class Workflow:
def
get_publisher
(
self
):
"""
Function
that returns the publisher
"""
Method
that returns the publisher
Keyword arguments:
...
...
@@ -322,7 +322,7 @@ class Workflow:
return
None
def
get_output_dir
(
self
):
"""
Function
that returns the output directory
"""
Method
that returns the output directory
Keyword arguments:
...
...
@@ -330,7 +330,7 @@ class Workflow:
return
self
.
nextflow_file
.
get_output_dir
()
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:
...
...
@@ -343,7 +343,7 @@ class Workflow:
self
.
nextflow_file
.
add_2_rocrate
(
dico
)
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:
...
...
@@ -352,7 +352,7 @@ class Workflow:
return
list
(
processes
)
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:
...
...
@@ -360,7 +360,7 @@ class Workflow:
return
self
.
nextflow_file
.
get_processes_called
()
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:
...
...
@@ -372,7 +372,7 @@ class Workflow:
return
list
(
set
(
tab
))
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:
...
...
@@ -384,7 +384,7 @@ class Workflow:
return
list
(
set
(
tab
))
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:
...
...
@@ -396,7 +396,7 @@ class Workflow:
return
list
(
set
(
tab
))
def
initialise_rocrate
(
self
):
"""
Function
that initialises the RO-Crate file
"""
Method
that initialises the RO-Crate file
Keyword arguments:
...
...
@@ -481,7 +481,7 @@ class Workflow:
def
initialise
(
self
,
create_rocrate
=
True
):
"""
Function
that initialises the analysis of the worflow
"""
Method
that initialises the analysis of the worflow
Keyword arguments:
...
...
@@ -491,7 +491,7 @@ class Workflow:
self
.
initialise_rocrate
()
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:
...
...
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