6 #include "primer_bed.h" 8 int get_primer_indice(std::vector<primer> p,
unsigned int pos){
9 for(std::vector<primer>::iterator it = p.begin(); it != p.end(); ++it) {
10 if(it->get_start() <= pos && it->get_end() >= pos){
11 return it - p.begin();
17 int get_primers_with_mismatches(std::string bed, std::string vpath){
18 std::vector<primer> primers = populate_from_file(bed);
19 std::vector<unsigned int> indices;
20 std::string line, cell;
21 std::ifstream fin(vpath);
22 unsigned int ctr, pos;
24 std::stringstream line_stream;
25 while (std::getline(fin, line)){
29 while(std::getline(line_stream,cell,
'\t')){
44 ind = get_primer_indice(primers, pos);
45 if(std::find(indices.begin(), indices.end(), ind) == indices.end() && ind != -1){
46 indices.push_back(ind);
50 for(std::vector<unsigned int>::iterator it = indices.begin(); it != indices.end(); ++it) {
52 if(it != indices.end() - 1)
55 std::cout << std::endl;