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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amandine PERRIN
panacota
Commits
4678f364
Commit
4678f364
authored
4 years ago
by
Amandine PERRIN
Browse files
Options
Downloads
Patches
Plain Diff
adapt func test corepers to return corepersfile
parent
7338b5c9
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
PanACoTA/subcommands/corepers.py
+1
-0
1 addition, 0 deletions
PanACoTA/subcommands/corepers.py
test/test_functional/test_corepers.py
+13
-11
13 additions, 11 deletions
test/test_functional/test_corepers.py
with
14 additions
and
11 deletions
PanACoTA/subcommands/corepers.py
+
1
−
0
View file @
4678f364
...
...
@@ -144,6 +144,7 @@ def main(cmd, pangenome, tol, multi, mixed, outputdir, floor=False, verbose=0, q
# Write persistent genome to file
pers
.
write_persistent
(
fams
,
outputfile
)
logger
.
info
(
"
Persistent genome step done.
"
)
return
outputfile
def
get_info
(
tol
,
multi
,
mixed
,
floor
):
...
...
This diff is collapsed.
Click to expand it.
test/test_functional/test_corepers.py
+
13
−
11
View file @
4678f364
...
...
@@ -52,11 +52,11 @@ def test_main_default(capsys):
multi
=
False
mixed
=
False
cmd
=
"
cmd
"
corepers
.
main
(
cmd
,
UPAN
,
tol
,
multi
,
mixed
,
GENEPATH
)
out_pers
=
os
.
path
.
join
(
GENEPATH
,
"
PersGenome_pangenome.lst_1.lst
"
)
assert
corepers
.
main
(
cmd
,
UPAN
,
tol
,
multi
,
mixed
,
GENEPATH
)
==
out_pers
# Check creation of binary file for pangenome, and remove it
assert
os
.
path
.
isfile
(
UPAN
+
"
.bin
"
)
# Check presence of persistent genome, and its content, and remove it
out_pers
=
os
.
path
.
join
(
GENEPATH
,
"
PersGenome_pangenome.lst_1.lst
"
)
exp_pers
=
os
.
path
.
join
(
EXP_PATH
,
"
exp_coregenome.txt
"
)
assert
os
.
path
.
isfile
(
out_pers
)
assert
tutil
.
compare_order_content
(
out_pers
,
exp_pers
)
...
...
@@ -81,11 +81,11 @@ def test_main_pers(capsys):
multi
=
False
mixed
=
False
cmd
=
"
cmd
"
corepers
.
main
(
cmd
,
UPAN
,
tol
,
multi
,
mixed
,
GENEPATH
)
out_pers
=
os
.
path
.
join
(
GENEPATH
,
"
PersGenome_pangenome.lst_0.99.lst
"
)
assert
corepers
.
main
(
cmd
,
UPAN
,
tol
,
multi
,
mixed
,
GENEPATH
)
==
out_pers
# Check creation of binary file for pangenome, and remove it
assert
os
.
path
.
isfile
(
UPAN
+
"
.bin
"
)
# Check presence of persistent genome, and its content, and remove it
out_pers
=
os
.
path
.
join
(
GENEPATH
,
"
PersGenome_pangenome.lst_0.99.lst
"
)
exp_pers
=
os
.
path
.
join
(
EXP_PATH
,
"
exp_coregenome.txt
"
)
assert
os
.
path
.
isfile
(
out_pers
)
assert
tutil
.
compare_order_content
(
out_pers
,
exp_pers
)
...
...
@@ -117,11 +117,12 @@ def test_main_pers_floor_verbose2(capsys):
floor
=
True
cmd
=
"
cmd
"
floor
=
True
corepers
.
main
(
cmd
,
UPAN
,
tol
,
multi
,
mixed
,
GENEPATH
,
floor
=
floor
,
verbose
=
2
)
out_pers
=
os
.
path
.
join
(
GENEPATH
,
"
PersGenome_pangenome.lst_F0.99.lst
"
)
assert
corepers
.
main
(
cmd
,
UPAN
,
tol
,
multi
,
mixed
,
GENEPATH
,
floor
=
floor
,
verbose
=
2
)
==
out_pers
# Check creation of binary file for pangenome, and remove it
assert
os
.
path
.
isfile
(
UPAN
+
"
.bin
"
)
# Check presence of persistent genome, and its content, and remove it
out_pers
=
os
.
path
.
join
(
GENEPATH
,
"
PersGenome_pangenome.lst_F0.99.lst
"
)
exp_pers
=
os
.
path
.
join
(
EXP_PATH
,
"
exp_pers-floor-strict.txt
"
)
assert
os
.
path
.
isfile
(
out_pers
)
assert
tutil
.
compare_order_content
(
out_pers
,
exp_pers
)
...
...
@@ -153,11 +154,12 @@ def test_main_pers_floor_mixed_debug(capsys):
mixed
=
True
floor
=
True
cmd
=
"
cmd
"
corepers
.
main
(
cmd
,
UPAN
,
tol
,
multi
,
mixed
,
GENEPATH
,
floor
=
floor
,
verbose
=
15
)
out_pers
=
os
.
path
.
join
(
GENEPATH
,
"
PersGenome_pangenome.lst_F0.99-mixed.lst
"
)
assert
corepers
.
main
(
cmd
,
UPAN
,
tol
,
multi
,
mixed
,
GENEPATH
,
floor
=
floor
,
verbose
=
15
)
==
out_pers
# Check creation of binary file for pangenome, and remove it
assert
os
.
path
.
isfile
(
UPAN
+
"
.bin
"
)
# Check presence of persistent genome, and its content, and remove it
out_pers
=
os
.
path
.
join
(
GENEPATH
,
"
PersGenome_pangenome.lst_F0.99-mixed.lst
"
)
exp_pers
=
os
.
path
.
join
(
EXP_PATH
,
"
exp_pers-floor-mixed.txt
"
)
assert
os
.
path
.
isfile
(
out_pers
)
assert
tutil
.
compare_order_content
(
out_pers
,
exp_pers
)
...
...
@@ -191,11 +193,11 @@ def test_main_pers_floor_multi(capsys):
floor
=
True
cmd
=
"
cmd
"
outdir
=
os
.
path
.
join
(
GENEPATH
,
"
outdir
"
)
corepers
.
main
(
cmd
,
UPAN
,
tol
,
multi
,
mixed
,
outdir
,
floor
=
floor
)
out_pers
=
os
.
path
.
join
(
outdir
,
"
PersGenome_pangenome.lst_F0.99-multi.lst
"
)
assert
corepers
.
main
(
cmd
,
UPAN
,
tol
,
multi
,
mixed
,
outdir
,
floor
=
floor
)
==
out_pers
# Check creation of binary file for pangenome, and remove it
assert
os
.
path
.
isfile
(
UPAN
+
"
.bin
"
)
# Check presence of persistent genome, and its content, and remove it
out_pers
=
os
.
path
.
join
(
outdir
,
"
PersGenome_pangenome.lst_F0.99-multi.lst
"
)
exp_pers
=
os
.
path
.
join
(
EXP_PATH
,
"
exp_pers-floor-multi.txt
"
)
assert
os
.
path
.
isfile
(
out_pers
)
assert
tutil
.
compare_order_content
(
out_pers
,
exp_pers
)
...
...
@@ -237,9 +239,9 @@ def test_main_from_parse(capsys):
corepers
.
main_from_parse
(
args
)
# Check creation of binary file for pangenome, and remove it
out_pers
=
os
.
path
.
join
(
GENEPATH
,
"
PersGenome_pangenome.lst_1.lst
"
)
assert
os
.
path
.
isfile
(
UPAN
+
"
.bin
"
)
# Check presence of persistent genome, and its content, and remove it
out_pers
=
os
.
path
.
join
(
GENEPATH
,
"
PersGenome_pangenome.lst_1.lst
"
)
exp_pers
=
os
.
path
.
join
(
EXP_PATH
,
"
exp_coregenome.txt
"
)
assert
os
.
path
.
isfile
(
out_pers
)
assert
tutil
.
compare_order_content
(
out_pers
,
exp_pers
)
...
...
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