-
Notifications
You must be signed in to change notification settings - Fork 0
/
Usage.pm
250 lines (198 loc) · 10.1 KB
/
Usage.pm
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
package Usage;
###################################################################
# Usage
#
# Package with usage description of each operation mode
#
# Author: Giuseppe Narzisi
# Date: December 11, 2013
#
###################################################################
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(getDefaults usageDenovo usageSingle usageSomatic usageExport);
use strict;
use warnings;
use POSIX;
my %defaults = (
kmer => 25,
cov_threshold => 5,
tip_cov_threshold => 2,
covratio => 0.01,
radius => 100,
windowSize => 400,
delta => 100,
map_qual => 1,
maxmismatch => 3,
min_cov => 5,
max_cov => 1000000,
maxchi2 => 1000000,
outratio => 0.05,
WORK => "./outdir",
MAX_PROCESSES => 1,
sample => "ALL",
selected => "null",
pathlimit => 100000,
format => "vcf",
SVtype => "all",
version_num => "0.1.1(beta)",
);
#####################################################
#
# export defaults
#
sub getDefaults { return \%defaults; }
#####################################################
#
# Message about the program and how to use it
#
sub usageSingle {
my $name = $_[0];
print STDERR <<END;
usage: $name --bam <BAM file> --bed <BED file> --ref <FASTA file> [OPTIONS]
Detect INDELs in one single dataset (e.g., one individual).
OPTIONS:
--help : this (help) message
--verbose : verbose mode
Required:
--bam <BAM file> : BAM file with the reference-aligned reads
--bed <BED file> : BED file with list of exome-target coordinates
--ref <FASTA file> : reference genome in FASTA format
Optional:
--kmer <int> : k-mer size [default $defaults{kmer}]
--covthr <int> : threshold used to select source and sink [default $defaults{cov_threshold}]
--lowcov <int> : threshold used to remove low-coverage nodes [default $defaults{tip_cov_threshold}]
--covratio <float> : minimum coverage ratio for sequencing errors (default: $defaults{covratio})
--radius <int> : left and right extension (in base-pairs) [default $defaults{radius}]
--window <int> : window-size of the region to assemble (in base-pairs) [default $defaults{windowSize}]
--step <int> : delta shift for the sliding window (in base-pairs) [default$defaults{delta}]
--mapscore <int> : minimum mapping quality for selecting reads to assemble [default $defaults{map_qual}]
--pathlimit <int> : limit number of sequence paths [default $defaults{pathlimit}]
--mismatches <int> : max number of mismatches in near-perfect repeat detection [default $defaults{maxmismatch}]
--dir <directory> : output directory [default $defaults{WORK}]
--numprocs <int> : number of parallel jobs (1 for no parallelization) [default $defaults{MAX_PROCESSES}]
--sample <string> : only process reads/fragments in sample [default $defaults{sample}]
--coords <file> : file with list of selected locations to examine [default $defaults{selected}]
Output:
--format : export mutations in selected format (annovar | vcf) [default $defaults{format}]
--intarget : export mutations only inside the target regions from the BED file
--mincov <int> : minimum coverage for exporting mutation to file [default $defaults{min_cov}]
--outratio <float> : minimum coverage ratio for exporting mutation to file (default: $defaults{outratio})
Note 1: the list of detected INDELs is saved in file: OUTDIR/variants.*.indel.*
where OUTDIR is the output directory selected with option "--dir" [default $defaults{WORK}]
Note 2: the input reference file (option "--ref") must be the same one that was used to create the BAM file.
END
exit;
}
#####################################################
#
# Message about the program and how to use it
#
sub usageDenovo {
my $name = $_[0];
print STDERR <<END;
usage: $name --dad <BAM file> --mom <BAM file> --aff <BAM file> --sib <BAM file> --bed <BED file> --ref <FASTA file> [OPTIONS]
Detect de novo INDELs in a family of four individuals (mom, dad, aff, sib).
OPTIONS:
--help : this (help) message
--verbose : verbose mode
Required:
--dad <BAM file> : father BAM file
--mom <BAM file> : mother BAM file
--aff <BAM file> : affected child BAM file
--sib <BAM file> : sibling BAM file
--bed <BED file> : BED file with list of exome-target coordinates
--ref <FASTA file> : reference genome in FASTA format
Optional:
--kmer <int> : k-mer size [default $defaults{kmer}]
--covthr <int> : threshold used to select source and sink [default $defaults{cov_threshold}]
--lowcov <int> : threshold used to remove low-coverage nodes [default $defaults{tip_cov_threshold}]
--covratio <float> : minimum coverage ratio for sequencing errors (default: $defaults{covratio})
--radius <int> : left and right extension (in base-pairs) [default $defaults{radius}]
--window <int> : window-size of the region to assemble (in base-pairs) [default $defaults{windowSize}]
--step <int> : delta shift for the sliding window (in base-pairs) [default $defaults{delta}]
--mapscore <int> : minimum mapping quality for selecting reads to assemble [default $defaults{map_qual}]
--mismatches <int> : max number of mismatches in near-perfect repeat detection [default $defaults{maxmismatch}]
--dir <directory> : output directory [default $defaults{WORK}]
--numprocs <int> : number of parallel jobs (1 for no parallelization) [default $defaults{MAX_PROCESSES}]
--coords <file> : file with list of selected coordinates to examine [default $defaults{selected}]
Output:
--format : export mutations in selected format (annovar | vcf) [default $defaults{format}]
--intarget : export mutations only inside the target regions from the BED file
--mincov <int> : minimum coverage for exporting mutation to file [default $defaults{min_cov}]
--outratio <float> : minimum coverage ratio for exporting mutation to file (default: $defaults{outratio})
Note 1: the list of de novo INDELs is saved in file: OUTDIR/denovos.*.indel.*
where OUTDIR is the output directory selected with option "--dir" [default $defaults{WORK}]
Note 2: the input reference file (option "--ref") must be the same one that was used to create the BAM file.
END
exit;
}
#####################################################
#
# Message about the program and how to use it
#
sub usageSomatic {
my $name = $_[0];
print STDERR <<END;
usage: $name --normal <BAM file> --tumor <BAM file> --bed <BED file> --ref <FASTA file> [OPTIONS]
Detect somatic INDELs in a tumor/sample pair
OPTIONS:
--help : this (help) message
--verbose : verbose mode
Required:
--normal <BAM file> : normal BAM file
--tumor <BAM file> : tumor BAM file
--bed <BED file> : BED file with list of exome-target coordinates
--ref <FASTA file> : reference genome in FASTA format
Optional:
--kmer <int> : k-mer size [default $defaults{kmer}]
--covthr <int> : threshold used to select source and sink [default $defaults{cov_threshold}]
--lowcov <int> : threshold used to remove low-coverage nodes [default $defaults{tip_cov_threshold}]
--covratio <float> : minimum coverage ratio for sequencing errors (default: $defaults{covratio})
--radius <int> : left and right extension (in base-pairs) [default $defaults{radius}]
--window <int> : window-size of the region to assemble (in base-pairs) [default $defaults{windowSize}]
--step <int> : delta shift for the sliding window (in base-pairs) [default $defaults{delta}]
--mapscore <int> : minimum mapping quality for selecting reads to assemble [default $defaults{map_qual}]
--mismatches <int> : max number of mismatches in near-perfect repeat detection [default $defaults{maxmismatch}]
--dir <directory> : output directory [default $defaults{WORK}]
--numprocs <int> : number of parallel jobs (1 for no parallelization) [default $defaults{MAX_PROCESSES}]
--coords <file> : file with list of selected coordinates to examine [default $defaults{selected}]
Output:
--format : export mutations in selected format (annovar | vcf) [default $defaults{format}]
--intarget : export mutations only inside the target regions from the BED file
--mincov <int> : minimum coverage for exporting mutation to file [default $defaults{min_cov}]
--outratio <float> : minimum coverage ratio for exporting mutation to file (default: $defaults{outratio})
Note 1: the list of somatic INDELs is saved in file: OUTDIR/somatic.*.indel.*
where OUTDIR is the output directory selected with option "--dir" [default $defaults{WORK}]
Note 2: the input reference file (option "--ref") must be the same one that was used to create the BAM file.
END
exit;
}
#####################################################
#
# Message about this program and how to use it
#
sub usageExport() {
print STDERR <<END;
usage: ExportVariants.pl --db <file> --bed <BED file> [OPTIONS]
OPTIONS:
--help : this (help) message
--verbose : verbose mode
Required:
--db <file> : Database of mutations
--bed <file> : BED file with list of exome-target coordinates
Optional:
--format <text> : output format for variants (annovar | vcf) [default $defaults{format}]
--type <text> : mutation type (snp, del, ins, indel, all: everything) [default $defaults{SVtype}]
--mincov <int> : minimum coverage for a mutation to be exported [default $defaults{min_cov}]
--maxcov <int> : maximum coverage for a mutation to be exported [default $defaults{max_cov}]
--maxchi2 <float> : maximum chi-square score for a mutation to be exported [default $defaults{maxchi2}]
--covratio <float> : minimum coverage ratio (AlleleCov/TotCov) for a mutation to be exported to file [default $defaults{outratio}]
--intarget : export mutations only inside the target regions from the BED file
Supported output formats:
1. annovar
2. vcf
END
exit;
}
1;