MCPcopy Create free account
hub / github.com/BirolLab/abyss / doReadIntegrity

Function doReadIntegrity

ParseAligns/ParseAligns.cpp:165–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165static void
166doReadIntegrity(const ReadAlignMap::value_type& a)
167{
168 AlignmentVector::const_iterator refAlignIter = a.second.begin();
169 unsigned firstStart, lastEnd, largestSize;
170 Alignment first, last, largest;
171
172 firstStart = refAlignIter->read_start_pos;
173 lastEnd = firstStart + refAlignIter->align_length;
174 largestSize = refAlignIter->align_length;
175 first = last = largest = *refAlignIter;
176 ++refAlignIter;
177
178 // for each alignment in the vector a.second
179 for (; refAlignIter != a.second.end(); ++refAlignIter) {
180 if ((unsigned)refAlignIter->read_start_pos < firstStart) {
181 firstStart = refAlignIter->read_start_pos;
182 first = *refAlignIter;
183 }
184 if ((unsigned)(refAlignIter->read_start_pos + refAlignIter->align_length) > lastEnd) {
185 lastEnd = refAlignIter->read_start_pos + refAlignIter->align_length;
186 last = *refAlignIter;
187 }
188 if ((unsigned)refAlignIter->align_length > largestSize) {
189 largestSize = refAlignIter->align_length;
190 largest = *refAlignIter;
191 }
192 }
193
194 if (largest.contig != last.contig) {
195 Estimate est;
196 unsigned largest_end = largest.read_start_pos + largest.align_length - opt::k;
197 int distance = last.read_start_pos - largest_end;
198 est.first = find_vertex(last.contig, largest.isRC != last.isRC, g_contigNames);
199 est.second.distance = distance - opt::k;
200 est.second.numPairs = 1;
201 est.second.stdDev = 0;
202 addEstimate(estMap, largest, est, false);
203 }
204
205 if (largest.contig != first.contig && largest.contig != last.contig) {
206 Estimate est;
207 unsigned first_end = first.read_start_pos + first.align_length - opt::k;
208 int distance = last.read_start_pos - first_end;
209 est.first = find_vertex(last.contig, first.isRC != last.isRC, g_contigNames);
210 est.second.distance = distance - opt::k;
211 est.second.numPairs = 1;
212 est.second.stdDev = 0;
213 addEstimate(estMap, first, est, false);
214 }
215
216 if (largest.contig != first.contig) {
217 largest.flipQuery();
218 first.flipQuery();
219 Estimate est;
220 unsigned largest_end = largest.read_start_pos + largest.align_length - opt::k;
221 int distance = first.read_start_pos - largest_end;
222 est.first = find_vertex(first.contig, largest.isRC != first.isRC, g_contigNames);

Callers 1

handleAlignmentFunction · 0.85

Calls 6

addEstimateFunction · 0.85
ContigIDClass · 0.85
flipQueryMethod · 0.80
find_vertexFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected