File: is_polar.c

package info (click to toggle)
garlic 1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,516 kB
  • sloc: ansic: 52,465; makefile: 2,254
file content (53 lines) | stat: -rw-r--r-- 1,385 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* Copyright (C) 2001 Damir Zucic */

/*=============================================================================

				is_polar.c

Purpose:
	Check is the specified residue polar. Check also is it hydrogen
	bond donor or acceptor.

Input:
	(1) Residue name (purified, i.e. without spaces).

Output:
	(1) Return value.

Return value:
	(1) Negative, if residue is apolar.
	(2) Zero, if residue is polar and hydrogen bond acceptor.
	(3) One, if residue is polar and hydrogen bond donor.
	(4) Two, if residue is both donor and acceptor or ASX or GLX.

========includes:============================================================*/

#include <stdio.h>

#include <string.h>

/*======check is the specified residue polar:================================*/

int IsPolar_ (char *pure_residue_nameP)
{
static char	polar_nameAA[13][4]  = {"GLU", "GLN", "HIS", "LYS", "TYR",
					"TRP", "THR", "SER", "ASP", "ASN",	
					"ARG", "ASX", "GLX"};
static int	donorI[13] =           {  0,     2,     1,     1,     1,
					  1,     0,     0,     0,     2,
					  1,     2,     2};
int		i;

/* Compare only the first three characters: */
for (i = 0; i < 13; i++)
	{
	if (!strcmp (polar_nameAA[i], pure_residue_nameP)) return donorI[i];
	}

/* If this point is reached, the specified residue is apolar: */
return -1;
}

/*===========================================================================*/