@@ -12335,7 +12335,11 @@ void count_good_junctions(BundleData* bdata) {
1233512335 sprintf(sbuf, "%p", rd.juncs[i-1]);
1233612336 CJunction* jp=jhash[sbuf];
1233712337 if(jp) {
12338- if(rd.segs[i].start>jp->start || rd.segs[i].end<jp->end) {
12338+ if(rd.segs[i-1].start>jp->start || rd.segs[i].end<jp->end) {
12339+
12340+ if(rd.segs[i-1].start<=jp->start) rd.segs[i-1].end=jp->start;
12341+ if(rd.segs[i].end>=jp->end) rd.segs[i].start=jp->end;
12342+
1233912343 if(!nullj) {
1234012344 if(!junction[0]->start && !junction[0]->end) nullj=junction[0];
1234112345 else {
@@ -12350,14 +12354,15 @@ void count_good_junctions(BundleData* bdata) {
1235012354 rd.juncs[i-1]=jp;
1235112355 if(!rd.strand) rd.strand=jp->strand;
1235212356 //fprintf(stderr," [correct rd from %d-%d to %d-%d]",rd.segs[i-1].end,rd.segs[i].start,jp->start,jp->end);
12357+ if(rd.segs[i-1].start<=jp->start) rd.segs[i-1].end=jp->start;
12358+ if(rd.segs[i].end>=jp->end) rd.segs[i].start=jp->end;
1235312359 }
1235412360
12355- if(rd.segs[i].start<=jp->start) rd.segs[i-1].end=jp->start;
12356- if(rd.segs[i].end>=jp->end) rd.segs[i].start=jp->end;
12357-
1235812361 }
1235912362 else {
1236012363 if(rd.segs[i-1].start>rd.juncs[i-1]->start || rd.segs[i].end<rd.juncs[i-1]->end) {
12364+ if(rd.segs[i-1].end!=rd.juncs[i-1]->start && rd.segs[i-1].start<=rd.juncs[i-1]->start) rd.segs[i-1].end=rd.juncs[i-1]->start;
12365+ if(rd.segs[i].start!=rd.juncs[i-1]->end && rd.segs[i].end>=rd.juncs[i-1]->end) rd.segs[i].start=rd.juncs[i-1]->end;
1236112366 if(!nullj) {
1236212367 if(!junction[0]->start && !junction[0]->end) nullj=junction[0];
1236312368 else {
@@ -12367,10 +12372,11 @@ void count_good_junctions(BundleData* bdata) {
1236712372 }
1236812373 rd.juncs[i-1]=nullj;
1236912374 }
12370-
12371- //if(rd.segs[i-1].end!=rd.juncs[i-1]->start || rd.segs[i].start!=rd.juncs[i-1]->end) fprintf(stderr," [chg rd from %d-%d to %d-%d]",rd.segs[i-1].end,rd.segs[i].start,rd.juncs[i-1]->start,rd.juncs[i-1]->end);
12372- if(rd.segs[i-1].end!=rd.juncs[i-1]->start && rd.segs[i-1].start<=rd.juncs[i-1]->start) rd.segs[i-1].end=rd.juncs[i-1]->start;
12373- if(rd.segs[i].start!=rd.juncs[i-1]->end && rd.segs[i].end>=rd.juncs[i-1]->end) rd.segs[i].start=rd.juncs[i-1]->end;
12375+ else {
12376+ //if(rd.segs[i-1].end!=rd.juncs[i-1]->start || rd.segs[i].start!=rd.juncs[i-1]->end) fprintf(stderr," [chg rd from %d-%d to %d-%d]",rd.segs[i-1].end,rd.segs[i].start,rd.juncs[i-1]->start,rd.juncs[i-1]->end);
12377+ if(rd.segs[i-1].end!=rd.juncs[i-1]->start && rd.segs[i-1].start<=rd.juncs[i-1]->start) rd.segs[i-1].end=rd.juncs[i-1]->start;
12378+ if(rd.segs[i].start!=rd.juncs[i-1]->end && rd.segs[i].end>=rd.juncs[i-1]->end) rd.segs[i].start=rd.juncs[i-1]->end;
12379+ }
1237412380 }
1237512381 }
1237612382
0 commit comments