| 96 | |
| 97 | |
| 98 | void MultiIntersectBed::PrintCoverage(CHRPOS start, CHRPOS end) { |
| 99 | if ( current_non_zero_inputs == 0 && ! print_empty_regions ) |
| 100 | return ; |
| 101 | |
| 102 | output << current_chrom << "\t" |
| 103 | << start << "\t" |
| 104 | << end << "\t" |
| 105 | << current_non_zero_inputs << "\t"; |
| 106 | |
| 107 | ostringstream file_list_string; |
| 108 | ostringstream file_bool_string; |
| 109 | int depth_count = 0; |
| 110 | for (size_t i = 0; i < current_depth.size(); ++i) |
| 111 | { |
| 112 | if (current_depth[i] > 0) { |
| 113 | if (depth_count < current_non_zero_inputs - 1) { |
| 114 | if (!haveTitles) |
| 115 | file_list_string << i+1 << ","; |
| 116 | else |
| 117 | file_list_string << titles[i] << ","; |
| 118 | } |
| 119 | else { |
| 120 | if (!haveTitles) |
| 121 | file_list_string << i+1; |
| 122 | else |
| 123 | file_list_string << titles[i]; |
| 124 | } |
| 125 | depth_count++; |
| 126 | } |
| 127 | file_bool_string << "\t" << current_depth[i]; |
| 128 | } |
| 129 | if (current_non_zero_inputs > 0) { |
| 130 | cout << file_list_string.str() << file_bool_string.str() << endl; |
| 131 | } |
| 132 | else { |
| 133 | cout << "none" << file_bool_string.str() << endl; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | |
| 138 | void MultiIntersectBed::PrintEmptyCoverage(CHRPOS start, CHRPOS end) { |