Skip to content

Commit

Permalink
Updated version number
Browse files Browse the repository at this point in the history
  • Loading branch information
gkarthik committed Nov 6, 2020
1 parent 74339f6 commit eca96e7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.63])
AC_INIT([ivar], [1.2.5], [[email protected]])
AC_INIT([ivar], [1.3], [[email protected]])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_CONFIG_HEADERS([config.h])

Expand Down
12 changes: 6 additions & 6 deletions src/ivar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
64 changes: 32 additions & 32 deletions tests/test_amplicon_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<primer> 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<primer> 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;
}
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;
}

0 comments on commit eca96e7

Please sign in to comment.