File: is_standard.c

package info (click to toggle)
garlic 1.6-1.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 4,440 kB
  • ctags: 1,403
  • sloc: ansic: 52,465; makefile: 1,134
file content (59 lines) | stat: -rw-r--r-- 1,643 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
54
55
56
57
58
59
/* Copyright (C) 2001 Damir Zucic */

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

			    is_standard.c

Purpose:
	If the specified residue belongs to the set of 20 standard residues,
	return  positive value  or zero.  Otherwise,  return negative value.
	This function  contains the list of  standard residue names.  If the
	specified residue name matches one of the names from the list,  this
	function will return the array index.

Input:
	(1) Residue name.

Output:
	(1) Return value.

Return value:
	(1) Positive or zero, if residue name was found in the list.
	(2) Negative otherwise.

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

#include <stdio.h>
#include <string.h>

/*======check residue name:==================================================*/

int IsStandard_ (char *residue_nameP)
{
int		nameI;
static char	residue_nameAA[20][4] = {"ALA", "ARG", "ASN", "ASP", "CYS",
				     /*    0      1      2      3      4    */

					 "GLN", "GLU", "GLY", "HIS", "ILE",
				     /*    5      6      7      8      9    */

					 "LEU", "LYS", "MET", "PHE", "PRO",
				     /*   10     11     12     13     14    */

					 "SER", "THR", "TRP", "TYR", "VAL"};
				     /*   15     16     17     18     19    */

/* Scan the list of standard residue names: */
for (nameI = 0; nameI < 20; nameI++)
	{
	if (strcmp (residue_nameP, residue_nameAA[nameI]) == 0) return nameI;
	}

/* If this point is reached,  residue name was */
/* not found in the list of 20 standard names: */
return -1;
}

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