Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
ng6
Commits
992e5805
Commit
992e5805
authored
Sep 06, 2019
by
Celine Noirot
Browse files
Merge branch 'issue#124' into 'master'
Merge branch Issue#124 with master See merge request
!36
parents
4ce3e172
5645d27f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ng6/analysis.py
View file @
992e5805
...
...
@@ -143,14 +143,19 @@ class Analysis (Component):
logging
.
getLogger
(
"Analysis.__init__"
).
debug
(
"tempfile.tempdir = "
+
tempfile
.
tempdir
)
if
not
os
.
path
.
isdir
(
tempfile
.
tempdir
):
os
.
makedirs
(
tempfile
.
tempdir
,
0o751
)
logging
.
getLogger
(
"Analysis.__init__"
).
debug
(
"self.space_id = "
+
self
.
space_id
)
if
id
!=
None
:
# If not a new analysis
logging
.
getLogger
(
"Analysis.__init__"
).
debug
(
"Connexion à la BD"
)
t3mysql
=
t3MySQLdb
()
logging
.
getLogger
(
"Analysis.__init__"
).
debug
(
"Connexion effectuée"
)
self
.
run
=
Run
.
get_from_id
(
self
.
__get_run_id
())
from
ng6.project
import
Project
self
.
project
=
Project
.
get_from_run_id
(
self
.
__get_run_id
())
if
self
.
run
!=
None
:
self
.
project
=
Project
.
get_from_run_id
(
self
.
__get_run_id
())
else
:
self
.
project
=
Project
.
get_from_id
(
self
.
__get_project_id
())
self
.
space_id
=
self
.
project
.
space_id
self
.
directory
=
t3mysql
.
select_analysis_directory
(
id
)
logging
.
getLogger
(
"Analysis.__init__"
).
debug
(
"Building analysis with id="
+
str
(
id
)
+
" ["
+
str
(
self
)
+
"]"
)
...
...
@@ -669,17 +674,17 @@ class Analysis (Component):
@param id : the analysis id
"""
logging
.
getLogger
(
"Analysis.get_from_id"
).
debug
(
"Loading the analysis from id "
+
str
(
id
))
try
:
t3mysql
=
t3MySQLdb
()
[
name
,
date
,
description
,
software
,
options
,
version
]
=
t3mysql
.
select_analysis
(
id
)
my_analysis
=
Analysis
(
name
,
description
,
software
,
options
,
version
,
id
)
if
my_analysis
==
None
:
logging
.
getLogger
(
"Analysis.get_from_id"
).
error
(
"The analysis id="
+
str
(
id
)
+
" does not exists in the database."
)
raise
Exception
(
"The analysis id="
+
str
(
id
)
+
" does not exists in the database.
\n
"
)
return
my_analysis
except
Exception
as
err
:
logging
.
getLogger
(
"Analysis.get_from_id"
).
error
(
"Error while loading the analysis from the database ["
+
str
(
err
)
+
"]"
)
raise
Exception
(
"Error while loading the analysis from the database
\n
"
+
str
(
err
))
#
try:
t3mysql
=
t3MySQLdb
()
[
name
,
date
,
description
,
software
,
options
,
version
]
=
t3mysql
.
select_analysis
(
id
)
my_analysis
=
Analysis
(
name
,
description
,
software
,
options
,
version
,
id
)
if
my_analysis
==
None
:
logging
.
getLogger
(
"Analysis.get_from_id"
).
error
(
"The analysis id="
+
str
(
id
)
+
" does not exists in the database."
)
raise
Exception
(
"The analysis id="
+
str
(
id
)
+
" does not exists in the database.
\n
"
)
return
my_analysis
#
except Exception as err:
#
logging.getLogger("Analysis.
q
get_from_id").error("Error while loading the analysis from the database [" + str(err) + "]")
#
raise Exception("Error while loading the analysis from the database\n" + str(err))
@
staticmethod
...
...
src/ng6/ng6workflow.py
View file @
992e5805
...
...
@@ -42,6 +42,7 @@ class BasicNG6Workflow (Workflow):
self
.
add_parameter
(
"admin_login"
,
"Who is the project administrator"
,
required
=
True
,
type
=
'ng6userlogin'
,
display_name
=
"Admin login"
)
def
add_component
(
self
,
component_name
,
args
=
[],
kwargs
=
{},
component_prefix
=
"default"
,
parent
=
None
,
addto
=
"run"
):
logging
.
getLogger
(
"ng6"
).
debug
(
"addto, logging test 1"
)
# first build and check if this component is OK
if
component_name
in
self
.
internal_components
or
component_name
in
self
.
external_components
:
...
...
@@ -65,11 +66,14 @@ class BasicNG6Workflow (Workflow):
if
derived_class
.
__name__
==
"Analysis"
:
# add parent and project/run information
cmpt_object
.
parent
=
parent
if
addto
==
"project"
:
cmpt_object
.
project
=
self
.
project
elif
addto
==
"run"
:
cmpt_object
.
run
=
self
.
runobj
#We replace the default space_id
if
cmpt_object
.
space_id
==
"default"
and
cmpt_object
.
space_id
!=
cmpt_object
.
run
.
space_id
:
cmpt_object
.
space_id
=
cmpt_object
.
run
.
space_id
if
addto
==
"project"
:
cmpt_object
.
project
=
self
.
project
cmpt_object
.
space_id
=
cmpt_object
.
project
.
space_id
elif
addto
==
"run"
:
cmpt_object
.
run
=
self
.
runobj
#We replace the default space_id
if
cmpt_object
.
space_id
==
"default"
:
cmpt_object
.
space_id
=
cmpt_object
.
run
.
space_id
# link analysis with ots create user
cmpt_object
.
admin_login
=
self
.
admin_login
...
...
Romain Therville
🐭
@rtherville
mentioned in issue
#95 (closed)
·
Sep 27, 2019
mentioned in issue
#95 (closed)
mentioned in issue #95
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment