-
Notifications
You must be signed in to change notification settings - Fork 0
/
bindepth.h
37 lines (26 loc) · 884 Bytes
/
bindepth.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
#ifndef _BINDEPTH_H
#define _BINDEPTH_H
/*
bindepth format is:
file: contig-dictionary contig-data [, contig-data ...]
contig-dictionary: num-contigs contig [, contig]
num-contigs: size_t representing the number of contigs
contig: contig-name contig-size
junk: uninitialized bytes filling up to dict-bytes
contig-name: 20 char, null-terminated character string
contig-size: size_t representing contig size
contig-data: depth [, depth]
depth: float representing the depth.
*/
#include <cstddef>
#include <cstdio>
struct contig_dict_t
{
char name[10];
char shortname[10];
size_t size;
};
contig_dict_t *parse_contig_dict(FILE *contig_dict_fh, size_t *ncontigs);
void write_contig_dict(contig_dict_t *contigs, size_t ncontigs, FILE *out_fh);
contig_dict_t *read_contig_dict(FILE *in_fh, size_t *ncontigs);
#endif // _BINDEPTH_H