|
2 | 2 | #include "GBitVec.h" |
3 | 3 | #include <float.h> |
4 | 4 |
|
5 | | -//#define GMEMTRACE 1 //debugging mem allocation |
| 5 | +//#define GMEMTRACE 1 //debugging memory allocation |
6 | 6 | #ifdef GMEMTRACE |
7 | 7 | #include "proc_mem.h" |
8 | 8 | #endif |
@@ -2428,6 +2428,7 @@ int create_graph(int refstart,int s,int g,CBundle *bundle,GPVec<CBundlenode>& bn |
2428 | 2428 |
|
2429 | 2429 | //int seenjunc=0; |
2430 | 2430 |
|
| 2431 | + uint bundle_end=bnode[bundle->lastnodeid]->end; |
2431 | 2432 | while(bundlenode!=NULL) { |
2432 | 2433 |
|
2433 | 2434 | //fprintf(stderr,"process bundlenode %d-%d\n",bundlenode->start,bundlenode->end); |
@@ -2508,13 +2509,16 @@ int create_graph(int refstart,int s,int g,CBundle *bundle,GPVec<CBundlenode>& bn |
2508 | 2509 |
|
2509 | 2510 | int minjunction = -1; // process next junction -> either a start or an ending whichever has the first position on the genome; if they have same position then process ending first |
2510 | 2511 | if((nje<njunctions && (ejunction[nje]->end<=endbundle)) || (njs<njunctions && (junction[njs]->start<=endbundle))) { |
2511 | | - if(nje<njunctions) { // there are still junctions endings |
2512 | | - if(njs<njunctions) { // there are still junctions starting |
2513 | | - minjunction = junction[njs]->start >= ejunction[nje]->end ? 1 : 0; // one of them is clearly before the endbundle from the initial if |
| 2512 | + if(njs<njunctions && (junction[njs]->start<=endbundle) && junction[njs]->end>bundle_end) njs++; |
| 2513 | + else { |
| 2514 | + if(nje<njunctions) { // there are still junctions endings |
| 2515 | + if(njs<njunctions) { // there are still junctions starting |
| 2516 | + minjunction = junction[njs]->start >= ejunction[nje]->end ? 1 : 0; // one of them is clearly before the endbundle from the initial if |
| 2517 | + } |
| 2518 | + else minjunction = 1; |
2514 | 2519 | } |
2515 | | - else minjunction = 1; |
| 2520 | + else minjunction = 0; |
2516 | 2521 | } |
2517 | | - else minjunction = 0; |
2518 | 2522 | } |
2519 | 2523 |
|
2520 | 2524 | //fprintf(stderr,"minjunction=%d\n",minjunction); |
@@ -2590,8 +2594,7 @@ int create_graph(int refstart,int s,int g,CBundle *bundle,GPVec<CBundlenode>& bn |
2590 | 2594 | float covright=get_cov(1,pos+1-refstart,endbundle-refstart,bpcov); |
2591 | 2595 | if(covright<covleft*(1-ERROR_PERC)) { // adjust start here if needed |
2592 | 2596 | completed=true; |
2593 | | - edgeno++; |
2594 | | - } |
| 2597 | + } |
2595 | 2598 | } |
2596 | 2599 | } |
2597 | 2600 |
|
|
0 commit comments