@@ -906,19 +906,19 @@ void DBG::DBGgraphToGFA() {
906
906
907
907
phmap::parallel_flat_hash_map<uint64_t , std::tuple<DBGkmer32,uint32_t ,bool >> residualEdges; // hash, kmer, G' node, node side
908
908
909
- auto extend = [&,this ] (std::pair<uint64_t , DBGkmer32color> node, std::string &seed, uint8_t side) {
909
+ auto extend = [&,this ] (std::pair<uint64_t , DBGkmer32color> node, std::string &seed, int8_t side) {
910
910
911
- if ((side ? node.second .bwCount () : node.second .fwCount ()) > 1 ) {
911
+ if ((side ? node.second .fwCount () : node.second .bwCount ()) > 1 ) {
912
912
std::cout<<" Branching node side, cannot extend. Terminating." <<std::endl;
913
913
exit (EXIT_FAILURE);
914
- }else if ((side ? node.second .bwCount () : node.second .fwCount ()) == 0 ){
914
+ }else if ((side ? node.second .fwCount () : node.second .bwCount ()) == 0 ){
915
915
std::cout<<" Dead end, cannot extend. Terminating." <<std::endl;
916
916
exit (EXIT_FAILURE);
917
917
}
918
918
919
919
uint64_t key, baseCounter = 0 ;
920
920
bool isFw = isKeyFw (node.first );
921
- isFw = side ? ! isFw : isFw;
921
+ isFw = side ? isFw : ! isFw;
922
922
923
923
while (true ) {
924
924
@@ -1001,15 +1001,15 @@ void DBG::DBGgraphToGFA() {
1001
1001
std::string frontSequence = reverseHash (pair->first ); // we grow the sequence in both directions
1002
1002
std::string backSequence = revCom (reverseHash (pair->first ));
1003
1003
1004
- uint8_t edgeCounts[2 ] = {pair->second .fwCount (), pair->second .bwCount ()};
1004
+ uint8_t edgeCounts[2 ] = {pair->second .bwCount (), pair->second .fwCount ()};
1005
1005
1006
1006
if (edgeCounts[0 ] == 1 || edgeCounts[1 ] == 1 ) { // we are at a branch, otherwise we are in the middle, nothing can be merged safely
1007
1007
1008
- for (uint8_t side = 0 ; side < 2 ; ++ side) {
1008
+ for (int8_t side = 1 ; side >= 0 ; -- side) {
1009
1009
1010
1010
if (edgeCounts[side] == 1 ) { // we can extend if we are at a branch and this the non branching side
1011
1011
1012
- extend (*pair, (! side ? frontSequence : backSequence), side);
1012
+ extend (*pair, (side ? frontSequence : backSequence), side);
1013
1013
// std::cout<<"sequence: "<<(!side ? frontSequence : backSequence)<<std::endl;
1014
1014
1015
1015
0 commit comments