Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProMod3
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor 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
schwede
ProMod3
Commits
c49c60a9
Commit
c49c60a9
authored
9 years ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
Simplifying handling fasta
parent
46805eb0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/pymod/core/pm3argparse.py
+6
-5
6 additions, 5 deletions
core/pymod/core/pm3argparse.py
core/tests/test_pm3argparse.py
+6
-6
6 additions, 6 deletions
core/tests/test_pm3argparse.py
with
12 additions
and
11 deletions
core/pymod/core/pm3argparse.py
+
6
−
5
View file @
c49c60a9
...
@@ -229,6 +229,12 @@ class PM3OptionsNamespace(object):
...
@@ -229,6 +229,12 @@ class PM3OptionsNamespace(object):
helper
.
MsgErrorAndExit
(
"'
--fasta %s
'
requires
"
%
'
'
.
join
(
argstr
)
+
helper
.
MsgErrorAndExit
(
"'
--fasta %s
'
requires
"
%
'
'
.
join
(
argstr
)
+
"
one argument prefixed with
'
trg:
'
marking
"
+
"
one argument prefixed with
'
trg:
'
marking
"
+
"
the target sequence name
"
,
11
)
"
the target sequence name
"
,
11
)
# check that 'trg:' has a string attached
if
not
len
(
trgname
):
helper
.
MsgErrorAndExit
(
"'
--fasta %s
'
requires
"
%
'
'
.
join
(
argstr
)
+
"
argument
'
trg:
'
defining the
"
+
"
target sequence name, empty one
"
+
"
found:
'
%s
'"
%
'
'
.
join
(
argstr
),
14
)
return
trgname
,
seqfile
return
trgname
,
seqfile
def
_PostProcessAlignment
(
self
):
def
_PostProcessAlignment
(
self
):
...
@@ -242,11 +248,6 @@ class PM3OptionsNamespace(object):
...
@@ -242,11 +248,6 @@ class PM3OptionsNamespace(object):
if
self
.
fasta
:
if
self
.
fasta
:
for
src
in
self
.
fasta
:
for
src
in
self
.
fasta
:
trgname
,
seqfile
=
self
.
_FetchAlnFromFastaOpt
(
src
)
trgname
,
seqfile
=
self
.
_FetchAlnFromFastaOpt
(
src
)
if
not
len
(
trgname
):
helper
.
MsgErrorAndExit
(
"'
--fasta
'
requires argument
"
+
"'
trg:
'
defining the
"
+
"
target sequence name, empty one
"
+
"
found:
'
%s
'"
%
'
'
.
join
(
src
),
14
)
helper
.
FileExists
(
"
Alignment
"
,
12
,
seqfile
)
helper
.
FileExists
(
"
Alignment
"
,
12
,
seqfile
)
is_gz
=
helper
.
FileGzip
(
"
Alignment
"
,
13
,
seqfile
)
is_gz
=
helper
.
FileGzip
(
"
Alignment
"
,
13
,
seqfile
)
readfile
=
seqfile
readfile
=
seqfile
...
...
This diff is collapsed.
Click to expand it.
core/tests/test_pm3argparse.py
+
6
−
6
View file @
c49c60a9
...
@@ -100,9 +100,9 @@ class PM3ArgParseTests(unittest.TestCase):
...
@@ -100,9 +100,9 @@ class PM3ArgParseTests(unittest.TestCase):
with
self
.
assertRaises
(
SystemExit
)
as
ecd
:
with
self
.
assertRaises
(
SystemExit
)
as
ecd
:
parser
.
Parse
([
'
--fasta
'
,
'
trg:
'
,
'
bar
'
])
parser
.
Parse
([
'
--fasta
'
,
'
trg:
'
,
'
bar
'
])
self
.
assertEqual
(
ecd
.
exception
.
code
,
14
)
self
.
assertEqual
(
ecd
.
exception
.
code
,
14
)
self
.
assertEqual
(
self
.
log
.
messages
[
'
ERROR
'
][
0
],
"'
--fasta
'
requires
"
+
self
.
assertEqual
(
self
.
log
.
messages
[
'
ERROR
'
][
0
],
"'
--fasta
trg: bar
'
"
+
"
argument
'
trg:
'
defining the target
sequence name,
"
+
"
requires
argument
'
trg:
'
defining the target
"
+
"
empty one found:
'
trg: bar
'"
)
"
sequence name,
empty one found:
'
trg: bar
'"
)
def
testAddAlignemntSwapTrgPfx
(
self
):
def
testAddAlignemntSwapTrgPfx
(
self
):
# checking that we fail on empty 'trg:' prefix for arguments of
# checking that we fail on empty 'trg:' prefix for arguments of
...
@@ -113,9 +113,9 @@ class PM3ArgParseTests(unittest.TestCase):
...
@@ -113,9 +113,9 @@ class PM3ArgParseTests(unittest.TestCase):
with
self
.
assertRaises
(
SystemExit
)
as
ecd
:
with
self
.
assertRaises
(
SystemExit
)
as
ecd
:
parser
.
Parse
([
'
--fasta
'
,
'
bar
'
,
'
trg:
'
])
parser
.
Parse
([
'
--fasta
'
,
'
bar
'
,
'
trg:
'
])
self
.
assertEqual
(
ecd
.
exception
.
code
,
14
)
self
.
assertEqual
(
ecd
.
exception
.
code
,
14
)
self
.
assertEqual
(
self
.
log
.
messages
[
'
ERROR
'
][
0
],
"'
--fasta
'
requires
"
+
self
.
assertEqual
(
self
.
log
.
messages
[
'
ERROR
'
][
0
],
"'
--fasta
bar trg:
'
"
+
"
argument
'
trg:
'
defining the target
sequence name,
"
+
"
requires
argument
'
trg:
'
defining the target
"
+
"
empty one found:
'
bar trg:
'"
)
"
sequence name,
empty one found:
'
bar trg:
'"
)
def
testAddAlignmentNoFile
(
self
):
def
testAddAlignmentNoFile
(
self
):
# check that we throw an error if a non-exisiting file is given
# check that we throw an error if a non-exisiting file is given
...
...
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