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
SOaAS
psot.repository
Commits
78d90258
Commit
78d90258
authored
Feb 07, 2018
by
Lukas Jelonek
Browse files
Moved helper scripts to own directory. Use absolute paths for scripts.
parent
67704550
Changes
8
Hide whitespace changes
Inline
Side-by-side
psot/config.py
View file @
78d90258
...
@@ -66,8 +66,8 @@ class Repository:
...
@@ -66,8 +66,8 @@ class Repository:
module
[
'analysis'
][
'parameters'
]
=
{}
module
[
'analysis'
][
'parameters'
]
=
{}
if
module
[
'converter'
][
'parameters'
]
is
None
:
if
module
[
'converter'
][
'parameters'
]
is
None
:
module
[
'converter'
][
'parameters'
]
=
{}
module
[
'converter'
][
'parameters'
]
=
{}
module
[
'analysis'
][
'script'
]
=
os
.
path
.
join
(
self
.
get_scripts_location
(),
module
[
'analysis'
][
'script'
])
module
[
'analysis'
][
'script'
]
=
os
.
path
.
abspath
(
os
.
path
.
join
(
self
.
get_scripts_location
(),
module
[
'analysis'
][
'script'
])
)
module
[
'converter'
][
'script'
]
=
os
.
path
.
join
(
self
.
get_scripts_location
(),
module
[
'converter'
][
'script'
])
module
[
'converter'
][
'script'
]
=
os
.
path
.
abspath
(
os
.
path
.
join
(
self
.
get_scripts_location
(),
module
[
'converter'
][
'script'
])
)
return
modules
return
modules
def
normalize_profiles
(
self
,
profiles
):
def
normalize_profiles
(
self
,
profiles
):
...
@@ -120,6 +120,7 @@ class Config:
...
@@ -120,6 +120,7 @@ class Config:
config
[
'app'
][
'script_path'
]
=
repo
.
get_scripts_location
()
config
[
'app'
][
'script_path'
]
=
repo
.
get_scripts_location
()
config
[
'install_path'
]
=
pkg_resources
.
resource_filename
(
'psot'
,
''
)
config
[
'install_path'
]
=
pkg_resources
.
resource_filename
(
'psot'
,
''
)
config
[
'helpers_path'
]
=
pkg_resources
.
resource_filename
(
'psot'
,
'helpers'
)
config
[
'repository_paths'
]
=
self
.
repo_paths
config
[
'repository_paths'
]
=
self
.
repo_paths
return
config
return
config
...
@@ -127,10 +128,14 @@ def load_config(repositories=None):
...
@@ -127,10 +128,14 @@ def load_config(repositories=None):
# always use the installed repository as the first repo
# always use the installed repository as the first repo
all_repositories
=
[
pkg_resources
.
resource_filename
(
'psot'
,
''
)]
all_repositories
=
[
pkg_resources
.
resource_filename
(
'psot'
,
''
)]
# check for repositories via environment variable
# check for repositories via environment variable
if
'PSOT_REPOSITORIES'
in
os
.
environ
:
if
'PSOT_REPOSITORIES'
in
os
.
environ
:
variable
=
os
.
environ
[
'PSOT_REPOSITORIES'
]
variable
=
os
.
environ
[
'PSOT_REPOSITORIES'
]
env_repos
=
variable
.
split
(
':'
)
env_repos
=
variable
.
split
(
':'
)
# convert all paths to absolute paths
env_repos
=
[
os
.
path
.
abspath
(
x
)
for
x
in
env_repos
]
os
.
environ
[
'PSOT_REPOSITORIES'
]
=
":"
.
join
(
env_repos
)
all_repositories
.
extend
(
env_repos
)
all_repositories
.
extend
(
env_repos
)
if
repositories
:
if
repositories
:
...
...
psot/
script
s/join_json_files.py
→
psot/
helper
s/join_json_files.py
View file @
78d90258
File moved
psot/
script
s/reduce_fasta_headers_to_enumeration.py
→
psot/
helper
s/reduce_fasta_headers_to_enumeration.py
View file @
78d90258
File moved
psot/
script
s/resolve_dbxrefs.py
→
psot/
helper
s/resolve_dbxrefs.py
View file @
78d90258
File moved
psot/
script
s/restore_seq_id_from_enumeration.py
→
psot/
helper
s/restore_seq_id_from_enumeration.py
View file @
78d90258
File moved
psot/
script
s/split_json_into_separate_files.py
→
psot/
helper
s/split_json_into_separate_files.py
View file @
78d90258
File moved
psot/main.py
View file @
78d90258
...
@@ -64,9 +64,9 @@ def generate_execution(config, args):
...
@@ -64,9 +64,9 @@ def generate_execution(config, args):
execution
[
'use_cluster'
]
=
args
.
use_cluster
execution
[
'use_cluster'
]
=
args
.
use_cluster
execution
[
'fetch_informations'
]
=
args
.
fetch_informations
execution
[
'fetch_informations'
]
=
args
.
fetch_informations
execution
[
'mode'
]
=
'live'
if
args
.
live
else
'complete'
execution
[
'mode'
]
=
'live'
if
args
.
live
else
'complete'
execution
[
'script_path'
]
=
config
[
'app'
][
'script_path'
]
execution
[
'fasta'
]
=
os
.
path
.
abspath
(
args
.
fasta
)
execution
[
'fasta'
]
=
os
.
path
.
abspath
(
args
.
fasta
)
execution
[
'output'
]
=
os
.
path
.
abspath
(
args
.
output
)
execution
[
'output'
]
=
os
.
path
.
abspath
(
args
.
output
)
execution
[
'install_path'
]
=
config
[
'install_path'
]
if
args
.
execution_dir
:
if
args
.
execution_dir
:
execution
[
'directory'
]
=
os
.
path
.
abspath
(
args
.
execution_dir
)
execution
[
'directory'
]
=
os
.
path
.
abspath
(
args
.
execution_dir
)
else
:
else
:
...
...
psot/nextflow.py
View file @
78d90258
...
@@ -166,7 +166,7 @@ def setup_execution_directory(execution):
...
@@ -166,7 +166,7 @@ def setup_execution_directory(execution):
script_file
.
write
(
nextflow_script
)
script_file
.
write
(
nextflow_script
)
if
not
os
.
path
.
exists
(
directory
+
'/bin'
):
if
not
os
.
path
.
exists
(
directory
+
'/bin'
):
os
.
symlink
(
execution
[
'script_path'
]
,
directory
+
'/bin'
)
os
.
symlink
(
os
.
path
.
join
(
execution
[
'install_path'
],
'helpers'
)
,
directory
+
'/bin'
)
#if not os.path.exists(directory + '/psot'):
#if not os.path.exists(directory + '/psot'):
# os.symlink(execution['psot_path'], directory + '/psot')
# os.symlink(execution['psot_path'], directory + '/psot')
...
...
Write
Preview
Supports
Markdown
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