Menu ▾ ▴

#4 Program freeze on missing genotype data

open
nobody
None
5
2013-02-04
2013-02-04
No

I ran IBDBLD on my data over the weekend, thinking that it was just doing some complicated processing on my pedigree. Three days later, I came back to discover nothing had changed, and decided to add some progress indicators into the program. A bit more debugging and output statements later, I discovered the program had hit an infinite while loop:

do {
if(!MissingString[EachIndividualInformTrans[iNumberofAllele]])
{
AlleleType_EachLocus.push_back(EachIndividualInformTrans[iNumberofAllele]);
iNumberofAllele++;
break;
}
}while(iNumberofAllele<iTotalColLength);

Note that if there's a missing string for the very first individual, the while condition (in particular, iNumberofAllele) isn't modified each time round the loop. This creates the infinite condition. A patch to fix this (moving the increment out of the condition) is attached.

I'm not quite sure yet why there are two loops that seem to have very similar functions right after one another, but I guess I'll find that out later.

Discussion

  • David Eccles (gringer)

    Patch to fix data freeze on missing genotype

     
  • David Eccles (gringer)

    Related to this, there's an additional missing data bug in the very next loop. If *all* individuals have a missing genotype (I've got no idea why this happens in my input file, but it does), then the code tries to read past the end of the individual array. This is because the loop is run even if iNumberofAllele is equal to iTotalColLength. The solution is to change the next loop from a do-while loop to a while loop (same condition). Because iNumberAllele is not used later on in the function, this doesn't change the behaviour of the function.

     
  • David Eccles (gringer)

    Patch to fix segmentation fault (or worse) on missing genotype