Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gga_load_data
Manage
Activity
Members
Labels
Plan
Issues
12
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
abims
e-infra
gga_load_data
Commits
575ddd21
Commit
575ddd21
authored
3 years ago
by
Loraine Gueguen
Browse files
Options
Downloads
Patches
Plain Diff
fix filepath for upload_from_galaxy_fs(). Factorize get_species_dir()
parent
b6043307
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!10
Release 2.0
,
!9
Release 2.0 (merge dev to master)
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gga_load_data.py
+7
-3
7 additions, 3 deletions
gga_load_data.py
speciesData.py
+10
-2
10 additions, 2 deletions
speciesData.py
with
17 additions
and
5 deletions
gga_load_data.py
+
7
−
3
View file @
575ddd21
...
...
@@ -28,6 +28,8 @@ Do not call this script before the galaxy container is ready
GET_ORGANISMS_TOOL
=
"
toolshed.g2.bx.psu.edu/repos/gga/chado_organism_get_organisms/organism_get_organisms/2.3.4+galaxy0
"
DELETE_ORGANISMS_TOOL
=
"
toolshed.g2.bx.psu.edu/repos/gga/chado_organism_delete_organisms/organism_delete_organisms/2.3.4+galaxy0
"
HOST_DATA_DIR
=
'
src_data
'
CONTAINER_DATA_DIR_ROOT
=
'
/project_data
'
class
LoadData
(
speciesData
.
SpeciesData
):
"""
...
...
@@ -101,7 +103,7 @@ class LoadData(speciesData.SpeciesData):
return
histories
def
setup_library
(
self
,
data_dir_root
=
'
./src_data
'
):
def
setup_library
(
self
):
"""
Create a
"
Project Data
"
library in galaxy, mirroring the
"
src_data
"
folder of the current organism
directory tree
...
...
@@ -109,7 +111,7 @@ class LoadData(speciesData.SpeciesData):
:return:
"""
self
.
g
oto
_species_dir
()
data_dir_root
=
os
.
path
.
join
(
self
.
g
et
_species_dir
()
,
HOST_DATA_DIR
)
instance
=
GalaxyInstance
(
url
=
self
.
instance_url
,
email
=
self
.
config
[
"
galaxy_default_admin_email
"
],
...
...
@@ -181,9 +183,11 @@ class LoadData(speciesData.SpeciesData):
logging
.
info
(
"
Skipping useless file
'
%s
'"
%
single_file
)
continue
single_file_path
=
os
.
path
.
join
(
CONTAINER_DATA_DIR_ROOT
,
single_file
)
logging
.
info
(
"
Adding file
'
%s
'
with type
'
%s
'
and name
'
%s
'"
%
(
single_file
,
ftype
,
clean_name
))
datasets
=
prj_lib
.
upload_from_galaxy_fs
(
single_file
,
single_file
_path
,
folder
=
folder
,
link_data_only
=
'
link_to_files
'
,
file_type
=
ftype
,
...
...
This diff is collapsed.
Click to expand it.
speciesData.py
+
10
−
2
View file @
575ddd21
...
...
@@ -16,6 +16,15 @@ class SpeciesData:
"""
def
get_species_dir
(
self
):
species_dir
=
None
if
os
.
path
.
isdir
(
self
.
main_dir
)
and
not
self
.
genus_species
is
None
:
species_dir
=
os
.
path
.
join
(
self
.
main_dir
,
self
.
genus_species
)
else
:
logging
.
error
(
"
Cannot set species dir with
'
{0}/{1}
'"
.
format
(
self
.
main_dir
,
self
.
genus_species
))
return
species_dir
def
goto_species_dir
(
self
):
"""
Go to the species directory (starting from the main dir)
...
...
@@ -23,8 +32,7 @@ class SpeciesData:
:return:
"""
os
.
chdir
(
self
.
main_dir
)
species_dir
=
os
.
path
.
join
(
self
.
main_dir
,
self
.
genus_species
)
+
"
/
"
species_dir
=
self
.
get_species_dir
()
try
:
os
.
chdir
(
species_dir
)
except
OSError
:
...
...
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