From 29cbce9e43569f9530a3da95af8edc81d73c4cad Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Sun, 1 Feb 2015 23:25:54 +0100 Subject: [PATCH] test thing --- .../sws1-s4109503-s4202015/exercise2/parsegenome.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ass1/mart/sws1-s4109503-s4202015/exercise2/parsegenome.c b/ass1/mart/sws1-s4109503-s4202015/exercise2/parsegenome.c index 3395d89..eee156f 100644 --- a/ass1/mart/sws1-s4109503-s4202015/exercise2/parsegenome.c +++ b/ass1/mart/sws1-s4109503-s4202015/exercise2/parsegenome.c @@ -25,21 +25,16 @@ int main(int argc, char* argv[]) { 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; -- 2.20.1