Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
panacota
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amandine PERRIN
panacota
Commits
0e33e554
Commit
0e33e554
authored
4 years ago
by
Amandine PERRIN
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for format prokka prt file creation
parent
30e066ee
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/data/annotate/exp_files/res_create_prt_prokka.faa
+2
-0
2 additions, 0 deletions
test/data/annotate/exp_files/res_create_prt_prokka.faa
test/test_unit/test_annotate/test_format_prokka.py
+53
-53
53 additions, 53 deletions
test/test_unit/test_annotate/test_format_prokka.py
with
55 additions
and
53 deletions
test/data/annotate/exp_files/res_create_prt_prokka.faa
+
2
−
0
View file @
0e33e554
...
@@ -25,6 +25,8 @@ CGCTCGCGCA
...
@@ -25,6 +25,8 @@ CGCTCGCGCA
CCTATAGGAACCACCGGGG
CCTATAGGAACCACCGGGG
>test.0417.00002.0004b_00014 3354 NA | hypothetical protein | NA | NA | 12345
>test.0417.00002.0004b_00014 3354 NA | hypothetical protein | NA | NA | 12345
CAGGATAGCGCGCTCAGAG
CAGGATAGCGCGCTCAGAG
>test.0417.00002.0004b_00016 44128 NA | hypothetical protein | NA | similar to AA sequence:UniProtKB:P32 | 56
CCGAGGTGCGAGGTGTGTTGTGTGCG
>test.0417.00002.0007i_03015 1638 NA | hypothetical protein | NA | NA | NA
>test.0417.00002.0007i_03015 1638 NA | hypothetical protein | NA | NA | NA
AGATCCGCGCGCTATAGAGC
AGATCCGCGCGCTATAGAGC
>test.0417.00002.0007i_03016 1761 NA | hypothetical protein | NA | NA | NA
>test.0417.00002.0007i_03016 1761 NA | hypothetical protein | NA | NA | NA
...
...
This diff is collapsed.
Click to expand it.
test/test_unit/test_annotate/test_format_prokka.py
+
53
−
53
View file @
0e33e554
...
@@ -383,65 +383,65 @@ def test_create_gen_missing_lastSeq(caplog):
...
@@ -383,65 +383,65 @@ def test_create_gen_missing_lastSeq(caplog):
assert
tutil
.
compare_order_content
(
exp_gen
,
res_gen_file
)
assert
tutil
.
compare_order_content
(
exp_gen
,
res_gen_file
)
#
def test_create_prt(caplog):
def
test_create_prt
(
caplog
):
#
"""
"""
#
Check that prt file is generated as expected
Check that prt file is generated as expected
#
"""
"""
#
caplog.set_level(logging.DEBUG)
caplog
.
set_level
(
logging
.
DEBUG
)
#
protfile = os.path.join(TEST_ANNOTE, "original_name.fna-prokkaRes",
protfile
=
os
.
path
.
join
(
TEST_ANNOTE
,
"
original_name.fna-prokkaRes
"
,
#
"prokka_out_for_test.faa")
"
prokka_out_for_test.faa
"
)
#
res_prt_file = os.path.join(GENEPATH, "prokka_res.prt")
res_prt_file
=
os
.
path
.
join
(
GENEPATH
,
"
prokka_res.prt
"
)
#
lstfile = os.path.join(EXP_ANNOTE, "res_create_lst-prokka.lst")
lstfile
=
os
.
path
.
join
(
EXP_ANNOTE
,
"
res_create_lst-prokka.lst
"
)
#
exp_lst = os.path.join(EXP_ANNOTE, "res_create_gene_lst_prodigal.lst")
exp_lst
=
os
.
path
.
join
(
EXP_ANNOTE
,
"
res_create_gene_lst_prodigal.lst
"
)
#
assert prokkafunc.create_prt(protfile, lstfile, res_prt_file)
assert
prokkafunc
.
create_prt
(
protfile
,
lstfile
,
res_prt_file
)
#
exp_prt = os.path.join(EXP_ANNOTE, "res_create_prt_prokka.faa")
exp_prt
=
os
.
path
.
join
(
EXP_ANNOTE
,
"
res_create_prt_prokka.faa
"
)
#
assert tutil.compare_order_content(exp_prt, res_prt_file)
assert
tutil
.
compare_order_content
(
exp_prt
,
res_prt_file
)
#
def test_create_prt_wrong_header_int(caplog):
def
test_create_prt_wrong_header_int
(
caplog
):
#
"""
"""
#
Test creating prt file, but the faa file has a header with wrong format (>JGIKIPIJ_d0008)
Test creating prt file, but the faa file has a header with wrong format (>JGIKIPIJ_d0008)
#
"""
"""
#
caplog.set_level(logging.DEBUG)
caplog
.
set_level
(
logging
.
DEBUG
)
#
protfile = os.path.join(TEST_ANNOTE, "prokka_out_for_test-wrongHeaderInt.faa")
protfile
=
os
.
path
.
join
(
TEST_ANNOTE
,
"
prokka_out_for_test-wrongHeaderInt.faa
"
)
#
res_prt_file = os.path.join(GENEPATH, "prokka_res.prt")
res_prt_file
=
os
.
path
.
join
(
GENEPATH
,
"
prokka_res.prt
"
)
#
lstfile = os.path.join(EXP_ANNOTE, "res_create_lst-prokka.lst")
lstfile
=
os
.
path
.
join
(
EXP_ANNOTE
,
"
res_create_lst-prokka.lst
"
)
#
exp_lst = os.path.join(EXP_ANNOTE, "res_create_gene_lst_prodigal.lst")
exp_lst
=
os
.
path
.
join
(
EXP_ANNOTE
,
"
res_create_gene_lst_prodigal.lst
"
)
#
assert not prokkafunc.create_prt(protfile, lstfile, res_prt_file)
assert
not
prokkafunc
.
create_prt
(
protfile
,
lstfile
,
res_prt_file
)
#
assert ("Unknown header format >JGIKIPIJ_d0008 in test/data/annotate/test_files/"
assert
(
"
Unknown header format >JGIKIPIJ_d0008 in test/data/annotate/test_files/
"
#
"prokka_out_for_test-wrongHeaderInt.faa. Gene ID is not a number.") in caplog.text
"
prokka_out_for_test-wrongHeaderInt.faa. Gene ID is not a number.
"
)
in
caplog
.
text
#
def test_create_prt_wrong_header_sep(caplog):
def
test_create_prt_wrong_header_sep
(
caplog
):
#
"""
"""
#
Test creating prt file, but the faa file has a header with wrong format,
Test creating prt file, but the faa file has a header with wrong format,
#
no '_' between name and gene ID (>JGIKIPIJ00008)
no
'
_
'
between name and gene ID (>JGIKIPIJ00008)
#
"""
"""
#
caplog.set_level(logging.DEBUG)
caplog
.
set_level
(
logging
.
DEBUG
)
#
protfile = os.path.join(TEST_ANNOTE, "prokka_out_for_test-wrongHeaderSep.faa")
protfile
=
os
.
path
.
join
(
TEST_ANNOTE
,
"
prokka_out_for_test-wrongHeaderSep.faa
"
)
#
res_prt_file = os.path.join(GENEPATH, "prokka_res.prt")
res_prt_file
=
os
.
path
.
join
(
GENEPATH
,
"
prokka_res.prt
"
)
#
lstfile = os.path.join(EXP_ANNOTE, "res_create_lst-prokka.lst")
lstfile
=
os
.
path
.
join
(
EXP_ANNOTE
,
"
res_create_lst-prokka.lst
"
)
#
exp_lst = os.path.join(EXP_ANNOTE, "res_create_gene_lst_prodigal.lst")
exp_lst
=
os
.
path
.
join
(
EXP_ANNOTE
,
"
res_create_gene_lst_prodigal.lst
"
)
#
assert not prokkafunc.create_prt(protfile, lstfile, res_prt_file)
assert
not
prokkafunc
.
create_prt
(
protfile
,
lstfile
,
res_prt_file
)
#
assert ("Unknown header format >JGIKIPIJ00008 in test/data/annotate/test_files/"
assert
(
"
Unknown header format >JGIKIPIJ00008 in test/data/annotate/test_files/
"
#
"prokka_out_for_test-wrongHeaderSep.faa. Gene ID is not a number.") in caplog.text
"
prokka_out_for_test-wrongHeaderSep.faa. Gene ID is not a number.
"
)
in
caplog
.
text
#
def test_create_prt_wrong_unknown_prot(caplog):
def
test_create_prt_wrong_unknown_prot
(
caplog
):
#
"""
"""
#
Test creating prt file, but the faa file has a protein (>sup-prot_00012)
Test creating prt file, but the faa file has a protein (>sup-prot_00012)
#
which is not in the lst file
which is not in the lst file
#
"""
"""
#
caplog.set_level(logging.DEBUG)
caplog
.
set_level
(
logging
.
DEBUG
)
#
protfile = os.path.join(TEST_ANNOTE, "prokka_out_for_test-supHeader.faa")
protfile
=
os
.
path
.
join
(
TEST_ANNOTE
,
"
prokka_out_for_test-supHeader.faa
"
)
#
res_prt_file = os.path.join(GENEPATH, "prokka_res.prt")
res_prt_file
=
os
.
path
.
join
(
GENEPATH
,
"
prokka_res.prt
"
)
#
lstfile = os.path.join(EXP_ANNOTE, "res_create_lst-prokka.lst")
lstfile
=
os
.
path
.
join
(
EXP_ANNOTE
,
"
res_create_lst-prokka.lst
"
)
#
exp_lst = os.path.join(EXP_ANNOTE, "res_create_gene_lst_prodigal.lst")
exp_lst
=
os
.
path
.
join
(
EXP_ANNOTE
,
"
res_create_gene_lst_prodigal.lst
"
)
#
assert not prokkafunc.create_prt(protfile, lstfile, res_prt_file)
assert
not
prokkafunc
.
create_prt
(
protfile
,
lstfile
,
res_prt_file
)
#
assert ("Missing info for protein >sup-prot_00012 (from test/data/annotate/test_files/"
assert
(
"
Missing info for protein >sup-prot_00012 (from test/data/annotate/test_files/
"
#
"prokka_out_for_test-supHeader.faa) in test/data/annotate/exp_files/"
"
prokka_out_for_test-supHeader.faa) in test/data/annotate/exp_files/
"
#
"res_create_lst-prokka.lst. If it is actually present in the lst file, check that "
"
res_create_lst-prokka.lst. If it is actually present in the lst file, check that
"
#
"proteins are ordered by increasing number in both lst and faa files.") in caplog.text
"
proteins are ordered by increasing number in both lst and faa files.
"
)
in
caplog
.
text
# def test_format_1genome(caplog):
# def test_format_1genome(caplog):
...
...
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