@@ -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