Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IMP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
IMP-dev
IMP
Commits
7b72d74e
Commit
7b72d74e
authored
9 years ago
by
Yohan Jarosz
Browse files
Options
Downloads
Patches
Plain Diff
Mount the current IMP codebase via --current option
parent
2b4417ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
IMP
+24
-13
24 additions, 13 deletions
IMP
with
24 additions
and
13 deletions
IMP
+
24
−
13
View file @
7b72d74e
...
...
@@ -21,8 +21,8 @@ __doc__ = """Integrated Metaomic Pipeline.
(____)(_/\/\_)(__)
Usage:
IMP [-m MG1 -m MG2] [-t MT1 -t MT2] -o OUTPUT [--enter] [--norm] [-r REPO] [-n CONTAINER] [-v VERSION] [-c CONFIGFILE] [-d DBPATH] [-a ASSEMBLER] [-e ENV] ... [COMMANDS ...]
IMP --init [-d DBPATH] [-n CONTAINER] [-v VERSION] [-r REPO]
IMP [-m MG1 -m MG2] [-t MT1 -t MT2] -o OUTPUT [--enter] [--norm]
[--current]
[-r REPO] [-n CONTAINER] [-v VERSION] [-c CONFIGFILE] [-d DBPATH] [-a ASSEMBLER] [-e ENV] ... [COMMANDS ...]
IMP --init
[--current]
[-d DBPATH] [-n CONTAINER] [-v VERSION] [-r REPO]
IMP (-h | --help)
IMP --version
...
...
@@ -32,6 +32,7 @@ Options:
--init Initialize IMP databases (Take a while).
--norm Don
'
t delete the container after use. Useful for debugging.
--ask Ask to create directory if it doesn
'
t exist.
--current Use the current version of the IMP codebase (what you have pulled).
-c CONFIG Pass a user defined config file. Default: conf/userconfig.imp.json
-h --help Show this help and exit
-m MG Path to the metagenomics paired files (must be 2 files).
...
...
@@ -54,6 +55,8 @@ Typical use:
./IMP --init -d /path/to/databases_directory
./IMP -m input/mg.r1.fq -m input/mg.r2.fq -t input/mt.r1.fq -t input/mt.r2.fq -o output_directory -d /path/to/databases_directory
# use the IMP code you have pulled instead of the one shipped inside the container.
./IMP -m input/mg.r1.fq -m input/mg.r2.fq -t input/mt.r1.fq -t input/mt.r2.fq -o output_directory --current
"""
.
format
(
name
=
IMP_IMAGE_NAME
,
...
...
@@ -140,16 +143,22 @@ def init(args):
Must be run at least once.
"""
CURRENT_PATH
=
Path
(
__file__
).
parent
.
abspath
()
version
=
args
[
'
-v
'
]
container_name
=
args
[
'
-n
'
]
database_path
=
Path
(
args
[
'
-d
'
]).
abspath
()
docker_cmd
=
'
docker run --rm -v {p}:/code -v {d}:/databases {n}:{v}
'
.
format
(
p
=
CURRENT_PATH
,
d
=
database_path
,
n
=
args
[
'
-n
'
],
v
=
args
[
'
-v
'
]
)
# prepare docker command
docker_cmd
=
'
docker run --rm -v {d}:/databases {n}:{v}
'
formatting_args
=
{
'
d
'
:
database_path
,
'
n
'
:
args
[
'
-n
'
],
'
v
'
:
args
[
'
-v
'
]
}
# override docker command if the user want to mount a specific version of IMP codebase.
if
args
[
--
'
current
'
]:
formatting_args
[
'
p
'
]
=
CURRENT_PATH
docker_cmd
=
'
docker run --rm -v {p}:/code -v {d}:/databases {n}:{v}
'
# format docker command
docker_cmd
.
format
(
**
formatting_args
)
# IMP command + user mapping (see https://github.com/docker/docker/pull/12648)
cmd
=
docker_cmd
+
map_user
(
'
snakemake -s /code/rules/init
'
,
'
/databases
'
)
print
(
"
Executing
"
,
'"'
,
cmd
,
'"'
)
subprocess
.
call
(
cmd
,
shell
=
True
)
...
...
@@ -183,12 +192,14 @@ def run(args):
# configure IMP mount point to the docker container
mount_points
=
[
'
-v %s:/data
'
%
common_path
,
'
-v %s:/code
'
%
CURRENT_PATH
,
'
-v %s:/output
'
%
output
,
'
-v %s:/databases
'
%
database_path
,
]
# add code mount point if the user want to mount a specific version of IMP codebase.
if
args
[
--
'
current
'
]:
mount_points
.
append
(
'
-v %s:/code
'
%
CURRENT_PATH
)
# environ
e
ment variables: add MG and MT data and config if specified
# environment variables: add MG and MT data and config if specified
envs
=
[
'
-e {}=
"
{}
"'
.
format
(
*
e
.
split
(
'
=
'
))
for
e
in
args
[
'
-e
'
]]
# prepare MG and MT data
...
...
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