Skip to content

Commit 90fc13f

Browse files
committed
fix merge of transcripts on opposite strands (issues gpertea#105, gpertea#100)
1 parent f556e32 commit 90fc13f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

rlink.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13478,7 +13478,7 @@ int build_merge(BundleData* bdata) { // here a "read" is in fact a transcript
1347813478
//if(rd.juncs.Count()) {
1347913479
int m=n+1;
1348013480
while(m<nreads && readlist[m]->start<=rd.segs[0].end) {
13481-
if(readlist[m]->nh && readlist[m]->tinfo->g==-1 && readlist[m]->juncs.Count()==rd.juncs.Count()) {
13481+
if(readlist[m]->nh && readlist[m]->strand==rd.strand && readlist[m]->tinfo->g==-1 && readlist[m]->juncs.Count()==rd.juncs.Count()) {
1348213482
bool samejuncs=true;
1348313483
for(int i=0;i<rd.juncs.Count();i++)
1348413484
if(rd.juncs[i]!=readlist[m]->juncs[i]) {
@@ -15507,7 +15507,7 @@ int printMergeResults(BundleData* bundleData, int geneno, GStr& refname) {
1550715507
//fprintf(stderr,"\n");
1550815508
int m=n+1;
1550915509
while(m<npred && pred[m]->start<=pred[n]->end+bundledist) { // prediction m overlaps prediction n or is very close by
15510-
if(keep[m]) {
15510+
if(keep[m] && equal_strand(pred[n],pred[m])) {
1551115511
if(pred[m]->start<=pred[n]->end) { // predicions actually overlap
1551215512
if(!pred[n]->t_eq && ((pred[m]->exons.Count()>1 && pred[n]->cov<isofrac*pred[m]->cov) ||
1551315513
(pred[n]->exons.Count()==1 && pred[n]->cov<pred[m]->cov))) { // only eliminate prediction if it's not guide
@@ -15521,7 +15521,7 @@ int printMergeResults(BundleData* bundleData, int geneno, GStr& refname) {
1552115521

1552215522
}
1552315523
else // pred[m] is within bundledist of pred[n] -> see if we can merge them
15524-
if((pred[n]->exons.Count()==1 || pred[m]->exons.Count()==1) && equal_strand(pred[n],pred[m])) {
15524+
if(pred[n]->exons.Count()==1 || pred[m]->exons.Count()==1) {
1552515525

1552615526
//fprintf(stderr," pred[%d] of len=%d eliminated pred[%d] of len=%d and cov %g %c:",n,pred[n]->tlen,m,pred[m]->tlen,pred[m]->cov,pred[m]->strand);
1552715527
//for(int e=0;e<pred[m]->exons.Count();e++) fprintf(stderr," %d-%d",pred[m]->exons[e].start,pred[m]->exons[e].end);

0 commit comments

Comments
 (0)