Added code to identify snps and update the gneome accordingly. This code has an insid...
[htsworkflow.git] / htswanalysis / src / GetReadsInSnps / chrom_list.cpp
1 #include <iostream>
2 #include <fstream>
3 #include <string>
4 #include <vector>
5
6 #include "chrom_list.h"
7 #include "util.h"
8
9 using namespace std;
10
11 ChromList::ChromList(char* filename) {
12   char buffer[1024]; string delim("\t");
13   ifstream chrom_file(filename);
14   while(chrom_file.getline(buffer, 1024)) {
15     string temp(buffer); 
16     vector<string> words;
17     split(temp, delim,words);
18     if(words.size() != 2) { cerr << "Error in chrom list." << endl; exit(1); }
19     (*this)[ words[0] ] = words[1]; 
20   }
21   chrom_file.close();
22 }