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
9f1bffdc
Commit
9f1bffdc
authored
1 year ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
Starting to add Ro-crate support
parent
311f78a1
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/constant.py
+23
-0
23 additions, 0 deletions
src/constant.py
src/process.py
+8
-0
8 additions, 0 deletions
src/process.py
src/ro_crate.py
+14
-0
14 additions, 0 deletions
src/ro_crate.py
src/workflow.py
+25
-0
25 additions, 0 deletions
src/workflow.py
with
70 additions
and
0 deletions
src/constant.py
+
23
−
0
View file @
9f1bffdc
...
@@ -21,6 +21,27 @@ LIST_OPERATORS = ["distinct", "filter", "first", "last", "randomSample", "take",
...
@@ -21,6 +21,27 @@ LIST_OPERATORS = ["distinct", "filter", "first", "last", "randomSample", "take",
"
close
"
,
"
dump
"
,
"
ifEmpty
"
,
"
print
"
,
"
println
"
,
"
set
"
,
"
view
"
,
"
close
"
,
"
dump
"
,
"
ifEmpty
"
,
"
print
"
,
"
println
"
,
"
set
"
,
"
view
"
,
"
empty
"
,
"
of
"
,
"
fromPath
"
,
"
fromList
"
,
"
subscribe
"
,
"
value
"
,
"
from
"
]
#This last line is added by me:)
"
empty
"
,
"
of
"
,
"
fromPath
"
,
"
fromList
"
,
"
subscribe
"
,
"
value
"
,
"
from
"
]
#This last line is added by me:)
TOOLS
=
[
"
samtools
"
,
"
bcftools
"
,
"
fastqc
"
,
"
bedtools
"
,
"
multiqc
"
,
"
gatk
"
,
"
bwa
"
,
"
minimap2
"
,
"
tabix
"
,
"
vcf
"
,
"
wget
"
,
"
bgzip
"
,
"
hmmsearch
"
,
"
pigz
"
,
"
picard
"
,
"
star
"
,
"
iqtree
"
,
"
idxstats
"
,
]
#==========================
#==========================
# PATTERNS
# PATTERNS
...
@@ -122,3 +143,5 @@ SUBWORKFLOW_HEADER = r'workflow +(\w+|\'[\w ]+\'|\"[\w ]+\") *{'
...
@@ -122,3 +143,5 @@ SUBWORKFLOW_HEADER = r'workflow +(\w+|\'[\w ]+\'|\"[\w ]+\") *{'
WORKFLOW_HEADER
=
r
"
workflow\s*\{
"
WORKFLOW_HEADER
=
r
"
workflow\s*\{
"
WORKFLOW_HEADER_2
=
r
'
[^\w](workflow\s*{)
'
WORKFLOW_HEADER_2
=
r
'
[^\w](workflow\s*{)
'
This diff is collapsed.
Click to expand it.
src/process.py
+
8
−
0
View file @
9f1bffdc
...
@@ -19,6 +19,7 @@ class Process(Nextflow_Building_Blocks):
...
@@ -19,6 +19,7 @@ class Process(Nextflow_Building_Blocks):
self
.
output_code
=
""
self
.
output_code
=
""
self
.
when_code
=
""
self
.
when_code
=
""
self
.
script_code
=
""
self
.
script_code
=
""
self
.
tools
=
[]
self
.
initialise
()
self
.
initialise
()
self
.
initialised
=
True
self
.
initialised
=
True
...
@@ -71,6 +72,12 @@ class Process(Nextflow_Building_Blocks):
...
@@ -71,6 +72,12 @@ class Process(Nextflow_Building_Blocks):
def
get_nb_outputs
(
self
):
def
get_nb_outputs
(
self
):
return
len
(
self
.
outputs
)
return
len
(
self
.
outputs
)
def
extract_tools
(
self
):
script
=
self
.
script_code
.
lower
()
for
tool
in
constant
.
TOOLS
:
if
tool
in
script
:
self
.
tools
.
append
(
tool
)
def
initialise_parts
(
self
):
def
initialise_parts
(
self
):
code
=
self
.
get_code
()
code
=
self
.
get_code
()
...
@@ -126,6 +133,7 @@ class Process(Nextflow_Building_Blocks):
...
@@ -126,6 +133,7 @@ class Process(Nextflow_Building_Blocks):
self
.
when_code
=
temp_code
self
.
when_code
=
temp_code
elif
(
variables_index
[
i
]
==
'
script
'
):
elif
(
variables_index
[
i
]
==
'
script
'
):
self
.
script_code
=
temp_code
self
.
script_code
=
temp_code
self
.
extract_tools
()
else
:
else
:
raise
Exception
(
"
This shoudn
'
t happen!
"
)
raise
Exception
(
"
This shoudn
'
t happen!
"
)
...
...
This diff is collapsed.
Click to expand it.
src/ro_crate.py
0 → 100644
+
14
−
0
View file @
9f1bffdc
class
RO_Crate
:
def
__init__
(
self
,
workflow
):
self
.
nextflow_file
=
workflow
self
.
directroy
=
'
/
'
.
join
(
workflow
.
get_file_address
().
split
(
'
/
'
)[:
-
1
])
self
.
dico
=
{}
def
initialise_dico
(
self
):
None
def
initialise
(
self
):
self
.
initialise_dico
()
print
(
"
i
'
m initialised
"
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/workflow.py
0 → 100644
+
25
−
0
View file @
9f1bffdc
from
.nextflow_file
import
Nextflow_File
from
.ro_crate
import
RO_Crate
class
Workflow
:
def
__init__
(
self
,
file
,
duplicate
=
False
,
display_info
=
True
):
self
.
nextflow_file
=
Nextflow_File
(
file
,
duplicate
=
duplicate
,
display_info
=
display_info
)
self
.
rocrate
=
None
def
get_file_address
(
self
):
return
self
.
nextflow_file
.
get_file_address
()
def
initialise_rocrate
(
self
):
self
.
rocrate
=
RO_Crate
(
self
)
self
.
rocrate
.
initialise
()
def
initialise
(
self
):
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
)
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