Skip to content

Commit

Permalink
adding back test, fixing issue with trailing tab
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaceves committed Apr 11, 2022
1 parent ba09b79 commit 2b455d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/ref_seq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ int ref_antd::codon_aa_stream(std::string region, std::ostringstream &line_strea
//adding amino acid position
int64_t start = it->get_start();
int64_t aa_pos = ((pos - start) / 3)+1;
fout << aa_pos << "\t";
fout << aa_pos;
fout << std::endl;

delete[] ref_codon;
Expand Down
13 changes: 6 additions & 7 deletions tests/test_variants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,22 @@ int call_var_check_outfile(std::string prefix, uint8_t min_qual, uint8_t min_dep
int main() {
int num_success = 0;
// Quality threshold 20. Frequency threshold: 0.03. Total_DP = 3. Indel passes filters with total_depth 4. Has two lines.
std::string t_20_02_1[3] = {"test\t210\tA\tT\t1\t1\t41\t2\t1\t40\t0.666667\t3\t0.2\tFALSE\tgeneKatyPerry:id-test3\tAAG\tK\tATG\tM\t70", "test\t210\tA\tT\t1\t1\t41\t2\t1\t40\t0.666667\t3\t0.2\tFALSE\tid-testedit1\tGAA\tE\tGAT\tD\t70", "test\t210\tA\tT\t1\t1\t41\t2\t1\t40\t0.666667\t3\t0.2\tFALSE\tgeneTaylorSwift:id-testedit2\tAGA\tR\tTGA\t*\t70"};
//"test\t210\tA\t+GT\t1\t1\t41\t1\t0\t20\t0.25\t4\t0.4\tFALSE\tNA\tNA\tNA\tNA\tNA\tNA"};
std::string t_20_02_1[4] = {"test\t210\tA\tT\t1\t1\t41\t2\t1\t40\t0.666667\t3\t0.2\tFALSE\tgeneKatyPerry:id-test3\tAAG\tK\tATG\tM\t70", "test\t210\tA\tT\t1\t1\t41\t2\t1\t40\t0.666667\t3\t0.2\tFALSE\tid-testedit1\tGAA\tE\tGAT\tD\t70", "test\t210\tA\tT\t1\t1\t41\t2\t1\t40\t0.666667\t3\t0.2\tFALSE\tgeneTaylorSwift:id-testedit2\tAGA\tR\tTGA\t*\t70", "test\t210\tA\t+GT\t1\t1\t41\t1\t0\t20\t0.25\t4\t0.4\tFALSE\tNA\tNA\tNA\tNA\tNA\tNA"};
// Quality threshold 3-. Frequency threshold: 0.03. Total_DP = 3. Freq = 0.666667 No Indel
std::string t_20_03[3] = {"test\t210\tA\tT\t1\t1\t41\t2\t1\t40\t0.666667\t3\t0.2\tFALSE\tgeneKatyPerry:id-test3\tAAG\tK\tATG\tM\t70", "test\t210\tA\tT\t1\t1\t41\t2\t1\t40\t0.666667\t3\t0.2\tFALSE\tid-testedit1\tGAA\tE\tGAT\tD\t70", "test\t210\tA\tT\t1\t1\t41\t2\t1\t40\t0.666667\t3\t0.2\tFALSE\tgeneTaylorSwift:id-testedit2\tAGA\tR\tTGA\t*\t70"};
// Quality threshold 25. Frequency threshold: 0.03. Total_DP = 2. Freq = 0.5 No Indel.
std::string t_25_03[3] = {"test\t210\tA\tT\t1\t1\t41\t1\t1\t58\t0.5\t2\t0.4\tFALSE\tgeneKatyPerry:id-test3\tAAG\tK\tATG\tM\t70", "test\t210\tA\tT\t1\t1\t41\t1\t1\t58\t0.5\t2\t0.4\tFALSE\tid-testedit1\tGAA\tE\tGAT\tD\t70", "test\t210\tA\tT\t1\t1\t41\t1\t1\t58\t0.5\t2\t0.4\tFALSE\tgeneTaylorSwift:id-testedit2\tAGA\tR\tTGA\t*\t70"};
// Minimum depth threshold. Should be empty
std::string t_25_03_20[] = {};
num_success = call_var_check_outfile("../data/test.indel", 20, 0, 0.02, t_20_02_1, 3);
num_success = call_var_check_outfile("../data/test.indel", 20, 0, 0.02, t_20_02_1, 4);
std::cout << num_success << std::endl;
num_success += call_var_check_outfile("../data/test.indel", 20, 0, 0.03, t_20_03, 3);
num_success += call_var_check_outfile("../data/test.indel2", 20, 0, 0.03, t_20_03, 3);
std::cout << num_success << std::endl;
num_success += call_var_check_outfile("../data/test.indel", 25, 0, 0.03, t_25_03, 3);
num_success += call_var_check_outfile("../data/test.indel3", 25, 0, 0.03, t_25_03, 3);
std::cout << num_success << std::endl;
num_success += call_var_check_outfile("../data/test.indel", 25, 20, 0.03, t_25_03_20, 0);
num_success += call_var_check_outfile("../data/test.indel4", 25, 20, 0.03, t_25_03_20, 0);
std::cout << num_success << std::endl;
if(num_success == 9)
if(num_success == 0)
return 0;
return -1;
}

0 comments on commit 2b455d7

Please sign in to comment.