-
Notifications
You must be signed in to change notification settings - Fork 0
/
reads_data.h
75 lines (61 loc) · 1.67 KB
/
reads_data.h
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef _READS_DATA_H_
#define _READS_DATA_H_
#include "load_data.h"
#include <limits.h>
#include <stdlib.h>
#define MAX_HEADER_LEN 64
#define TITLE_LINE_MARKER "# Title: "
#define TITLE_LINE_MARKER_LEN 9
/**
* @struct ReadDataType
* data stored for one read
* @see ReadDBType
*/
typedef struct ReadDataType {
/** header descriptor in the "csfasta/fastq" file */
char *info;
#ifndef NUCLEOTIDES
/** first color (synch color, not used in the alignment process) */
CODE_TYPE first_base;
/** first quality (associated to synch color) */
QUAL_TYPE first_qual;
#endif
/** color space read quality (compressed in 2bits per qual) */
QUAL_TYPE *quality;
/** color space read sequence (compressed in 2bits per code) */
CODE_TYPE *sequence;
/** tag : maximum lexicographic subword of size at most sizeof(unsigned long)*4 in the read */
unsigned long tag;
} ReadDataType;
/**
* @struct ReadsDBType
* data stored for a set of reads
* @see ReadDataType
*/
typedef struct ReadsDBType {
/** descriptor name of the set of reads */
char* name;
/** length of the reads (all must have the same !!) */
int read_len;
/** number of reads */
long size;
/** array storing the set of reads */
ReadDataType* reads;
} ReadsDBType;
/**
* Reverse-complement a read
*/
void read__reverse(const ReadDataType* src, ReadDataType* dest, int len);
/**
* Sort a read database (alphanumerical order)
*/
int sort_reads_db(ReadsDBType * db);
/**
* Loads a reads database
*/
int load_reads_db(const char* reads_filename, const char* qual_filename, ReadsDBType* db);
/**
* Destroys a read database
*/
void clear_reads_db(ReadsDBType* db);
#endif /* _READS_DATA_H_ */