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
0
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
9af3ac1a
Commit
9af3ac1a
authored
6 months ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
update
parent
b7f9a1f8
No related branches found
No related tags found
No related merge requests found
Pipeline
#14055
passed with stage
Stage:
in 2 minutes and 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/outils_annotate.py
+3
-113
3 additions, 113 deletions
src/outils_annotate.py
src/workflow.py
+9
-2
9 additions, 2 deletions
src/workflow.py
with
12 additions
and
115 deletions
src/outils_annotate.py
+
3
−
113
View file @
9af3ac1a
...
...
@@ -17,8 +17,8 @@ def get_propositions(process, tools = -1, commands = -1):
#if(f"{tool}{character}" in process):
temp
.
append
(
tool
)
if
(
commands
!=-
1
):
for
c
ommands
in
commands
:
tool
,
command
=
c
ommands
.
split
()
for
c
in
commands
:
tool
,
command
=
c
.
split
()
command
=
command
.
replace
(
'
+
'
,
'
\+
'
)
for
match
in
re
.
finditer
(
tool
+
r
"
\s+\-[^\s]+\s+
"
+
command
,
process
):
temp
.
append
(
commands
)
...
...
@@ -70,7 +70,7 @@ def get_tools_commands_from_user_for_process(p, exiting_tools, existing_commands
codes
+=
p
.
get_external_scripts_code
()
for
c
in
codes
:
print_colored_words
(
c
,
get_propositions
(
p
,
commands
=
existing_commands
)
+
get_propositions
(
p
,
tools
=
exiting_tools
))
print_colored_words
(
c
,
get_propositions
(
c
,
commands
=
existing_commands
)
+
get_propositions
(
c
,
tools
=
exiting_tools
))
print
(
"
\n
TOOLS
"
)
confirmation
=
'
a
'
while
(
confirmation
!=
""
):
...
...
@@ -89,113 +89,3 @@ def get_tools_commands_from_user_for_process(p, exiting_tools, existing_commands
return
tools_found
,
commands_found
,
exiting_tools
,
existing_commands
index
=
0
for
process_id
in
process_2_annotations_pre_verification
:
p
=
process_2_annotations_pre_verification
[
process_id
][
"
process
"
]
try
:
tmp
=
process_2_annotation
[
process_id
]
except
:
current_tools
=
process_2_annotations_pre_verification
[
process_id
][
"
tools
"
]
current_commands
=
process_2_annotations_pre_verification
[
process_id
][
"
commands
"
]
print
(
f
"
\n
* Current progess :
{
index
/
len
(
process_2_annotations_pre_verification
)
*
100
:
.
2
f
}
% (
{
len
(
process_2_annotations_pre_verification
)
-
index
}
left)
"
)
print
(
"
--------------------------------------------------
"
)
print_colored_words
(
p
,
current_commands
+
current_tools
+
get_propositions
(
p
,
commands
=
commands
)
+
get_propositions
(
p
,
tools
=
tools
))
validate_annoation
=
False
while
(
not
validate_annoation
):
print
()
print_colored_words
(
f
"
- Current tools:
{
current_tools
}
"
,
current_commands
+
current_tools
)
print_colored_words
(
f
"
- Current commands:
{
current_commands
}
"
,
current_commands
+
current_tools
)
print
()
annotation
=
input
(
"
Validate current annotations (press enter/ anykey otherwise):
"
)
if
(
annotation
==
""
):
validate_annoation
=
True
else
:
print
(
"
\n
TOOLS
"
)
confirmation
=
'
a
'
while
(
confirmation
!=
""
):
propositions
=
get_propositions_from_user
()
confirmation
=
input
(
f
"
Press
'
ENTER
'
to validate this propostion of tools
{
propositions
}
(press any key otherwise) :
"
)
current_tools
=
propositions
print
(
"
\n
COMMANDS
"
)
confirmation
=
'
a
'
while
(
confirmation
!=
""
):
propositions
=
get_propositions_from_user
()
confirmation
=
input
(
f
"
Press
'
ENTER
'
to validate this propostion of commands
{
propositions
}
(press any key otherwise) :
"
)
current_commands
=
propositions
tools
+=
current_tools
commands
+=
current_commands
tools
=
list
(
set
(
tools
))
commands
=
list
(
set
(
commands
))
ext_tools
,
ext_commands
=
[],
[]
for
ext
in
process_2_annotations_pre_verification
[
process_id
][
"
external_scripts
"
]:
envs
=
[
"
env python
"
,
"
env Rscript
"
]
show_it
=
True
for
env
in
envs
:
if
(
env
in
ext
):
show_it
=
False
if
(
show_it
):
print
(
"
\n
--------------------------------------------------
"
)
propositions
=
get_propositions
(
ext
,
tools
=
tools
)
print_colored_words
(
ext
,
propositions
)
print
(
"
\n
TOOLS
"
)
print_colored_words
(
f
"
Propositions are :
{
propositions
}
"
,
propositions
)
val
=
input
(
"
Press
'
ENTER
'
to validate (press any key otherwise) :
"
)
if
(
val
==
''
):
ext_tools
+=
propositions
else
:
confirmation
=
'
a
'
while
(
confirmation
!=
""
):
propositions
=
get_propositions_from_user
()
confirmation
=
input
(
f
"
Press
'
ENTER
'
to validate this propostion of tools
{
propositions
}
(press any key otherwise) :
"
)
ext_tools
+=
propositions
propositions
=
get_propositions
(
ext
,
commands
=
commands
)
print_colored_words
(
ext
,
propositions
)
print
(
"
\n
COMMANDS
"
)
print_colored_words
(
f
"
Propositions are :
{
propositions
}
"
,
propositions
)
val
=
input
(
"
Press
'
ENTER
'
to validate (press any key otherwise) :
"
)
if
(
val
==
''
):
ext_commands
+=
propositions
else
:
confirmation
=
'
a
'
while
(
confirmation
!=
""
):
propositions
=
get_propositions_from_user
()
confirmation
=
input
(
f
"
Press
'
ENTER
'
to validate this propostion of commands
{
propositions
}
(press any key otherwise) :
"
)
current_commands
=
propositions
ext_commands
+=
propositions
current_tools
+=
ext_tools
current_commands
+=
ext_commands
current_tools
=
list
(
set
(
current_tools
))
current_commands
=
list
(
set
(
current_commands
))
tools
+=
current_tools
commands
+=
current_commands
tools
=
list
(
set
(
tools
))
commands
=
list
(
set
(
commands
))
process_2_annotation
[
process_id
]
=
{}
process_2_annotation
[
process_id
][
'
process
'
]
=
process_2_annotations_pre_verification
[
process_id
][
'
process
'
]
process_2_annotation
[
process_id
][
'
has_external_scripts
'
]
=
process_2_annotations_pre_verification
[
process_id
][
'
has_external_scripts
'
]
process_2_annotation
[
process_id
][
'
external_scripts
'
]
=
process_2_annotations_pre_verification
[
process_id
][
'
external_scripts
'
]
process_2_annotation
[
process_id
][
'
R_modules
'
]
=
process_2_annotations_pre_verification
[
process_id
][
'
R_modules
'
]
process_2_annotation
[
process_id
][
'
python_modules
'
]
=
process_2_annotations_pre_verification
[
process_id
][
'
python_modules
'
]
process_2_annotation
[
process_id
][
'
perl_modules
'
]
=
process_2_annotations_pre_verification
[
process_id
][
'
perl_modules
'
]
process_2_annotation
[
process_id
][
'
tools
'
]
=
current_tools
process_2_annotation
[
process_id
][
'
commands
'
]
=
current_commands
with
open
(
"
process_2_annotation.json
"
,
"
w
"
)
as
outfile
:
json
.
dump
(
process_2_annotation
,
outfile
,
indent
=
4
)
index
+=
1
This diff is collapsed.
Click to expand it.
src/workflow.py
+
9
−
2
View file @
9af3ac1a
...
...
@@ -49,7 +49,6 @@ class Workflow:
processes_annotation
=
None
,
personnal_acces_token
=
None
,
processes_2_tools
=
None
):
if
(
not
os
.
path
.
isfile
(
file
)):
nextflow_files
=
glob
.
glob
(
f
'
{
file
}
/*.nf
'
)
if
(
len
(
nextflow_files
)
==
0
):
...
...
@@ -538,15 +537,23 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
self
.
nextflow_file
.
generate_user_view
(
relevant_processes
=
relevant_processes
,
render_graphs
=
render_graphs
,
processes_2_remove
=
tab_processes_2_remove
)
def
build_processes_2_tools
(
self
):
if
(
self
.
processes_2_tools
==
None
):
print
()
print
(
"
Let
'
s extarct the tools from the processes
"
)
print
(
"
------------------------------------------
"
)
print
()
exiting_tools
,
existing_commands
=
[],
[]
processes
=
self
.
get_processes_
us
ed
()
processes
=
self
.
get_processes_
call
ed
()
dico
=
{}
index
=
0
for
p
in
processes
:
print
(
f
"
*
{
index
/
len
(
processes
)
*
100
:
.
2
f
}
% (
{
index
}
) processes annotated
"
)
tools_found
,
commands_found
,
exiting_tools
,
existing_commands
=
get_tools_commands_from_user_for_process
(
p
,
exiting_tools
,
existing_commands
)
dico
[
p
.
get_code
()]
=
{}
dico
[
p
.
get_code
()][
"
tools
"
]
=
tools_found
dico
[
p
.
get_code
()][
"
commands
"
]
=
commands_found
index
+=
1
self
.
processes_2_tools
=
dico
with
open
(
f
"
{
self
.
get_output_dir
()
}
/processes_2_tools.json
"
,
'
w
'
)
as
output_file
:
json
.
dump
(
self
.
processes_2_tools
,
output_file
,
indent
=
2
)
...
...
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