From eaad78a215bc3864ea692d18a96ff6598897249f Mon Sep 17 00:00:00 2001 From: Amandine PERRIN <amandine.perrin@pasteur.fr> Date: Mon, 5 Oct 2020 17:44:11 +0200 Subject: [PATCH] Adapt test for sup gene in ffn to cove all cases --- .../prokka_out_for_test-noLastSeq.ffn | 40 ------------------- .../prokka_out_for_test-supGene.ffn | 2 +- .../test_annotate/test_format_prokka.py | 17 +------- 3 files changed, 2 insertions(+), 57 deletions(-) delete mode 100755 test/data/annotate/test_files/prokka_out_for_test-noLastSeq.ffn diff --git a/test/data/annotate/test_files/prokka_out_for_test-noLastSeq.ffn b/test/data/annotate/test_files/prokka_out_for_test-noLastSeq.ffn deleted file mode 100755 index 73074dbe..00000000 --- a/test/data/annotate/test_files/prokka_out_for_test-noLastSeq.ffn +++ /dev/null @@ -1,40 +0,0 @@ ->JGIKIPIJ_00001 -aacgcgcatccagcgctagagacgctctcgacgagc -cagatctgca -cacaacaggtcgcgctcg ->JGIKIPIJ_00005 -cagagatgcccc -ccgcgttt ->JGIKIPIJ_00008 -aaccggcctcgcgcatcgcatcagcag ->JGIKIPIJ_00009 -acgctagagagctcgcgctaagagatc ->JGIKIPIJ_00010 -CCGAATAGCGCGCTCAGAGAGAGAGGA -CGATAGCTCTCGCA -CCGCATAGC ->JGIKIPIJ_00011 -AAGCTCGCTAGACNNCTCGATACNNCTCGGATAGC ->JGIKIPIJ_00011 -CAGATAGCNNCGCTAGAGGAGAGCTCTCGGAGA ->JGIKIPIJ_00011 -CCGAGATCGCGCGCGCTCTTCTCGAGA ->JGIKIPIJ_00013 -AGCTCTCGAGAGGAGCGCTCGA -CGCTCGCGCA -CCTATAGGAACCACCGGGG ->JGIKIPIJ_00014 -CAGGATAGCGCGCTCAGAG ->JGIKIPIJ_00016 -AAGGGATATGGCCACACAGTT ->CRISPR_toto -CCGAGGTGTGCG -CCGGTGTGCGCG ->PROKKA_02927 -CCAGAGATCGCGCGC ->PROKKA_02928 -AGATATGGCGCGCTCTCTC ->JGIKIPIJ_03015 -AGATCCGCGCGCTATAGAGC ->JGIKIPIJ_03016 -AAGGATCTCTCGCGAGAGGA diff --git a/test/data/annotate/test_files/prokka_out_for_test-supGene.ffn b/test/data/annotate/test_files/prokka_out_for_test-supGene.ffn index cea67ae8..1bc1222a 100755 --- a/test/data/annotate/test_files/prokka_out_for_test-supGene.ffn +++ b/test/data/annotate/test_files/prokka_out_for_test-supGene.ffn @@ -25,7 +25,7 @@ CGCTCGCGCA CCTATAGGAACCACCGGGG >JGIKIPIJ_00014 CAGGATAGCGCGCTCAGAG ->JGIKIPIJ_00015 +>JGIKIPIJ_03050 CAGGATAGCGCGCTCAGAG >JGIKIPIJ_00016 AAGGGATATGGCCACACAGTT diff --git a/test/test_unit/test_annotate/test_format_prokka.py b/test/test_unit/test_annotate/test_format_prokka.py index e0b8fefb..1d4c7b9f 100644 --- a/test/test_unit/test_annotate/test_format_prokka.py +++ b/test/test_unit/test_annotate/test_format_prokka.py @@ -350,7 +350,7 @@ def test_create_gen_supgen(caplog): lstfile = os.path.join(EXP_ANNOTE, "res_create_lst-prokka.lst") res_gen_file = os.path.join(GENEPATH, "prodigal_res.gen") assert not prokkafunc.create_gen(ffnfile, lstfile, res_gen_file) - assert ("Missing info for gene >JGIKIPIJ_00015 (from test/data/annotate/test_files/prokka_out_for_test-supGene.ffn) in test/data/annotate/exp_files/res_create_lst-prokka.lst. If it is actually present in the lst file, check that genes are ordered by increasing number in both lst and ffn files.") in caplog.text + assert ("Missing info for gene >JGIKIPIJ_03050 (from test/data/annotate/test_files/prokka_out_for_test-supGene.ffn) in test/data/annotate/exp_files/res_create_lst-prokka.lst. If it is actually present in the lst file, check that genes are ordered by increasing number in both lst and ffn files.") in caplog.text def test_create_gen_missingSeq(caplog): @@ -368,21 +368,6 @@ def test_create_gen_missingSeq(caplog): assert tutil.compare_order_content(exp_gen, res_gen_file) -def test_create_gen_missing_lastSeq(caplog): - """ - Check create gen file. The last gene in lst does not have a sequence in ffn. - Just skip it, and go to next sequence for gen file. - """ - caplog.set_level(logging.DEBUG) - logger = logging.getLogger("test_prodigal") - ffnfile = os.path.join(TEST_ANNOTE, "prokka_out_for_test-noLastSeq.ffn") - lstfile = os.path.join(EXP_ANNOTE, "res_create_lst-prokka.lst") - res_gen_file = os.path.join(GENEPATH, "prodigal_res.gen") - assert prokkafunc.create_gen(ffnfile, lstfile, res_gen_file) - exp_gen = os.path.join(EXP_ANNOTE, "res_create_gene_prokka-miss-lastGene.gen") - assert tutil.compare_order_content(exp_gen, res_gen_file) - - def test_create_prt(caplog): """ Check that prt file is generated as expected -- GitLab