Skip to content

Commit 749a41e

Browse files
committed
complex variants need postprocessing
1 parent 123f10a commit 749a41e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/variants.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ bool DBG::DBGtoVariants(InSegment *inSegment) {
134134

135135
std::cout<<inSegment->getSeqHeader()<<" "<<+path.pos<<" "<<" "<<path.sequence<<std::endl;
136136

137-
if (path.type == SNV)
137+
if (path.type == COM)
138+
std::cout<<"COM"<<std::endl;
139+
else if (path.type == SNV)
138140
std::cout<<"SNV"<<std::endl;
139141
else if (path.type == INS)
140142
std::cout<<"INS"<<std::endl;
@@ -293,7 +295,9 @@ std::pair<bool,std::deque<DBGpath>> DBG::searchVariants(std::pair<const uint64_t
293295
++i;
294296
}
295297

296-
if (i == refLen)
298+
if (refLen > k)
299+
newPath.type = COM;
300+
else if (i == refLen)
297301
newPath.type = SNV;
298302
else if (i > refLen) {
299303
newPath.type = DEL;
@@ -305,11 +309,10 @@ std::pair<bool,std::deque<DBGpath>> DBG::searchVariants(std::pair<const uint64_t
305309
prevNode = prev[destination].first;
306310
bool direction = prev[prevNode].second;
307311
std::cout<<+direction<<" "<<+i<<" "<<+refLen<<std::endl;
308-
while (i >= refLen) {
312+
for (int16_t b = i-refLen; b >= 0; --b) {
309313
newPath.sequence.push_back(direction ? reverseHash(prevNode)[0] : revCom(reverseHash(prevNode)[k-1]));
310314
prevNode = prev[prevNode].first;
311315
direction = prev[prevNode].second;
312-
--i;
313316
}
314317
discoveredPaths.push_back(newPath);
315318
}

0 commit comments

Comments
 (0)