Debian Codegraph @

README

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 pIRS (profile based Illumina pair-end Reads Simulator)
2
3 Contents
4 ========
5 1. Introduction
6 2. Program framework
7 3. Usage
8 4. Examples
9 5. Output file format
10 6. Notes
11
12 1 Introduction
13 ==============
14
15 pIRS is a program for simulating paired-end reads from a reference genome. It
16 is optimized for simulating reads similar to those generated from the Illumina
17 platform.
18
19 See `INSTALL' for installation instructions.
20
21 There are two subcommands: `pirs simulate' and `pirs diploid'. See section 3
22 for more details, or run `pirs simulate -h' or `pirs diploid -h'.
23
24 2 Program framework
25 ===================
26 2.1 Profile Generator
27 Six tools are supplied. SOAP2 or BWA, soap.coverage (http://soap.genomics.org.cn/soapaligner.html)
28 are required. The full process is shown in getprofile.sh.example as an example.
29 2.1.1 GC%-Depth Profile Stat.
30 a). Run soap and soap.coverage to get .depth single file(s). gzip is OK to over it.
31 b). Run gc_coverage_bias on all depth single files. You will get gc-depth stat by 1 GC% and other files.
32 c). Run gc_coverage_bias_plot on the gc-depth stat file. You'll get PNG plot and a .gc file by 5 GC%.
33 d). Manually check the .gc file for any abnormal levels due to the lower depth on certain GC% windows.
34 2.1.2 Base-Calling Profile Stat:
35 a). Run soap or bwa to get .{soap,single} or .sam file(s).
36 b). Run error_matrix_calculator on those file(s). You will get *.{count,ratio}.matrix .
37 c). You can use error_matrix_merger to merge several .{count,ratio}.matrix files.
38 However, it is up to you to keep the read length matches.
39 2.1.3 InDel Profile Stat:
40 a). Choose samples with NO polymorphism InDel, such as the Coliphage samples that shipped with Illumina Sequencers.
41 b). Run bwa to get .sam/.bam file.
42 c). Run indelstat_sam_bam to get the profile.
43 2.1.4 Insert size & mapping ratio stat:
44 a). Run soap or bwa to get .{soap,single} or .sam file(s).
45 b). Run alignment_stator *.
46 * alignment_stator cannot stat. mapping ratio for sam files now.
47 2.2 Simulator
48 Two commands:
49 pirs diploid: use for generating diploid genome sequence. Read the input genome sequence and
50 then simulate SNP, InDel, SV(structure variation) on it. At last, output the
51 result genome sequence.
52 pirs simulate: use for simulating Illumina data, output PE-read file.
53 Note:
54 a) If you only want to simulate the diploid genome sequence, "pirs diploid" is enough.
55 b) If you want to simulate sequencing data of haploid genome, only you need is "pirs simulate".
56 c) If you want to simulate sequencing data of diploid genome, you first need to run "pirs diploid"
57 to get the other diploid genome sequence, and then run "pirs simulate" using both the original
58 genome sequence and the previous output sequence as the input.
59
60 3 Usage
61 =======
62
63 pirs <command> [option]
64 diploid generate diploid genome.
65 simulate simulate Illumina reads.
66
67 3.1 pirs diploid
68 Usage: pirs diploid [OPTIONS...] REFERENCE
69
70 Simulate a diploid genome by creating a copy of a haploid genome with
71 heterozygosity introduced. REFERENCE specifies a FASTA file containing
72 the reference genome. It may be compressed (gzip). It may contain multiple
73 sequences (scaffolds or chromosomes), each marked with a separate FASTA tag
74 line. The introduced heterozygosity takes the form of SNPs, indels, and
75 large-scale structural variation (insertions, deletions and inversions).
76 If REFERENCE is '-', the reference sequence is read from stdin, but it must be
77 uncompressed.
78
79 The probabilities of SNPs, indels, and large-scale structural variation can be
80 specified with the '-s', '-d', and '-v' options, respectively. You can also
81 set the ratio of transitions to transversions (for SNPs) with the '-R' option.
82
83 Indels are split evenly between insertions and deletions. The length
84 distribution of the indels is as follows and is derived from panda
85 re-sequencing data:
86 1bp 64.82%
87 2bp 17.17%
88 3bp 7.20%
89 4bp 7.29%
90 5bp 2.18%
91 6bp 1.34%
92
93 Large-scale structural variation is split evenly among large-scale insertions,
94 deletions, and inversions. By default, the length distribution of these
95 large-scale features is as follows:
96 100bp 70%
97 200bp 20%
98 500bp 7%
99 1000bp 2%
100 2000bp 1%
101
102 `pirs diploid' does not use multiple threads, even if pIRS was configured with
103 --enable-multiple threads.
104
105 OPTIONS:
106 -s, --snp-rate=RATE A floating-point number in the interval [0, 1] that
107 specifies the heterozygous SNP rate. Default: 0.001
108
109 -d, --indel-rate=RATE A floating-point number in the interval [0, 1] that
110 specifies the heterozygous indel rate.
111 Default: 0.0001
112
113 -v, --sv-rate=RATE A floating-point number in the interval [0, 1] that
114 specifies the large-scale structural variation
115 (insertion, deletion, inversion) rate in the diploid
116 genome. Default: 0.000001
117
118 -R, --transition-to-transversion-ratio=RATIO
119 In a SNP, a transition is when a purine or pyrimidine
120 is changed to one of the same (A <=> G, C <=> T)
121 while a transversion is when a purine is changed
122 into a pyrimidine or vice-versa. This option
123 specifies a floating-point number RATIO that gives
124 the ratio of the transition probability to the
125 transversion probability for simulated SNPs.
126 Default: 2.0
127
128 -o, --output-prefix=PREFIX
129 Use PREFIX as the prefix of the output file and logs.
130 Default: "pirs_diploid"
131
132 -O, --output-file=FILE
133 Use FILE as the name of the output file. Use '-'
134 for standard output; this also moves the
135 informational messages from stdout to stderr.
136
137 -c, --output-file-type=TYPE
138 The string "text" or "gzip" to specify the type of
139 the output FASTA file containing the diploid copy
140 of the genome, as well as the log files.
141 Default: "text"
142
143 -n, --no-logs Do not write the log files.
144
145 -S, --random-seed=SEED Use SEED as the random seed. Default:
146 time(NULL) * getpid()
147
148 -q, --quiet Do not print informational messages.
149
150 -h, --help Show this help and exit.
151
152 -V, --version Show version information and exit.
153
154 EXAMPLE:
155 ./pirs diploid ref_sequence.fa -s 0.001 -d 0.0001 -v 0.000001\
156 -o ref_sequence >pirs.out 2>pirs.err
157
158 3.2 pirs simulate
159
160 Usage: ./pirs simulate [OPTION]... REFERENCE.FASTA...
161
162 pIRS is a program for simulating paired-end reads from a genome. It is
163 optimized for simulating reads from the Illumina platform. The input to
164 pIRS is any number of reference sequences. Typically you would just provide
165 one FASTA file containing your reference sequence, but you may provide two
166 if you have generated a diploid sequence with `pirs diploid', or if you have
167 chromosomes split up into multiple FASTA files. The output of pIRS is two
168 FASTQ files containing the simulated paired-end reads, as well as several log
169 files.
170
171 Input sequences are assumed to be haploid. If you instead want to simulate
172 reads from a diploid genome, you must give the --diploid option so that
173 the diploidy is taken into account when computing coverage. If you do
174 not do this, you will get twice as many reads as you wanted.
175
176 pIRS simulates a normally-distributed insert (fragment) length using the
177 Box-muller method. Usually you want the insert length standard deviation to
178 be 1/20 or 1/10 of the insert length mean (see the -m and -v options).
179 This program also simulates Illumina sequencing error, quality score and
180 GC bias based on empirical distribution profiles. Users may use the default
181 profiles in this package, which are generated by large real sequencing data,
182 or they may generate their own profiles.
183
184 OPTIONS:
185 -l LEN, --read-len=LEN
186 Generate reads having a length of LEN. Default: 100
187
188 -x VAL, --coverage=VAL
189 Set the average sequencing coverage (sometimes called depth).
190 It may be either a floating-point number or an integer.
191
192 -m LEN, --insert-len-mean=LEN
193 Generate inserts (fragments) having an average length of LEN.
194 Default: 180
195
196 -v LEN, --insert-len-sd=LEN
197 Set the standard deviation of the insert (fragment) length.
198 Default: 10% of insert length mean.
199
200 -j, --jumping, --cyclicize
201 Make the paired-end reads face away from either other, as
202 in a jumping library. Default: the reads face towards each
203 other.
204
205 -d, --diploid
206 This option asserts that reads are being simulated from a
207 diploid genome. It causes the program to abort if there
208 are not exactly two reference sequences; in addition, the
209 coverage is divided in half, since the two reference
210 sequences are in reality the same genome. This option
211 is not required to simulate diploid reads, but you must
212 set the coverage correctly otherwise (it will be half
213 as much as you think).
214
215 -B FILE, --base-calling-profile=FILE, --subst-error-profile=FILE
216 Use FILE as the base-calling profile. This profile will be
217 used to simulate substitution errors. Default:
218 PREFIX/share/pirs/Base-Calling_Profiles/humNew.PE100.matrix.gz
219
220 -I FILE, --indel-error-profile=FILE, --indel-profile=FILE
221 Use FILE as the indel-error profile. This profile will be
222 used to simulate insertions and deletions in the reads that
223 are artifacts of the sequencing process. Default:
224 PREFIX/share/pirs/InDel_Profiles/phixv2.InDel.matrix
225
226 -G FILE, --gc-bias-profile=FILE, --gc-content-bias-profile=FILE
227 Use FILE as the GC content bias profile. This profile will
228 adjust the read coverage based on the GC content of
229 fragments. Defaults:
230 PREFIX/share/pirs/GC-depth_Profiles/humNew.gcdep_100.dat,
231 PREFIX/share/pirs/GC-depth_Profiles/humNew.gcdep_150.dat,
232 PREFIX/share/pirs/GC-depth_Profiles/humNew.gcdep_200.dat,
233 depending on the mean insert length.
234
235 -e FILE, --error-rate=RATE, --subst-error-rate=RATE
236 Set the substitution error rate. The base-calling profile
237 will still be used, but the average frequency of errors will
238 be changed to RATE. Set to 0 to disable substitution errors
239 completely. In that case, the base-calling profile will not
240 be used. Default: default error rate of base-calling
241 profile.
242
243 Note: since pIRS parameterizes the error rate by
244 several parameters, it is very difficult to determine exactly
245 what needs to be done to make the error rate be a given
246 value. We try to adjust the probabilities of getting each
247 quality score in order to accomodate the user-supplied error
248 rate. However, depending on your input sequences, the actual
249 error rate simulated by pIRS could be off by 20% or more.
250 Please check the informational output to see the final error
251 rate that was actually simulated.
252
253 -A ALGO, --substitution-error-algorithm=ALGO, --subst-error-algo=ALGO
254 Set the algorithm used for simulating substitition errors.
255 It may be set to the string "dist" or "qtrans". The
256 default is "qtrans".
257
258 The "dist" algorithm looks up the substitution error rate
259 for each base pair based on the current cycle and the true
260 base. This lookup produces a quality score and a called base
261 that may or may not be the same as the true base. In the
262 base-calling profile, the matrix we use is marked as the
263 [DistMatrix].
264
265 The "qtrans" algorithm is a Markov-chain model based on the
266 previous quality score and current cycle. The next quality
267 score is looked up with a certain probability based on these
268 parameters. The matrix used for this is marked as
269 [QTransMatrix] in the base-calling profile. Then, the the
270 DistMatrix is used to find a called base for the quality score.
271 The DistMatrix is also used to call the base in the first
272 cycle.
273
274 -M MODE, --mask=MODE, --eamss=MODE
275 Use the EAMSS algorithm for masking read quality. MODE may be
276 the string "quality" or "lowercase". The EAMSS algorithm
277 identifies low-quality, GC-rich regions near the ends of reads.
278 "quality" mode will change the quality scores on these
279 regions to (2 + quality_shift), while "lowercase" mode
280 will change the base pairs to lower case, but not change
281 the quality values. Default: Do not use EAMSS.
282
283 -Q VAL, --quality-shift=VAL, --phred-offset=VAL
284 Set the ASCII shift of the quality value (usually 64 or 33 for
285 Illumina data). Default: 33
286
287 --no-quality-values
288 --fasta
289 Do not simulate quality values. The simulated reads will be
290 written as a FASTA file rather than a FASTQ file.
291 Substitution errors may still be done; if you do not want
292 to simulate any substition errors, provide --error-rate=0 or
293 --no-substitution-errors.
294
295 --no-subst-errors
296 --no-substitution-errors
297 Do not simulate substitution errors. Equivalent to
298 --error-rate=0.
299
300 --no-indels
301 --no-indel-errors
302 Do not simulate indels. The indel error profile will not be
303 used.
304
305 --no-gc-bias
306 --no-gc-content-bias
307 Do not simulate GC bias. The GC bias profile will not be
308 used.
309
310 -o PREFIX, --output-prefix=PREFIX
311 Use PREFIX as the prefix of the output files. Default:
312 "pirs_reads"
313
314 -c TYPE, --output-file-type=TYPE
315 The string "text" or "gzip" to specify the type of
316 the output FASTQ files containing the simulated reads
317 of the genome, as well as the log files. Default: "text"
318
319 -z, --compress
320 Equivalent to -c gzip.
321
322 -n, --no-logs, --no-log-files
323 Do not write the log files.
324
325 -S SEED, --random-seed=SEED
326 Use SEED as the random seed. Default:
327 time(NULL) * getpid(). Note: If pIRS was not compiled with
328 --disable-threads, each thread actually uses its own random
329 number generator that is seeded by this base seed added to
330 the thread number; also, if you need pIRS's output to be
331 exactly reproducible, you must specify the random seed as well
332 as use only 1 simulator thread (--threads=1, or configure
333 with --disable-threads, or run on system with 4 or fewer
334 processors).
335
336 -t, --threads=NUM_THREADS
337 Use NUM_THREADS threads to simulate reads. This option is
338 not available if pIRS was compiled with the --disable-threads
339 option. Default: number of processors minus 2 if writing
340 uncompressed output, or number of processors minus 3 if
341 writing compressed output, or 1 if there are not this many
342 processors
343
344 -q, --quiet Do not print informational messages.
345
346 -h, --help Show this help and exit.
347
348 -V, --version Show version information and exit.
349
350
351 4 Examples
352 ==============
353 4.1 Simulating a diploid genome sequence.
354 Example command line:
355 pirs diploid Human_ref.fa -s 0.001 -R 2 -d 0.00001 -v 0.000001 -o Human >simulate_seq.o 2>simulate_seq.e
356 Output files:
357 a) Human.snp.indel.invertion.fa: another diploid genome sequence.
358 b) Human_indel.lst: InDel information list.
359 c) Human_snp.lst: SNP information list.
360 d) Human_invertion.lst: invertion information list.
361 e) simulate_seq.o, simulate_seq.e: records of the program running information.
362 4.2 Simulate Illumina paired-end reads from a haploid genome.
363 Example command line:
364 pirs simulate Human_ref.fa -m 170 -l 90 -x 5 -v 10 -o Human >simulate_170.o 2>simulate_170.e
365 Output files:
366 a) Human_90_170_1.fq, Human_90_170_2.fq: the paired-end read files.
367 b) Human_90_170.error_rate.distr: the error distribution file.
368 c) Human_90_170.insert_len.distr: the insert length distribution file.
369 d) Human_90_170.read.info: information about every simulated reads
370 e) simulate_170.o, simulate_170.e: records of the program running information.
371 4.3 Simulate Illumina paired-end reads from a diploid genome.
372 Example command line:
373 pirs simulate --diploid Human_ref.fa Human.snp.indel.invertion.fa.gz -m 800 -l 70 -x 5 -v 10
374 -o Human >simulate_800.o 2>simulate_800.e
375 Output files:
376 a) Human_70_800_1.fq, Human_70_800_2.fq: the pair-end read files.
377 b) Human_70_800.error_rate.distr: the error distribution file.
378 c) Human_70_800.insertsize.distr: the insert size distribution file.
379 d) Human_70_800.read.info.gz: record the information of every reads.
380 e) simulate_800.e, simulate_800.o: records of the program running information.
381
382 5 Output file format
383 ====================
384 a) *.fq/*.fq.gz
385
386 FASTQ files containing the simulated reads. The files are given names
387 similar to PREFIX_70_800_1.fq, where PREFIX is the prefix provided by the -o
388 option (default: "pirs_reads"), 70 is the read length, 800 is the mean
389 insert length, and 1 means the file for read 1 of the read pairs. These
390 files will be written as GZIP files with the .gz suffix if you provide the
391 `-c gzip' option.
392
393 @read_800_21/1
394 ACGGAAAAGTTACGCTATCGCATGCGTGTAAGAACACTGCTCCTACGCCCATTTTATCGATGGCGCCCAG
395 +
396 egcggdggfgfgggggfeggggYbcgegfgggbggg^e]egfegggfbSeggdggegg`^eJgggcbEeb
397 @read_800_22/1
398 CACGGGGGGACTTTATTTAATGAGCGGCTGTAACTTGGTCCGTCGTTTGAGAGGGGACACCTCATATGAT
399 +
400 gggggegcgeggggcgfcgc_gf_ggfefcgVgegcfcdgf`geggdd[ge`ggafeggggdgdgee^gg
401
402 b) *.read.info
403
404 Information about each simulated read.
405
406 Column 1: reads ID.
407 Column 2: Name of the reference file; this is mainly provided so that you
408 tell which chromosome set a read came from if you simulate reads
409 from a diploid genome produced with the `pirs diploid' command.
410 Column 3: FASTA/FASTQ sequence ID of the contig/scaffold/chromosome.
411 Column 4: position(1-based) in chromosome.
412 Column 5: "+" forward direction; "-" reverse direction.
413 Column 6: real insert size.
414 Column 7: length of read-end masking by EAMSS algorithm.
415 Column 8: read-position(1-based) of substitution error and raw base(->)error base.
416 Column 9: read-position(1-based) of insertion error and the base of insertion.
417 Column 10: read-position(1-based) of deletion error and the base of deletion
418
419 c) *_snp.lst
420 For example:
421
422 I 3 3 G A
423 I 45342 45355 C T
424 I 104775 104680 C T
425 .....
426 Column 1: chromosome sequence ID.
427 Column 2: position(1-based) of SNP in reference chromosome.
428 Column 3: position(1-based) of SNP in simulated diploid chromosome.
429 Column 4: base of reference chromosome sequence.
430 Column 5: the base of SNP.
431
432 d) *_indel.lst
433 For example:
434 I - 3 1 C
435 IV + 5 2 AC
436 .....
437 Column 1: chromosomesequence ID.
438 Column 2: "-" Deletion; "+" Insertion.
439 Column 3: position(1-based) of InDel in the reference chromosome sequence.
440 For deletions, it is the position of the first deleted base. For
441 insertions, it is the position of the reference base corresponding
442 to the base directly before the insertion.
443 Column 4: position(1-based) of InDel in the diploid sequence. For
444 deletions, it is the position of the diploid sequence base
445 corresponding to the reference base directly before the deletion.
446 For insertions, it is the position of the first inserted base.
447 Column 5: length of InDel (always positive).
448 Column 6: sequence of the InDel.
449
450 I - 3 3 1 C
451 Ref: a t G c a // 3 is the position of G base in the chromosome base.
452 : a t G - a // following the G base is a deletion of "C" base.
453 IV + 5 5 2 A C
454 Ref: t t g c A - - g t t// 5 is the position of A base in the chromosome base.
455 : t t g c A A C g t t// following the A base is a insertion of "AC" bases.
456
457 e) *_inversion.lst
458 For example:
459 I 50191 50195 100
460 I 948984 948903 200
461 Column 1: chromosome sequence ID.
462 Column 2: position(1-based) of beginning of inversion in the reference
463 chromosome sequence.
464 Column 3: position(1-based) of beginning of inversion of the diploid
465 chromosome sequence.
466 Column 3: length of inversion.
467
468 6 Notes
469 ======
470 a) pIRS does not simulate reads containing "N" char. If your input reference
471 contains the "N" character, reads generated in this in this region will be
472 discarded.
473 b) When running a simulation without the --no-subst-errors option, the maximum
474 length of the simulated reads depends on the number of cycles recorded in
475 the base-calling profile. The user must set the read length to no more
476 than half the number of cycles recorded in the base-calling profile.
477 c) When masking quality values, the program uses the same EAMSS algorithm
478 from CASAVA v1.8.0. This is only done if the --eamss option is supplied.
479 d) The program parses one chromosome at a time. Reads are evenly distributed
480 among the chromosomes.
481 e) To re-do a simulation and get the exact same results, you must set the
482 random seed with the -S parameter. In addition, you must use the
483 single-threaded version of pIRS, or else set --threads=4 (for only one
484 simulator thread).
485 f) pIRS will shift quality values when the substitution-error rate setting by
486 user is different from that in profile. The quality score in the output
487 data range from 2 to the maximum score of profile. You can find the real
488 substitution-error rate of output data in file *.error_rate.distr.
489
490 For update & support, please refer to http://code.google.com/p/pirs/ .
491