| 16 | #include "io.h" |
| 17 | |
| 18 | struct seq_col* set_longest_orf(struct seq_col *in_seq_col) |
| 19 | { |
| 20 | int i; |
| 21 | |
| 22 | struct seq_col *ret_seq_col; |
| 23 | struct seq *seq, *input_seq; |
| 24 | if((ret_seq_col = calloc(1,sizeof(struct seq_col)))==NULL) |
| 25 | { |
| 26 | error("set_longest_orf(): Out of memory "); |
| 27 | } |
| 28 | if((ret_seq_col->seqs = calloc((in_seq_col->length),sizeof(struct seq)))==NULL) |
| 29 | { |
| 30 | error("set_longest_orf(): Out of memory "); |
| 31 | } |
| 32 | |
| 33 | input_seq = &(in_seq_col->seqs[0]); |
| 34 | for(i=0; i!= in_seq_col->length; ++i) |
| 35 | { |
| 36 | seq = orf_finder(input_seq); |
| 37 | ++input_seq; |
| 38 | ret_seq_col->seqs[i].dna_num = seq->dna_num; |
| 39 | ret_seq_col->seqs[i].orf_frame = seq->orf_frame; |
| 40 | ret_seq_col->seqs[i].data = seq->data; |
| 41 | ret_seq_col->seqs[i].name = seq->name; |
| 42 | ret_seq_col->seqs[i].num = seq->num; |
| 43 | ret_seq_col->seqs[i].length = seq->length; |
| 44 | ++seq; |
| 45 | |
| 46 | } |
| 47 | ret_seq_col->length=in_seq_col->length; |
| 48 | |
| 49 | return ret_seq_col; |
| 50 | } |
| 51 | |
| 52 | |
| 53 | struct seq* orf_finder(struct seq *in_seq) |
no test coverage detected