Skip to content
Snippets Groups Projects
Commit 0e33e554 authored by Amandine  PERRIN's avatar Amandine PERRIN
Browse files

Add tests for format prokka prt file creation

parent 30e066ee
No related branches found
No related tags found
No related merge requests found
...@@ -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
......
...@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment