-
Notifications
You must be signed in to change notification settings - Fork 2
/
flag.go
266 lines (260 loc) · 4.59 KB
/
flag.go
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
package main
import (
"flag"
"fmt"
"os"
"path/filepath"
"strings"
)
// flag
var (
cfg = flag.String(
"cfg",
filepath.Join(etcPath, "config.toml"),
"toml config document",
)
productID = flag.String(
"product",
"",
"product ID",
)
snv = flag.String(
"snv",
"",
"input snv anno txt, comma as sep",
)
prefix = flag.String(
"prefix",
"",
"output xlsx prefix.tier{1,2,3}.xlsx, default is same to first file of -snv",
)
logfile = flag.String(
"log",
"",
"output log to log.log, default is prefix.log",
)
geneID = flag.String(
"geneId",
filepath.Join(dbPath, "gene.id.txt"),
"gene symbol and ncbi id list",
)
specVarList = flag.String(
"specVarList",
"",
"特殊位点库",
)
transInfo = flag.String(
"transInfo",
"",
"info of transcript",
)
list = flag.String(
"list",
"proband,father,mother",
"sample list for family mode, comma as sep",
)
exon = flag.String(
"exon",
"",
"exonCnv files path, comma as sep, only write samples in -list",
)
large = flag.String(
"large",
"",
"largeCnv file path, comma as sep, only write sample in -list",
)
smn = flag.String(
"smn",
"",
"smn result file path, comma as sep, require -large and only write sample in -list",
)
loh = flag.String(
"loh",
"",
"loh result excel path, comma as sep, use sampleID in -list to create sheetName in order",
)
lohSheet = flag.String(
"lohSheet",
"LOH_annotation",
"loh sheet name to append",
)
gender = flag.String(
"gender",
"NA",
"gender of sample list, comma as sep, if M then change Hom to Hemi in XY not PAR region",
)
qc = flag.String(
"qc",
"",
"coverage.report file to fill quality sheet, comma as sep, same order with -list",
)
kinship = flag.String(
"kinship",
"",
"kinship result for trio only",
)
karyotype = flag.String(
"karyotype",
"",
"karyotype files to fill quality sheet's 核型预测, comma as sep")
redisAddr = flag.String(
"redisAddr",
"",
"redis Addr Option",
)
seqType = flag.String(
"seqType",
"SEQ2000",
"redis key:[SEQ2000|SEQ500|Hiseq]",
)
config = flag.String(
"config",
filepath.Join(etcPath, "config.json"),
"default config file, config will be overwrite by flag",
)
cpuprofile = flag.String(
"cpuprofile",
"",
"cpu profile",
)
memprofile = flag.String(
"memprofile",
"",
"mem profile",
)
extra = flag.String(
"extra",
"",
"extra file path to excel, comma as sep",
)
extraSheetName = flag.String(
"extraSheet",
"",
"extra sheet name, comma as sep, same order with -extra",
)
tag = flag.String(
"tag",
"",
"read tag from file, add to tier1 file name:[prefix].Tier1[tag].xlsx",
)
filterStat = flag.String(
"filterStat",
"",
"filter.stat files to calculate reads QC, comma as sep",
)
)
// bool flag
var (
academic = flag.Bool(
"academic",
false,
"if non-commercial use",
)
acmg = flag.Bool(
"acmg",
false,
"if use new ACMG, fix PVS1, PS1,PS4, PM1,PM2,PM4,PM5 PP2,PP3, BA1, BS1,BS2, BP1,BP3,BP4,BP7",
)
allGene = flag.Bool(
"allgene",
false,
"if not filter gene",
)
allTier1 = flag.Bool(
"allTier1",
false,
"if input filtered vcf, set all to tier1 and no filter",
)
autoPVS1 = flag.Bool(
"autoPVS1",
false,
"if use autoPVS1 for acmg",
)
cnvAnnot = flag.Bool(
"cnvAnnot",
false,
"if UpdateCnvAnnot",
)
cnvFilter = flag.Bool(
"cnvFilter",
false,
"if filter cnv result",
)
couple = flag.Bool(
"couple",
false,
"if couple mode",
)
ifRedis = flag.Bool(
"redis",
false,
"if use redis server",
)
outJson = flag.Bool(
"json",
false,
"if output tier1.json",
)
save = flag.Bool(
"save",
true,
"if save to excel",
)
trio = flag.Bool(
"trio",
false,
"if standard trio mode",
)
trio2 = flag.Bool(
"trio2",
false,
"if no standard trio mode but proband-father-mother",
)
warn = flag.Bool(
"warn",
false,
"warn gene id lost rather than fatal",
)
wgs = flag.Bool(
"wgs",
false,
"if anno wgs",
)
wesim = flag.Bool(
"wesim",
false,
"if wesim, output result.tsv",
)
mt = flag.Bool(
"mt",
false,
"force all MT variant to Tier1",
)
pp = flag.Bool(
"pp",
false,
"is use PrePregnancy db",
)
)
func checkFlag() {
if *snv == "" && *exon == "" && *large == "" && *smn == "" && *loh == "" {
flag.Usage()
fmt.Println("\nshold have at least one input:-snv,-exon,-large,-smn,-loh")
os.Exit(0)
}
if *snv == "" {
if *prefix == "" {
flag.Usage()
fmt.Println("\nshold have -prefix for output")
os.Exit(0)
}
} else {
snvs = strings.Split(*snv, ",")
if *prefix == "" {
*prefix = snvs[0]
}
}
if *logfile == "" {
*logfile = *prefix + ".log"
}
}