Skip to content

Commit 376dce4

Browse files
committed
traverse_dfs() proper fix (hopefully), v2.0.3
1 parent 2268060 commit 376dce4

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

rlink.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "GBitVec.h"
33
#include <float.h>
44

5-
//#define GMEMTRACE 1 //debugging mem allocation
5+
//#define GMEMTRACE 1 //debugging memory allocation
66
#ifdef GMEMTRACE
77
#include "proc_mem.h"
88
#endif
@@ -2428,6 +2428,7 @@ int create_graph(int refstart,int s,int g,CBundle *bundle,GPVec<CBundlenode>& bn
24282428

24292429
//int seenjunc=0;
24302430

2431+
uint bundle_end=bnode[bundle->lastnodeid]->end;
24312432
while(bundlenode!=NULL) {
24322433

24332434
//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
25082509

25092510
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
25102511
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;
25142519
}
2515-
else minjunction = 1;
2520+
else minjunction = 0;
25162521
}
2517-
else minjunction = 0;
25182522
}
25192523

25202524
//fprintf(stderr,"minjunction=%d\n",minjunction);
@@ -2590,8 +2594,7 @@ int create_graph(int refstart,int s,int g,CBundle *bundle,GPVec<CBundlenode>& bn
25902594
float covright=get_cov(1,pos+1-refstart,endbundle-refstart,bpcov);
25912595
if(covright<covleft*(1-ERROR_PERC)) { // adjust start here if needed
25922596
completed=true;
2593-
edgeno++;
2594-
}
2597+
}
25952598
}
25962599
}
25972600

stringtie.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "proc_mem.h"
1212
#endif
1313

14-
#define VERSION "2.0.2b"
14+
#define VERSION "2.0.3"
1515

1616
//#define DEBUGPRINT 1
1717

0 commit comments

Comments
 (0)