Skip to content

Commit 3436ad6

Browse files
committed
reverted a049f69 for a proper fix
1 parent 1dd07a2 commit 3436ad6

2 files changed

Lines changed: 13 additions & 20 deletions

File tree

bundle.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ struct BundleData {
398398
pred.Clear();
399399
pred.setSorted(false);
400400
readlist.Clear();
401+
readlist.setSorted(false);
401402
for(int i=0;i<3;i++) {
402403
bpcov[i].Clear();
403404
bpcov[i].setCapacity(1024);

rlink.cpp

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,28 +1673,20 @@ int add_read_to_group(int n,GList<CReadAln>& readlist,int color,GPVec<CGroup>& g
16731673
int readcol=usedcol[sno];
16741674

16751675
if(np<n) { // there is a pair and it came before the current read in sorted order of position
1676-
// first group of pair read is: readgroup[np][0] -- but only if readgroup[np] is not empty
1677-
if (readgroup[np].Count() > 0) {
1678-
int grouppair=readgroup[np][0];
1679-
while( merge[grouppair]!=grouppair) {
1680-
grouppair=merge[grouppair];
1681-
}
1682-
readgroup[np][0]=grouppair;
1676+
// first group of pair read is: readgroup[np][0]
16831677

1684-
readcol=group[readgroup[np][0]]->color; // readcol gets assigned the color of the pair's first group --> this might not
1685-
// work if I split a read into multiple groups
1686-
while(eqcol[readcol]!=readcol) { // get smallest color
1687-
readcol=eqcol[readcol];
1688-
}
1689-
group[readgroup[np][0]]->color=readcol;
1690-
} else { // missing previous entry?
1691-
if (readcol < 0) {
1692-
usedcol[sno] = color;
1693-
readcol = color;
1694-
eqcol.Add(color);
1695-
++color;
1696-
}
1678+
int grouppair=readgroup[np][0];
1679+
while( merge[grouppair]!=grouppair) {
1680+
grouppair=merge[grouppair];
1681+
}
1682+
readgroup[np][0]=grouppair;
1683+
1684+
readcol=group[readgroup[np][0]]->color; // readcol gets assigned the color of the pair's first group --> this might not
1685+
// work if I split a read into multiple groups
1686+
while(eqcol[readcol]!=readcol) { // get smallest color
1687+
readcol=eqcol[readcol];
16971688
}
1689+
group[readgroup[np][0]]->color=readcol;
16981690
}
16991691
else { // it's the first time I see the read in the fragment
17001692
//fragno+=readlist[n]->pair_count[p];

0 commit comments

Comments
 (0)