Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KNOT
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
MARIJON Pierre
KNOT
Commits
ed5b112d
Commit
ed5b112d
authored
Jan 08, 2019
by
MARIJON Pierre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snakemake can manage mutual exclusion and use '--' to separate knot and snakemake parameter
parent
3cea3672
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
23 deletions
+10
-23
knot/__main__.py
knot/__main__.py
+10
-23
No files found.
knot/__main__.py
View file @
ed5b112d
...
...
@@ -22,17 +22,17 @@ def main(args = None):
parser
=
argparse
.
ArgumentParser
(
prog
=
"KNOT"
)
# # avaible
# # b e g i m o q u w x y z
# # A B C E G H I J K L M N Q V W X Y Z
parser
.
add_argument
(
"-C"
,
"--contigs"
,
required
=
True
,
parser
.
add_argument
(
"-c"
,
"--contigs"
,
required
=
True
,
help
=
"fasta file than contains contigs"
)
parser
.
add_argument
(
"-g"
,
"--contigs_graph"
,
help
=
"contigs graph"
)
parser
.
add_argument
(
"-i"
,
"--raw-reads"
,
help
=
"read used for assembly"
)
parser
.
add_argument
(
"-m"
,
"--correct
-reads"
,
group
=
parser
.
add_mutually_exclusive_group
(
required
=
True
)
group
.
add_argument
(
"-r"
,
"--raw
-reads"
,
help
=
"read used for assembly"
)
group
.
add_argument
(
"-C"
,
"--correct-reads"
,
help
=
"read used for assembly"
)
parser
.
add_argument
(
"-o"
,
"--output"
,
required
=
True
,
help
=
"output prefix"
)
parser
.
add_argument
(
"--contig-min-length"
,
default
=
100000
,
type
=
int
,
...
...
@@ -40,10 +40,10 @@ def main(args = None):
parser
.
add_argument
(
"--read-type"
,
choices
=
[
"pb"
,
"ont"
],
default
=
"pb"
,
help
=
"type of input read, default pb"
)
parser
.
add_argument
(
"--help-all"
,
action
=
'store_true'
,
help
=
"
S
how knot help and snakemake help"
)
help
=
"
s
how knot help and snakemake help"
)
args
,
unknow_arg
=
parser
.
parse_known_args
(
args
)
args
=
vars
(
args
)
# Check parameter
## raw_reads or correct
if
args
[
"help_all"
]:
...
...
@@ -51,19 +51,6 @@ def main(args = None):
snakemake_help
()
return
1
go_out
=
False
if
args
[
"raw_reads"
]
is
None
and
args
[
"correct_reads"
]
is
None
:
print
(
"You need set --raw-reads or --correct-reads
\n
"
,
file
=
sys
.
stderr
)
go_out
=
True
if
args
[
"raw_reads"
]
is
not
None
and
args
[
"correct_reads"
]
is
not
None
:
print
(
"You can't set --raw-reads and --correct-reads at same time
\n
"
,
file
=
sys
.
stderr
)
go_out
=
True
if
go_out
:
parser
.
print_help
()
return
1
## if contig graph isn't set generate empty file
if
args
[
"contigs_graph"
]
is
None
:
args
[
"contigs_graph"
]
=
tempfile
.
NamedTemporaryFile
(
delete
=
False
).
name
...
...
@@ -93,7 +80,7 @@ def main(args = None):
"--snakefile"
,
snakemake_rule
]
call
+=
unknow_arg
call
+=
unknow_arg
[
1
:]
print
(
" "
.
join
(
call
))
out
=
subprocess
.
call
(
call
)
...
...
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