SW#
All Files Functions Variables Typedefs Macros
chain.h
Go to the documentation of this file.
1 /*
2 swsharp - CUDA parallelized Smith Waterman with applying Hirschberg's and
3 Ukkonen's algorithm and dynamic cell pruning.
4 Copyright (C) 2013 Matija Korpar, contributor Mile Šikić
5 
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 Contact the author by mkorpar@gmail.com.
20 */
27 #ifndef __SW_SHARP_CHAINH__
28 #define __SW_SHARP_CHAINH__
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
43 typedef struct Chain Chain;
44 
59 extern Chain* chainCreate(char* name, int nameLen, char* string, int stringLen);
60 
66 extern void chainDelete(Chain* chain);
67 
79 extern char chainGetChar(Chain* chain, int index);
80 
93 extern char chainGetCode(Chain* chain, int index);
94 
102 extern int chainGetLength(Chain* chain);
103 
111 extern const char* chainGetName(Chain* chain);
112 
129 extern Chain* chainCreateView(Chain* chain, int start, int end, int reverse);
130 
140 extern void chainCopyCodes(Chain* chain, char* dest);
141 
151 extern Chain* chainDeserialize(char* bytes);
152 
162 extern void chainSerialize(char** bytes, int* bytesLen, Chain* chain);
163 
164 #ifdef __cplusplus
165 }
166 #endif
167 #endif // __SW_SHARP_CHAINH__
char chainGetChar(Chain *chain, int index)
Chain char getter.
Chain * chainCreate(char *name, int nameLen, char *string, int stringLen)
Chain object constructor.
int chainGetLength(Chain *chain)
Chain length getter.
const char * chainGetName(Chain *chain)
Chain name getter.
void chainCopyCodes(Chain *chain, char *dest)
Copies chain code to a buffer.
Chain * chainDeserialize(char *bytes)
Chain deserialization method.
void chainSerialize(char **bytes, int *bytesLen, Chain *chain)
Chain serialization method.
Chain * chainCreateView(Chain *chain, int start, int end, int reverse)
Creates a view to the chain object.
void chainDelete(Chain *chain)
Chain destructor.
struct Chain Chain
Chain object used for storing named sequnces.
Definition: chain.h:43
char chainGetCode(Chain *chain, int index)
Chain code getter.