string line_str(line);
vector<string> fields;
split(line_str, delim, fields);
- if(fields.size() == 3) { continue; }
+ if(fields.size() <= 3) { continue; }
vector<string> location; split(fields[3], location_delim, location);
string chr = location[0];
;
}
- for(unsigned int i = 0; i < profile.size(); i++) {
- cout << (int)i - (int)1000 << "\t" << (double)profile[i] / (double)data.size() << endl;;
+ if(data.size() == 0) {
+ for(unsigned int i = 0; i < profile.size(); i++) {
+ cout << (int)i - (int)1000 << "\t0\n";
+ }
+ } else {
+ for(unsigned int i = 0; i < profile.size(); i++) {
+ cout << (int)i - (int)1000 << "\t" << (double)profile[i] / (double)data.size() << endl;;
+ }
}
}