From eca96e7d9afc8de4c8ca67cb327576e13974c43d Mon Sep 17 00:00:00 2001 From: gkarthik Date: Fri, 6 Nov 2020 12:20:19 -0800 Subject: [PATCH] Updated version number --- configure.ac | 2 +- src/ivar.cpp | 12 +++---- tests/test_amplicon_search.cpp | 64 +++++++++++++++++----------------- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/configure.ac b/configure.ac index 38aaf1e7..ad994ac1 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) -AC_INIT([ivar], [1.2.5], [gkarthik@scripps.edu]) +AC_INIT([ivar], [1.3], [gkarthik@scripps.edu]) AM_INIT_AUTOMAKE([foreign subdir-objects]) AC_CONFIG_HEADERS([config.h]) diff --git a/src/ivar.cpp b/src/ivar.cpp index a3217ef2..3fbe9412 100755 --- a/src/ivar.cpp +++ b/src/ivar.cpp @@ -16,7 +16,7 @@ #include "suffix_tree.h" #include "get_common_variants.h" -const std::string VERSION = "1.2.5"; +const std::string VERSION = "1.3"; struct args_t { std::string bam; // -i @@ -201,7 +201,7 @@ int main(int argc, char* argv[]){ if(i != argc-1) cl_cmd << " "; } - cl_cmd << "\n\0"; + cl_cmd << "\n\0"; std::string cmd(argv[1]); if(cmd.compare("-v") == 0){ print_version_info(); @@ -212,7 +212,7 @@ int main(int argc, char* argv[]){ argv[1] = argv[0]; argv++; argc--; - // ivar trim + // ivar trim if (cmd.compare("trim") == 0){ g_args.min_qual = 20; g_args.sliding_window = 4; @@ -265,7 +265,7 @@ int main(int argc, char* argv[]){ } g_args.prefix = get_filename_without_extension(g_args.prefix,".bam"); res = trim_bam_qual_primer(g_args.bam, g_args.bed, g_args.prefix, g_args.region, g_args.min_qual, g_args.sliding_window, cl_cmd.str(), g_args.write_no_primers_flag, g_args.keep_for_reanalysis, g_args.min_length, g_args.primer_pair_file); - } + } // ivar variants else if (cmd.compare("variants") == 0){ g_args.min_qual = 20; @@ -323,7 +323,7 @@ int main(int argc, char* argv[]){ return -1; } res = call_variants_from_plup(std::cin, g_args.prefix, g_args.min_qual, g_args.min_threshold, g_args.min_depth, g_args.ref, g_args.gff); - } + } // ivar consensus else if (cmd.compare("consensus") == 0){ opt = getopt( argc, argv, consensus_opt_str); @@ -494,7 +494,7 @@ int main(int argc, char* argv[]){ break; case 'f': g_args.primer_pair_file = optarg; - break; + break; case 'p': g_args.prefix = optarg; break; diff --git a/tests/test_amplicon_search.cpp b/tests/test_amplicon_search.cpp index 380b94a5..5bd705a6 100755 --- a/tests/test_amplicon_search.cpp +++ b/tests/test_amplicon_search.cpp @@ -7,41 +7,41 @@ int test_amplicon_search(std::string bam_file, std::string bed_file, std::string pair_info_file, bool expected[]) { - std::vector primers; - IntervalTree amplicons; - primers = populate_from_file(bed_file); - std::cout << "Total Number of primers: " << primers.size() << std::endl; - amplicons = populate_amplicons(pair_info_file, primers); - samFile *in = hts_open(bam_file.c_str(), "r"); - sam_hdr_t *hdr = sam_hdr_read(in); - bam1_t *aln = bam_init1(); - int cnt = 0; - int res = 0; - while(sam_read1(in, hdr, aln) >= 0) { - res = amplicon_filter(amplicons, aln); - if(res != expected[cnt]){ - std::cout << "Amplicon filter output did not match " << bam_get_qname(aln) << " Expected " << expected[cnt] << " " - << "Got " << res << std::endl; - std::cout << "Read intervals: " << aln->core.pos << ":" << bam_endpos(aln) << std::endl; - return -1; - } - cnt++; + std::vector primers; + IntervalTree amplicons; + primers = populate_from_file(bed_file); + std::cout << "Total Number of primers: " << primers.size() << std::endl; + amplicons = populate_amplicons(pair_info_file, primers); + samFile *in = hts_open(bam_file.c_str(), "r"); + sam_hdr_t *hdr = sam_hdr_read(in); + bam1_t *aln = bam_init1(); + int cnt = 0; + int res = 0; + while(sam_read1(in, hdr, aln) >= 0) { + res = amplicon_filter(amplicons, aln); + if(res != expected[cnt]){ + std::cout << "Amplicon filter output did not match " << bam_get_qname(aln) << " Expected " << expected[cnt] << " " + << "Got " << res << std::endl; + std::cout << "Read intervals: " << aln->core.pos << ":" << bam_endpos(aln) << std::endl; + return -1; } - return 0; + cnt++; + } + return 0; } int main(){ - int success; - std::string bam = "../data/test_amplicon.sorted.bam"; - std::string pair_indice = "../data/pair_info_2.tsv"; - std::string bed = "../data/test_isize.bed"; - std::string prefix = "/tmp/data/trim_amplicon"; - std::string bam_out = "/tmp/trim_amplicon.bam"; + int success; + std::string bam = "../data/test_amplicon.sorted.bam"; + std::string pair_indice = "../data/pair_info_2.tsv"; + std::string bed = "../data/test_isize.bed"; + std::string prefix = "/tmp/data/trim_amplicon"; + std::string bam_out = "/tmp/trim_amplicon.bam"; - IntervalTree amplicons; - bool expected[8] = {true, false, true, false, true, false, true, false}; - success = test_amplicon_search(bam, bed, pair_indice, expected); - amplicons.inOrder(); - return success; -} \ No newline at end of file + IntervalTree amplicons; + bool expected[8] = {true, false, true, false, true, false, true, false}; + success = test_amplicon_search(bam, bed, pair_indice, expected); + amplicons.inOrder(); + return success; +}