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
c6d97287
Commit
c6d97287
authored
1 year ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
update ro-crate
parent
1bc2f09d
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
+16
-1
16 additions, 1 deletion
src/constant.py
src/ro_crate.py
+1
-1
1 addition, 1 deletion
src/ro_crate.py
src/subworkflow.py
+0
-1
0 additions, 1 deletion
src/subworkflow.py
src/workflow.py
+62
-14
62 additions, 14 deletions
src/workflow.py
with
79 additions
and
17 deletions
src/constant.py
+
16
−
1
View file @
c6d97287
...
@@ -144,4 +144,19 @@ WORKFLOW_HEADER = r"workflow\s*\{"
...
@@ -144,4 +144,19 @@ WORKFLOW_HEADER = r"workflow\s*\{"
WORKFLOW_HEADER_2
=
r
'
[^\w](workflow\s*{)
'
WORKFLOW_HEADER_2
=
r
'
[^\w](workflow\s*{)
'
# MONTHS
#--------------------------
month_mapping
=
{
'
Jan
'
:
'
01
'
,
'
Feb
'
:
'
02
'
,
'
Mar
'
:
'
03
'
,
'
Apr
'
:
'
04
'
,
'
May
'
:
'
05
'
,
'
Jun
'
:
'
06
'
,
'
Jul
'
:
'
07
'
,
'
Aug
'
:
'
08
'
,
'
Sep
'
:
'
09
'
,
'
Oct
'
:
'
10
'
,
'
Nov
'
:
'
11
'
,
'
Dec
'
:
'
12
'
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/ro_crate.py
+
1
−
1
View file @
c6d97287
...
@@ -42,7 +42,7 @@ class RO_Crate:
...
@@ -42,7 +42,7 @@ class RO_Crate:
authors
=
self
.
workflow
.
get_authors
()
authors
=
self
.
workflow
.
get_authors
()
tab_authors
=
[]
tab_authors
=
[]
for
author
in
authors
:
for
author
in
authors
:
tab_authors
.
append
({
"
@id
"
:
author
[
"
@id
"
]})
tab_authors
.
append
({
"
@id
"
:
author
[
"
@id
"
]
,
"
name
"
:
author
[
"
name
"
]
})
root
[
"
author
"
]
=
tab_authors
root
[
"
author
"
]
=
tab_authors
root
[
"
maintainer
"
]
=
tab_authors
#Right now i'm assuming that all the authors are maintainers
root
[
"
maintainer
"
]
=
tab_authors
#Right now i'm assuming that all the authors are maintainers
files
=
self
.
get_files
()
files
=
self
.
get_files
()
...
...
This diff is collapsed.
Click to expand it.
src/subworkflow.py
+
0
−
1
View file @
c6d97287
...
@@ -285,7 +285,6 @@ class Subworkflow(Main_DSL2):
...
@@ -285,7 +285,6 @@ class Subworkflow(Main_DSL2):
else
:
else
:
for
o
in
exe
.
get_origins
():
for
o
in
exe
.
get_origins
():
if
(
o
.
get_type
()
==
"
Call
"
):
if
(
o
.
get_type
()
==
"
Call
"
):
print
(
"
works
"
)
called
+=
o
.
get_elements_called
()
called
+=
o
.
get_elements_called
()
for
c
in
called
:
for
c
in
called
:
...
...
This diff is collapsed.
Click to expand it.
src/workflow.py
+
62
−
14
View file @
c6d97287
from
.nextflow_file
import
Nextflow_File
from
.nextflow_file
import
Nextflow_File
from
.ro_crate
import
RO_Crate
from
.ro_crate
import
RO_Crate
from
.
import
constant
import
os
import
re
class
Workflow
:
class
Workflow
:
def
__init__
(
self
,
file
,
duplicate
=
False
,
display_info
=
True
):
def
__init__
(
self
,
file
,
duplicate
=
False
,
display_info
=
True
,
name
=
None
,
datePublished
=
None
,
description
=
None
,
license
=
None
,
creativeWorkStatus
=
None
,
authors
=
None
,
version
=
None
,
keywords
=
None
,
producer
=
None
,
publisher
=
None
):
self
.
nextflow_file
=
Nextflow_File
(
file
,
duplicate
=
duplicate
,
display_info
=
display_info
)
self
.
nextflow_file
=
Nextflow_File
(
file
,
duplicate
=
duplicate
,
display_info
=
display_info
)
self
.
rocrate
=
None
self
.
rocrate
=
None
self
.
name
=
name
self
.
datePublished
=
datePublished
self
.
description
=
description
self
.
license
=
license
self
.
creativeWorkStatus
=
creativeWorkStatus
self
.
authors
=
authors
self
.
version
=
version
self
.
keywords
=
keywords
self
.
producer
=
producer
self
.
publisher
=
publisher
self
.
log
=
None
self
.
fill_log
()
#TODO
def
get_name
(
self
):
return
"
TODO
"
#TODO
def
fill_log
(
self
):
current_directory
=
os
.
getcwd
()
os
.
chdir
(
"
/
"
.
join
(
self
.
nextflow_file
.
get_file_address
().
split
(
"
/
"
)[:
-
1
]))
os
.
system
(
f
"
git log --reverse > temp_
{
id
(
self
)
}
.txt
"
)
with
open
(
f
'
temp_
{
id
(
self
)
}
.txt
'
)
as
f
:
self
.
log
=
f
.
read
()
os
.
system
(
f
"
rm temp_
{
id
(
self
)
}
.txt
"
)
os
.
chdir
(
current_directory
)
def
get_name
(
self
):
if
(
self
.
name
==
None
):
return
self
.
nextflow_file
.
get_file_address
().
split
(
"
/
"
)[
-
2
]
else
:
return
self
.
name
#Format yyyy-mm-dd
def
get_datePublished
(
self
):
def
get_datePublished
(
self
):
return
"
TODO
"
if
(
self
.
datePublished
==
None
):
for
match
in
re
.
finditer
(
r
"
Date: +\w+ +(\w+) +(\d+) +\d+:\d+:\d+ +(\d+)
"
,
self
.
log
):
month
=
constant
.
month_mapping
[
match
.
group
(
1
)]
day
=
match
.
group
(
2
)
year
=
match
.
group
(
3
)
return
f
"
{
year
}
-
{
month
}
-
{
day
}
"
else
:
return
self
.
datePublished
#TODO
#TODO
def
get_description
(
self
):
def
get_description
(
self
):
return
"
TODO
"
return
"
TODO
"
#TODO
def
get_main_file
(
self
):
def
get_main_file
(
self
):
return
"
TODO
"
return
self
.
nextflow_file
.
get_file_address
().
split
(
"
/
"
)[
-
1
]
#TODO
#TODO
def
get_license
(
self
):
def
get_license
(
self
):
return
"
TODO
"
return
"
TODO
"
#TODO
def
get_main_license
(
self
):
return
"
TODO
"
#TODO
#TODO
def
get_creativeWorkStatus
(
self
):
def
get_creativeWorkStatus
(
self
):
return
"
TODO
"
return
"
TODO
"
...
@@ -40,9 +79,18 @@ class Workflow:
...
@@ -40,9 +79,18 @@ class Workflow:
def
get_version
(
self
):
def
get_version
(
self
):
return
"
TODO
"
return
"
TODO
"
#TODO
#TODO
-> this doesn't workf perfectly
def
get_authors
(
self
):
def
get_authors
(
self
):
return
[{
"
@id
"
:
"
George
"
}]
if
(
self
.
authors
==
None
):
authors
=
{}
for
match
in
re
.
finditer
(
r
"
Author: (\w+ +\w+) <([^>]+)>
"
,
self
.
log
):
authors
[
match
.
group
(
2
)]
=
match
.
group
(
1
)
tab
=
[]
for
author
in
authors
:
tab
.
append
({
"
@id
"
:
author
,
"
name
"
:
authors
[
author
]})
return
tab
else
:
return
self
.
authors
#TODO
#TODO
#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"
...
...
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