- if(Q.size() > 1 && (i+1) != data.end() && Q.back().chr == (i+1)->chr) {
- cout << Q.back().chr << " " << Q.back().pos << " " << (i+1)->pos << " " << Q.size() / (double)(n_aligned_reads/1000000.0) << endl;
+void print_data(Ends::iterator i, Ends::iterator end, double Z) {
+ EndPoint begin_mark("start",0,0);
+ EndPoint prev = begin_mark;
+ int count = 0;
+ do {
+
+ //ok, first look at the next endpoint, and output the end of the corrent window.
+ i++;
+ if(i->chr != prev.chr)
+ count = 0;
+
+ // Using a very low noise threshold to help make for sane file sizes. Can override if need to see everything
+ // but for large datasets, no threshold can easily produce gigabyte sized files. This threshold drops the file
+ // size to about 1/8th the original size(of course, depending on the dataset).
+ else if(count > 2)
+ cout << prev.chr << "\t" << prev.pos << "\t" << i->pos << "\t" << count / Z << endl;
+
+ //now, count the new endpoint, and reset the prev marker
+ if(i->type == 0) { count++; } else { count--; }
+ prev = *i;
+
+ //finally, mark the current point, and while new points are the same position, keep adding them
+ while(i+1 != end && ((Loci)(*(i+1)) == (Loci)prev)) {
+ i++;
+ if(i->type == 0) { count++; } else { count--; }