source: tags/initial/GDE/MOLPHY/nucproc.c

Last change on this file was 2, checked in by oldcode, 24 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1/*
2 * nucproc.c   Adachi, J.   1994.01.28
3 * Copyright (C) 1992, 1993 J. Adachi & M. Hasegawa, All rights reserved.
4 */
5
6#include "protml.h"
7
8
9char
10*Cacid1[] = {
11        "T", "C", "A", "G",
12        "N", "*", "-"
13};
14
15
16char
17*Cacid3[] = {
18        "Thy", "Cyt", "Ade", "Gua",
19        "Nnn", " * ", " - "
20};
21
22
23int isacid(char c)
24{
25        /* nuc */
26        switch (c) {
27                case 'T':  case 'C':  case 'A':  case 'G':  case 'U':
28                case 'R':  case 'Y':  case 'N':  case '*':  case '-':
29                        return 1;
30                default:
31                        return 0;
32        }
33} /*_ isacid */
34
35
36int
37acid2int(c)
38char c;
39{
40        switch (c) {
41                case 'T': return 0;
42                case 'U': return 0;
43                case 'C': return 1;
44                case 'A': return 2;
45                case 'G': return 3;
46                default : return 4;
47        }
48} /*_ acid2int */
49
50
51char
52acid2chint(c)
53char c;
54{
55        switch (c) {
56                case 'T': return 0;
57                case 'U': return 0;
58                case 'C': return 1;
59                case 'A': return 2;
60                case 'G': return 3;
61                default : return -1;
62        }
63} /*_ acid2chint */
64
65
66char
67chint2acid(c)
68char c;
69{
70        switch (c) {
71                case  0 : return 'T';
72                case  1 : return 'C';
73                case  2 : return 'A';
74                case  3 : return 'G';
75                default : return '-';
76        }
77} /*_ chint2acid */
78
79
80char
81int2acid(i)
82int i;
83{
84        switch (i) {
85                case  0 : return 'T';
86                case  1 : return 'C';
87                case  2 : return 'A';
88                case  3 : return 'G';
89                default : return '-';
90        }
91} /*_ int2acid */
Note: See TracBrowser for help on using the repository browser.