-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpw_gv.h
156 lines (128 loc) · 3.17 KB
/
pw_gv.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/* Copyright(c) Ryuichiro Nakato <[email protected]>
* This file is a part of DROMPA sources.
*/
#ifndef _PW_GV_H_
#define _PW_GV_H_
#include <stdbool.h>
#include "common.h"
#include "seq.h"
/* default parameter */
#define FRAGMENT_LEN 150
#define MAX_FRAGMENT_LEN 500
#define NUM4RPM_DEFAULT 20000000
#define NUM4DEPTH_DEFAULT 1.0
#define NUM4CMP_DEFAULT 10
#define FLEN4GC_DEFAULT 120
#define DIST_READLEN_MAX 200
#define DIST_FRAGLEN_MAX 1000
#define NUM_DARRAY 100
#define READARRAY_NUM 50000
/* weight */
#define WEIGHT2INT(v) ((v) * 10000.0)
#define INT2WEIGHT(v) ((v) * (1.0/10000.0))
typedef enum {FILETYPE_SAM, FILETYPE_BAM, FILETYPE_BOWTIE, FILETYPE_TAGALIGN} Inputfiletype;
typedef enum {READTYPE_SINGLE, READTYPE_PAIR} Readtype;
typedef enum{
NORMTYPE_NONE,
NORMTYPE_GENOME_READ,
NORMTYPE_GENOME_DEPTH,
NORMTYPE_CHROM_READ,
NORMTYPE_CHROM_DEPTH,
} Normtype;
typedef struct{
char *inputfile;
char *output_prefix;
char *output_dir;
char *gtfile;
char *mpfile;
Inputfiletype ftype;
Readtype rtype;
PWfile_Type wtype;
Normtype ntype;
int showzero;
int binsize;
int *binnum_chr, binnum_genome;
int fraglen;
int max_fraglen;
int num4rpm;
double num4depth;
int num4cmp;
double r4cmp;
bool pcrfilter;
int thre_filter;
double mpthre;
bool usereadcenter;
/* bed file */
char *bedfilename;
BedFile *enrichfile;
/* for GC normalization */
char *genomefile;
char *mpbinaryfile;
int flen4gc;
int gcdepth;
/* cross-correlation*/
bool ccp;
} PwParam;
typedef struct{
int *F3;
int *F5;
int *weight;
bool *delete; // for filtering redundant reads
bool *ignore; // for ignoring peak regions
// char *lcmp; // for calculating complexity
int narray;
} Readarray;
typedef struct{
int dist_readlen_F3[DIST_READLEN_MAX];
int dist_readlen_F5[DIST_READLEN_MAX];
int dist_fraglen[DIST_FRAGLEN_MAX +1]; /* +1: over DIST_FRAGLEN_MAX */
} FragStats;
typedef struct{
TYPE_WIGARRAY max;
int *darray_all, *darray_bg;
int num;
double ave, var;
double nb_p, nb_n, nb_p0; /* for negative binomial model */
} WigStatsMember;
typedef struct{
int n_darray;
int thre;
TYPE_WIGARRAY num95;
WigStatsMember *genome, *chr;
} WigStats;
struct seq{
long n_read_infile; /* allow multiread (-kn) */
long double n_readname; /* number of unique readname */
long n_read_nonred; /* number of nonredundant reads (use as "reads number") */
long n_read_rpkm; /* number of reads after normalization (n_read_nonred * rpkm weight) */
long n_read_red; /* number of redundant reads (filtered as PCR bias) */
double n_read_afterGC; /* number of reads after GC normalization */
};
typedef struct{
struct seq seq[STRANDNUM];
struct seq both;
double depth;
double w;
/* FRiP */
long n_read_inbed;
double FRiP;
} SeqStats;
typedef struct{
int nt_all, nt_nonred, nt_red;
double complexity;
int tv;
} CompStats;
typedef struct{
SeqStats *genome, *chr;
Readarray **readarray;
FragStats fstats;
WigStats wstats;
CompStats cs_raw, cs_nonred;
int threshold4filtering;
/* for GC*/
int *GCdist;
int maxGC;
int sum_GCdist;
double *GCweight;
} Mapfile;
#endif /* _PW_GV_H_ */