{
if(c == '\n')
{
- if(charsperline != 100)
+ if(charsperline != 100 || numlines > 500)
return -1;
numlines += 1;
charsperline = 0;
}
else
{
- if(c == 'A')
- occs[0] += 1;
- else if(c == 'C')
- occs[1] += 1;
- else if(c == 'G')
- occs[2] += 1;
- else if(c == 'T')
- occs[3] += 1;
+/* Fancy polynome that translates A: 0, C: 1, G: 2, T: 3 */
+ if(c == 'A' || c == 'C' || c == 'G' || c == 'T')
+ occs[(int)(.001657140781*c*c*c-0.3780662484*c*c+28.74757194*c-726.3545635)] += 1;
else
return -1;
charsperline += 1;