Skip to content

Commit 123f10a

Browse files
committed
added two more SNV tests at different coordinates
1 parent 4a57e44 commit 123f10a

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/variants.cpp

+18-4
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,20 @@ bool DBG::DBGtoVariants(InSegment *inSegment) {
129129
auto results = searchVariants(pair, mapRange, targetsQueue, targetsMap, localGraphCache);
130130
explored += results.first;
131131
if (results.first) {
132-
for (DBGpath &path : results.second)
132+
for (DBGpath &path : results.second) {
133133
path.pos = c+k;
134134

135+
std::cout<<inSegment->getSeqHeader()<<" "<<+path.pos<<" "<<" "<<path.sequence<<std::endl;
136+
137+
if (path.type == SNV)
138+
std::cout<<"SNV"<<std::endl;
139+
else if (path.type == INS)
140+
std::cout<<"INS"<<std::endl;
141+
else
142+
std::cout<<"DEL"<<std::endl;
143+
144+
}
145+
135146
if (results.second.size() != 0)
136147
variants.push_back(results.second);
137148

@@ -284,15 +295,18 @@ std::pair<bool,std::deque<DBGpath>> DBG::searchVariants(std::pair<const uint64_t
284295

285296
if (i == refLen)
286297
newPath.type = SNV;
287-
else if (i > refLen)
298+
else if (i > refLen) {
288299
newPath.type = DEL;
300+
--i;
301+
}
289302
else
290303
newPath.type = INS;
291304

292305
prevNode = prev[destination].first;
293-
bool direction = prev[destination].second;
306+
bool direction = prev[prevNode].second;
307+
std::cout<<+direction<<" "<<+i<<" "<<+refLen<<std::endl;
294308
while (i >= refLen) {
295-
newPath.sequence.push_back(direction ? revCom(reverseHash(prevNode))[0] : revCom(reverseHash(prevNode))[0]);
309+
newPath.sequence.push_back(direction ? reverseHash(prevNode)[0] : revCom(reverseHash(prevNode)[k-1]));
296310
prevNode = prev[prevNode].first;
297311
direction = prev[prevNode].second;
298312
--i;

0 commit comments

Comments
 (0)