libuproc  1.2.0
common.h
Go to the documentation of this file.
1 /* Copyright 2014 Peter Meinicke, Robin Martinjak
2  *
3  * This file is part of libuproc.
4  *
5  * libuproc is free software: you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License as published by the Free
7  * Software Foundation, either version 3 of the License, or (at your option)
8  * any later version.
9  *
10  * libuproc is distributed in the hope that it will be useful, but WITHOUT ANY
11  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libuproc. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
29 #ifndef UPROC_COMMON_H
30 #define UPROC_COMMON_H
31 
32 #include <stdint.h>
33 #include <inttypes.h>
34 #include <math.h>
35 
37 #define UPROC_EPSILON 1e-5
38 
40 #define UPROC_BITMASK(n) (~(~0ULL << (n)))
41 
43 #define UPROC_PREFIX_LEN 6
44 
46 #define UPROC_SUFFIX_LEN 12
47 
49 #define UPROC_WORD_LEN (UPROC_PREFIX_LEN + UPROC_SUFFIX_LEN)
50 
52 typedef int uproc_amino;
53 
55 #define UPROC_AMINO_BITS 5
56 
58 #define UPROC_ALPHABET_SIZE 20
59 
65 typedef uint_least32_t uproc_prefix;
66 
68 #define UPROC_PREFIX_PRI PRIu32
69 
71 #define UPROC_PREFIX_SCN SCNu32
72 
74 #define UPROC_POW6(x) ((x) * (x) * (x) * (x) * (x) * (x))
75 
77 #define UPROC_PREFIX_MAX (UPROC_POW6((unsigned long)UPROC_ALPHABET_SIZE) - 1)
78 
84 typedef uint_least64_t uproc_suffix;
85 
87 #define UPROC_SUFFIX_PRI PRIu64
88 
90 #define UPROC_SUFFIX_SCN SCNu64
91 
93 typedef uint_least16_t uproc_family;
94 
96 #define UPROC_FAMILY_MAX (UINT_LEAST16_MAX - 1)
97 
99 #define UPROC_FAMILY_INVALID (UINT_LEAST16_MAX)
100 
102 #define UPROC_FAMILY_PRI PRIu16
103 
105 #define UPROC_FAMILY_SCN SCNu16
106 
111 #endif
int uproc_amino
Type to represent one amino acid.
Definition: common.h:52
uint_least64_t uproc_suffix
Type for suffixes.
Definition: common.h:84
uint_least32_t uproc_prefix
Type for prefixes.
Definition: common.h:65
uint_least16_t uproc_family
Identifier of a protein family.
Definition: common.h:93