source: tags/arb_5.3/CONVERTALN/routines.c

Last change on this file was 5390, checked in by westram, 16 years ago
  • TAB-Ex
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1#include <stdio.h>
2#include "convert.h"
3#include "global.h"
4
5/* ----------------------------------------------------------
6 *   Function count_base().
7 *       Count bases A, T, G, C and others.
8 */
9void
10count_base(base_a, base_t, base_g, base_c, base_other)
11    int *base_a, *base_t, *base_g, *base_c, *base_other;
12{
13    int indi;
14
15    (*base_a)=(*base_c)=(*base_t)=(*base_g)=(*base_other)=0;
16    for(indi=0; indi<data.seq_length; indi++)
17        switch(data.sequence[indi]) {
18            case 'a':
19            case 'A':
20                (*base_a)++;
21                break;
22            case 't':
23            case 'T':
24            case 'u':
25            case 'U':
26                (*base_t)++;
27                break;
28            case 'g':
29            case 'G':
30                (*base_g)++;
31                break;
32            case 'c':
33            case 'C':
34                (*base_c)++;
35                break;
36            default:
37                (*base_other)++;
38        }
39}
40/* ------------------------------------------------------------------
41 *   Function replace_entry().
42 *       Free space of string1 and replace string1 by string2.
43 */
44void replace_entry(string1, string2)
45     char       **string1;
46     const char  *string2;
47{
48    /*  void    Freespace(); */
49    /*  char    *Dupstr(); */
50
51    Freespace(string1);
52    (*string1)=(char*)Dupstr(string2);
53
54}
Note: See TracBrowser for help on using the repository browser.