-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.htm
864 lines (815 loc) · 39.2 KB
/
README.htm
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>grinder - A versatile omics shotgun and amplicon sequencing read simulator</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#citation">CITATION</a></li>
<li><a href="#version">VERSION</a></li>
<li><a href="#author">AUTHOR</a></li>
<li><a href="#installation">INSTALLATION</a></li>
<ul>
<li><a href="#dependencies">Dependencies</a></li>
<li><a href="#procedure">Procedure</a></li>
<li><a href="#no_administrator_privileges">No administrator privileges?</a></li>
</ul>
<li><a href="#running_grinder">RUNNING GRINDER</a></li>
<li><a href="#reference_sequence_database">REFERENCE SEQUENCE DATABASE</a></li>
<li><a href="#cli_examples">CLI EXAMPLES</a></li>
<li><a href="#cli_required_arguments">CLI REQUIRED ARGUMENTS</a></li>
<li><a href="#cli_optional_arguments">CLI OPTIONAL ARGUMENTS</a></li>
<li><a href="#cli_output">CLI OUTPUT</a></li>
<li><a href="#api_examples">API EXAMPLES</a></li>
<li><a href="#api_methods">API METHODS</a></li>
<ul>
<li><a href="#new">new</a></li>
<li><a href="#next_lib">next_lib</a></li>
<li><a href="#next_read">next_read</a></li>
<li><a href="#get_random_seed">get_random_seed</a></li>
</ul>
<li><a href="#copyright">COPYRIGHT</a></li>
<li><a href="#bugs">BUGS</a></li>
</ul>
<hr name="index" />
</div>
<!-- INDEX END -->
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>grinder - A versatile omics shotgun and amplicon sequencing read simulator</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>Grinder is a versatile program to create random shotgun and amplicon sequence
libraries based on DNA, RNA or proteic reference sequences provided in a FASTA
file.</p>
<p>Grinder can produce genomic, metagenomic, transcriptomic, metatranscriptomic,
proteomic, metaproteomic shotgun and amplicon datasets from current sequencing
technologies such as Sanger, 454, Illumina. These simulated datasets can be used
to test the accuracy of bioinformatic tools under specific hypothesis, e.g. with
or without sequencing errors, or with low or high community diversity. Grinder
may also be used to help decide between alternative sequencing methods for a
sequence-based project, e.g. should the library be paired-end or not, how many
reads should be sequenced.</p>
<p>Grinder features include:</p>
<ul>
<li>
<p>shotgun or amplicon read libraries</p>
</li>
<li>
<p>omics support to generate genomic, transcriptomic, proteomic,
metagenomic, metatranscriptomic or metaproteomic datasets</p>
</li>
<li>
<p>arbitrary read length distribution and number of reads</p>
</li>
<li>
<p>simulation of PCR and sequencing errors (chimeras, point mutations, homopolymers)</p>
</li>
<li>
<p>support for paired-end (mate pair) datasets</p>
</li>
<li>
<p>specific rank-abundance settings or manually given abundance for each genome, gene or protein</p>
</li>
<li>
<p>creation of datasets with a given richness (alpha diversity)</p>
</li>
<li>
<p>independent datasets can share a variable number of genomes (beta diversity)</p>
</li>
<li>
<p>modeling of the bias created by varying genome lengths or gene copy number</p>
</li>
<li>
<p>profile mechanism to store preferred options</p>
</li>
<li>
<p>available to biologists or power users through multiple interfaces: GUI, CLI and API</p>
</li>
</ul>
<p>Briefly, given a FASTA file containing reference sequence (genomes, genes,
transcripts or proteins), Grinder performs the following steps:</p>
<ol>
<li>
<p>Read the reference sequences, and for amplicon datasets, extracts full-length
reference PCR amplicons using the provided degenerate PCR primers.</p>
</li>
<li>
<p>Determine the community structure based on the provided alpha diversity (number
of reference sequences in the library), beta diversity (number of reference
sequences in common between several independent libraries) and specified rank-
abundance model.</p>
</li>
<li>
<p>Take shotgun reads from the reference sequences or amplicon reads from the full-
length reference PCR amplicons. The reads may be paired-end reads when an insert
size distribution is specified. The length of the reads depends on the provided
read length distribution and their abundance depends on the relative abundance
in the community structure. Genome length may also biases the number of reads to
take for shotgun datasets at this step. Similarly, for amplicon datasets, the
number of copies of the target gene in the reference genomes may bias the number
of reads to take.</p>
</li>
<li>
<p>Alter reads by inserting sequencing errors (indels, substitutions and homopolymer
errors) following a position-specific model to simulate reads created by current
sequencing technologies (Sanger, 454, Illumina). Write the reads and their
quality scores in FASTA, QUAL and FASTQ files.</p>
</li>
</ol>
<p>
</p>
<hr />
<h1><a name="citation">CITATION</a></h1>
<p>If you use Grinder in your research, please cite:</p>
<pre>
Angly FE, Willner D, Rohwer F, Hugenholtz P, Tyson GW (2012), Grinder: a
versatile amplicon and shotgun sequence simulator, Nucleic Acids Reseach</pre>
<p>Available from <a href="http://dx.doi.org/10.1093/nar/gks251">http://dx.doi.org/10.1093/nar/gks251</a>.</p>
<p>
</p>
<hr />
<h1><a name="version">VERSION</a></h1>
<p>This document refers to grinder version 0.5.2</p>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Florent Angly <<a href="mailto:florent.angly@gmail.com">florent.angly@gmail.com</a>></p>
<p>
</p>
<hr />
<h1><a name="installation">INSTALLATION</a></h1>
<p>
</p>
<h2><a name="dependencies">Dependencies</a></h2>
<p>You need to install these dependencies first:</p>
<ul>
<li>
<p>Perl (>= 5.6)</p>
<p><a href="http://www.perl.com/download.csp">http://www.perl.com/download.csp</a></p>
</li>
<li>
<p>make</p>
<p>Many systems have make installed by default. If your system does not, you should
install the implementation of make of your choice, e.g. GNU make: <a href="http://www.gnu.org/s/make/">http://www.gnu.org/s/make/</a></p>
</li>
</ul>
<p>The following CPAN Perl modules are dependencies that will be installed automatically
for you:</p>
<ul>
<li>
<p>Bioperl modules (>=1.6.901).</p>
<p>Note that some unreleased Bioperl modules have been included in Grinder.</p>
</li>
<li>
<p>Getopt::Euclid (>= 0.3.4)</p>
</li>
<li>
<p>List::Util</p>
<p>First released with Perl v5.7.3</p>
</li>
<li>
<p>Math::Random::MT (>= 1.13)</p>
</li>
<li>
<p>version (>= 0.77)</p>
<p>First released with Perl v5.9.0</p>
</li>
</ul>
<p>
</p>
<h2><a name="procedure">Procedure</a></h2>
<p>To install Grinder globally on your system, run the following commands in a
terminal or command prompt:</p>
<p>On Linux, Unix, MacOS:</p>
<pre>
perl Makefile.PL
make</pre>
<p>And finally, with administrator privileges:</p>
<pre>
make install</pre>
<p>On Windows, run the same commands but with nmake instead of make.</p>
<p>
</p>
<h2><a name="no_administrator_privileges">No administrator privileges?</a></h2>
<p>If you do not have administrator privileges, Grinder needs to be installed in
your home directory.</p>
<p>First, follow the instructions to install local::lib
at <a href="http://search.cpan.org/~apeiron/local-lib-1.008004/lib/local/lib.pm#The_bootstrapping_technique">http://search.cpan.org/~apeiron/local-lib-1.008004/lib/local/lib.pm#The_bootstrapping_technique</a>. After local::lib is installed, every Perl
module that you install manually or through the CPAN command-line application
will be installed in your home directory.</p>
<p>Then, install Grinder by following the instructions detailed in the "Procedure"
section.</p>
<p>
</p>
<hr />
<h1><a name="running_grinder">RUNNING GRINDER</a></h1>
<p>After installation, you can run Grinder using a command-line interface (CLI),
an application programming interface (API) or a graphical user interface (GUI)
in Galaxy.</p>
<p>To get the usage of the CLI, type:</p>
<pre>
grinder --help</pre>
<p>More information, including the documentation of the Grinder API, which allows
you to run Grinder from within other Perl programs, is available by typing:</p>
<pre>
perldoc Grinder</pre>
<p>To run the GUI, refer to the Galaxy documentation at <a href="http://wiki.g2.bx.psu.edu/FrontPage">http://wiki.g2.bx.psu.edu/FrontPage</a>.</p>
<p>The 'utils' folder included in the Grinder package contains some utilities:</p>
<dl>
<dt><strong><a name="average_genome_size" class="item">average genome size:</a></strong></dt>
<dd>
<p>This calculates the average genome size (in bp) of a simulated random library
produced by Grinder.</p>
</dd>
<dt><strong><a name="change_paired_read_orientation" class="item">change_paired_read_orientation:</a></strong></dt>
<dd>
<p>This reverses the orientation of each second mate-pair read (ID ending in /2)
in a FASTA file.</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="reference_sequence_database">REFERENCE SEQUENCE DATABASE</a></h1>
<p>A variety of FASTA databases can be used as input for Grinder. For example, the
GreenGenes database (<a href="http://greengenes.lbl.gov/Download/Sequence_Data/Fasta_data_files/Isolated_named_strains_16S_aligned.fasta">http://greengenes.lbl.gov/Download/Sequence_Data/Fasta_data_files/Isolated_named_strains_16S_aligned.fasta</a>)
contains over 180,000 16S rRNA clone sequences from various species which would
be appropriate to produce a 16S rRNA amplicon dataset. A set of over 41,000 OTU
representative sequences and their affiliation in seven different taxonomic
sytems can also be used for the same purpose (<a href="http://greengenes.lbl.gov/Download/OTUs/gg_otus_6oct2010/rep_set/gg_97_otus_6oct2010.fasta">http://greengenes.lbl.gov/Download/OTUs/gg_otus_6oct2010/rep_set/gg_97_otus_6oct2010.fasta</a>
and <a href="http://greengenes.lbl.gov/Download/OTUs/gg_otus_6oct2010/taxonomies/">http://greengenes.lbl.gov/Download/OTUs/gg_otus_6oct2010/taxonomies/</a>). The
RDP (<a href="http://rdp.cme.msu.edu/download/release10_27_unaligned.fa.gz">http://rdp.cme.msu.edu/download/release10_27_unaligned.fa.gz</a>) and Silva
(<a href="http://www.arb-silva.de/no_cache/download/archive/release_108/Exports/">http://www.arb-silva.de/no_cache/download/archive/release_108/Exports/</a>)
databases also provide many 16S rRNA sequences and Silva includes eukaryotic
sequences. While 16S rRNA is a popular gene, datasets containing any type of gene
could be used in the same fashion to generate simulated amplicon datasets, provided
appropriate primers are used.</p>
<p>The >2,400 curated microbial genome sequences in the NCBI RefSeq collection
(<a href="ftp://ftp.ncbi.nih.gov/refseq/release/microbial/">ftp://ftp.ncbi.nih.gov/refseq/release/microbial/</a>) would also be suitable for
producing 16S rRNA simulated datasets (using the adequate primers). However, the
lower diversity of this database compared to the previous two makes it more
appropriate for producing artificial microbial metagenomes. Individual genomes
from this database are also very suitable for the simulation of single or
double-barreled shotgun libraries. Similarly, the RefSeq database contains
over 3,100 curated viral sequences (<a href="ftp://ftp.ncbi.nih.gov/refseq/release/viral/">ftp://ftp.ncbi.nih.gov/refseq/release/viral/</a>)
which can be used to produce artificial viral metagenomes.</p>
<p>Quite a few eukaryotic organisms have been sequenced and their genome or genes
can be the basis for simulating genomic, transcriptomic (RNA-seq) or proteomic
datasets. For example, you can use the human genome available at
<a href="ftp://ftp.ncbi.nih.gov/refseq/H_sapiens/RefSeqGene/">ftp://ftp.ncbi.nih.gov/refseq/H_sapiens/RefSeqGene/</a>, the human transcripts
downloadable from <a href="ftp://ftp.ncbi.nih.gov/refseq/H_sapiens/mRNA_Prot/human.rna.fna.gz">ftp://ftp.ncbi.nih.gov/refseq/H_sapiens/mRNA_Prot/human.rna.fna.gz</a>
or the human proteome at <a href="ftp://ftp.ncbi.nih.gov/refseq/H_sapiens/mRNA_Prot/human.protein.faa.gz">ftp://ftp.ncbi.nih.gov/refseq/H_sapiens/mRNA_Prot/human.protein.faa.gz</a>.</p>
<p>
</p>
<hr />
<h1><a name="cli_examples">CLI EXAMPLES</a></h1>
<p>Here are a few examples that illustrate the use of Grinder in a terminal:</p>
<ol>
<li>
<p>A shotgun DNA library with a coverage of 0.1X</p>
<pre>
grinder -reference_file genomes.fna -coverage_fold 0.1</pre>
</li>
<li>
<p>Same thing but save the result files in a specific folder and with a specific name</p>
<pre>
grinder -reference_file genomes.fna -coverage_fold 0.1 -base_name my_name -output_dir my_dir</pre>
</li>
<li>
<p>A DNA shotgun library with 1000 reads</p>
<pre>
grinder -reference_file genomes.fna -total_reads 1000</pre>
</li>
<li>
<p>A DNA shotgun library where species are distributed according to a power law</p>
<pre>
grinder -reference_file genomes.fna -abundance_model powerlaw 0.1</pre>
</li>
<li>
<p>A DNA shotgun library with 123 genomes taken random from the given genomes</p>
<pre>
grinder -reference_file genomes.fna -diversity 123</pre>
</li>
<li>
<p>Two DNA shotgun libraries that have 50% of the species in common</p>
<pre>
grinder -reference_file genomes.fna -num_libraries 2 -shared_perc 50</pre>
</li>
<li>
<p>Two DNA shotgun library with no species in common and distributed according to a
exponential rank-abundance model. Note that because the parameter value for the
exponential model is omitted, each library uses a different randomly chosen value:</p>
<pre>
grinder -reference_file genomes.fna -num_libraries 2 -abundance_model exponential</pre>
</li>
<li>
<p>A DNA shotgun library where species relative abundances are manually specified</p>
<pre>
grinder -reference_file genomes.fna -abundance_file my_abundances.txt</pre>
</li>
<li>
<p>A DNA shotgun library with Sanger reads</p>
<pre>
grinder -reference_file genomes.fna -read_dist 800 -mutation_dist linear 1 2 -mutation_ratio 80 20</pre>
</li>
<li>
<p>A DNA shotgun library with first-generation 454 reads</p>
<pre>
grinder -reference_file genomes.fna -read_dist 100 normal 10 -homopolymer_dist balzer</pre>
</li>
<li>
<p>A paired-end DNA shotgun library, where the insert size is normally distributed
around 2.5 kbp and has 0.2 kbp standard deviation</p>
<pre>
grinder -reference_file genomes.fna -insert_dist 2500 normal 200</pre>
</li>
<li>
<p>A transcriptomic dataset</p>
<pre>
grinder -reference_file transcripts.fna</pre>
</li>
<li>
<p>A unidirectional transcriptomic dataset</p>
<pre>
grinder -reference_file transcripts.fna -unidirectional 1</pre>
<p>Note the use of -unidirectional 1 to prevent reads to be taken from the reverse-
complement of the reference sequences.</p>
</li>
<li>
<p>A proteomic dataset</p>
<pre>
grinder -reference_file proteins.faa -unidirectional 1</pre>
</li>
<li>
<p>A 16S rRNA amplicon library</p>
<pre>
grinder -reference_file 16Sgenes.fna -forward_reverse 16Sprimers.fna -length_bias 0 -unidirectional 1</pre>
<p>Note the use of -length_bias 0 because reference sequence length should not affect
the relative abundance of amplicons.</p>
</li>
<li>
<p>The same amplicon library with 20% of chimeric reads (90% bimera, 10% trimera)</p>
<pre>
grinder -reference_file 16Sgenes.fna -forward_reverse 16Sprimers.fna -length_bias 0 -unidirectional 1 -chimera_perc 20 -chimera_dist 90 10</pre>
</li>
<li>
<p>Three 16S rRNA amplicon libraries with specified MIDs and no reference sequences
in common</p>
<pre>
grinder -reference_file 16Sgenes.fna -forward_reverse 16Sprimers.fna -length_bias 0 -unidirectional 1 -num_libraries 3 -multiplex_ids MIDs.fna</pre>
</li>
<li>
<p>Reading reference sequences from the standard input, which allows you to
decompress FASTA files on the fly:</p>
<pre>
zcat microbial_db.fna.gz | grinder -reference_file - -total_reads 100</pre>
</li>
</ol>
<p>
</p>
<hr />
<h1><a name="cli_required_arguments">CLI REQUIRED ARGUMENTS</a></h1>
<dl>
<dt><strong><a name="rf_reference_file_reference_file_reference_file_gf_reference_file_genome_file_reference_file" class="item">-rf <reference_file> | -reference_file <reference_file> | -gf <reference_file> | -genome_file <reference_file></a></strong></dt>
<dd>
<p>FASTA file that contains the input reference sequences (full genomes, 16S rRNA
genes, transcripts, proteins...) or '-' to read them from the standard input. See the
README file for examples of databases you can use and where to get them from.
Default: -</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="cli_optional_arguments">CLI OPTIONAL ARGUMENTS</a></h1>
<dl>
<dt><strong><a name="tr_total_reads_total_reads_total_reads" class="item">-tr <total_reads> | -total_reads <total_reads></a></strong></dt>
<dd>
<p>Number of shotgun or amplicon reads to generate for each library. Do not specify
this if you specify the fold coverage. Default: 100</p>
</dd>
<dt><strong><a name="cf_coverage_fold_coverage_fold_coverage_fold" class="item">-cf <coverage_fold> | -coverage_fold <coverage_fold></a></strong></dt>
<dd>
<p>Desired fold coverage of the input reference sequences (the output FASTA length
divided by the input FASTA length). Do not specify this if you specify the number
of reads directly.</p>
</dd>
<dt><strong><a name="rd_read_dist_read_dist_read_dist" class="item">-rd <read_dist>... | -read_dist <read_dist>...</a></strong></dt>
<dd>
<p>Desired shotgun or amplicon read length distribution specified as:
average length, distribution ('uniform' or 'normal') and standard deviation.</p>
<p>Only the first element is required. Examples:</p>
<pre>
All reads exactly 101 bp long (Illumina GA 2x): 101
Uniform read distribution around 100+-10 bp: 100 uniform 10
Reads normally distributed with an average of 800 and a standard deviation of 100
bp (Sanger reads): 800 normal 100
Reads normally distributed with an average of 450 and a standard deviation of 50
bp (454 GS-FLX Ti): 450 normal 50</pre>
<p>Reference sequences smaller than the specified read length are not used. Default:
100</p>
</dd>
<dt><strong><a name="id_insert_dist_insert_dist_insert_dist" class="item">-id <insert_dist>... | -insert_dist <insert_dist>...</a></strong></dt>
<dd>
<p>Create paired-end or mate-pair reads spanning the given insert length.
Important: the insert is defined in the biological sense, i.e. its length includes
the length of both reads and of the stretch of DNA between them:
0 : off,
or: insert size distribution in bp, in the same format as the read length
distribution (a typical value is 2,500 bp for mate pairs)
Two distinct reads are generated whether or not the mate pair overlaps. Default:
0</p>
</dd>
<dt><strong><a name="mo_mate_orientation_mate_orientation_mate_orientation" class="item">-mo <mate_orientation> | -mate_orientation <mate_orientation></a></strong></dt>
<dd>
<p>When generating paired-end or mate-pair reads (see <insert_dist>), specify the
orientation of the reads (F: forward, R: reverse):</p>
<pre>
FR: ---> <--- e.g. Sanger, Illumina paired-end, IonTorrent mate-pair
FF: ---> ---> e.g. 454
RF: <--- ---> e.g. Illumina mate-pair
RR: <--- <---</pre>
<p>Default: FR</p>
</dd>
<dt><strong><a name="ec_exclude_chars_exclude_chars_exclude_chars" class="item">-ec <exclude_chars> | -exclude_chars <exclude_chars></a></strong></dt>
<dd>
<p>Do not create reads containing any of the specified characters (case insensitive).
For example, use 'NX' to prevent reads with ambiguities (N or X). Grinder will
error if it fails to find a suitable read (or pair of reads) after 10 attempts.
Consider using <delete_chars>, which may be more appropriate for your case.
Default: ''</p>
</dd>
<dt><strong><a name="dc_delete_chars_delete_chars_delete_chars" class="item">-dc <delete_chars> | -delete_chars <delete_chars></a></strong></dt>
<dd>
<p>Remove the specified characters from the reference sequences (case-insensitive),
e.g. '-~*' to remove gaps (- or ~) or terminator (*). Removing these characters
is done once, when reading the reference sequences, prior to taking reads. Hence
it is more efficient than <exclude_chars>. Default:</p>
</dd>
<dt><strong><a name="fr_forward_reverse_forward_reverse_forward_reverse" class="item">-fr <forward_reverse> | -forward_reverse <forward_reverse></a></strong></dt>
<dd>
<p>Use DNA amplicon sequencing using a forward and reverse PCR primer sequence
provided in a FASTA file. The reference sequences and their reverse complement
will be searched for PCR primer matches. The primer sequences should use the
IUPAC convention for degenerate residues and the reference sequences that that
do not match the specified primers are excluded. If your reference sequences are
full genomes, it is recommended to use <copy_bias> = 1 and <length_bias> = 0 to
generate amplicon reads. To sequence from the forward strand, set <unidirectional>
to 1 and put the forward primer first and reverse primer second in the FASTA
file. To sequence from the reverse strand, invert the primers in the FASTA file
and use <unidirectional> = -1. The second primer sequence in the FASTA file is
always optional. Example: AAACTYAAAKGAATTGRCGG and ACGGGCGGTGTGTRC for the 926F
and 1392R primers that target the V6 to V9 region of the 16S rRNA gene.</p>
</dd>
<dt><strong><a name="un_unidirectional_unidirectional_unidirectional" class="item">-un <unidirectional> | -unidirectional <unidirectional></a></strong></dt>
<dd>
<p>Instead of producing reads bidirectionally, from the reference strand and its
reverse complement, proceed unidirectionally, from one strand only (forward or
reverse). Values: 0 (off, i.e. bidirectional), 1 (forward), -1 (reverse). Use
<unidirectional> = 1 for amplicon and strand-specific transcriptomic or
proteomic datasets. Default: 0</p>
</dd>
<dt><strong><a name="lb_length_bias_length_bias_length_bias" class="item">-lb <length_bias> | -length_bias <length_bias></a></strong></dt>
<dd>
<p>In shotgun libraries, sample reference sequences proportionally to their length.
For example, in simulated microbial datasets, this means that at the same
relative abundance, larger genomes contribute more reads than smaller genomes
(and all genomes have the same fold coverage).
0 = no, 1 = yes. Default: 1</p>
</dd>
<dt><strong><a name="cb_copy_bias_copy_bias_copy_bias" class="item">-cb <copy_bias> | -copy_bias <copy_bias></a></strong></dt>
<dd>
<p>In amplicon libraries where full genomes are used as input, sample species
proportionally to the number of copies of the target gene: at equal relative
abundance, genomes that have multiple copies of the target gene contribute more
amplicon reads than genomes that have a single copy. 0 = no, 1 = yes. Default:
1</p>
</dd>
<dt><strong><a name="md_mutation_dist_mutation_dist_mutation_dist" class="item">-md <mutation_dist>... | -mutation_dist <mutation_dist>...</a></strong></dt>
<dd>
<p>Introduce sequencing errors in the reads, under the form of mutations
(substitutions, insertions and deletions) at positions that follow a specified
distribution (with replacement): model (uniform, linear, poly4), model parameters.
For example, for a uniform 0.1% error rate, use: uniform 0.1. To simulate Sanger
errors, use a linear model where the errror rate is 1% at the 5' end of reads and
2% at the 3' end: linear 1 2. To model Illumina errors using the 4th degree
polynome 3e-3 + 3.3e-8 * i^4 (Korbel et al 2009), use: poly4 3e-3 3.3e-8.
Use the <mutation_ratio> option to alter how many of these mutations are
substitutions or indels. Default: uniform 0 0</p>
</dd>
<dt><strong><a name="mr_mutation_ratio_mutation_ratio_mutation_ratio" class="item">-mr <mutation_ratio>... | -mutation_ratio <mutation_ratio>...</a></strong></dt>
<dd>
<p>Indicate the percentage of substitutions and the number of indels (insertions
and deletions). For example, use '80 20' (4 substitutions for each indel) for
Sanger reads. Note that this parameter has no effect unless you specify the
<mutation_dist> option. Default: 80 20</p>
</dd>
<dt><strong><a name="hd_homopolymer_dist_homopolymer_dist_homopolymer_dist" class="item">-hd <homopolymer_dist> | -homopolymer_dist <homopolymer_dist></a></strong></dt>
<dd>
<p>Introduce sequencing errors in the reads under the form of homopolymeric
stretches (e.g. AAA, CCCCC) using a specified model where the homopolymer length
follows a normal distribution N(mean, standard deviation) that is function of
the homopolymer length n:</p>
<pre>
Margulies: N(n, 0.15 * n) , Margulies et al. 2005.
Richter : N(n, 0.15 * sqrt(n)) , Richter et al. 2008.
Balzer : N(n, 0.03494 + n * 0.06856) , Balzer et al. 2010.</pre>
<p>Default: 0</p>
</dd>
<dt><strong><a name="cp_chimera_perc_chimera_perc_chimera_perc" class="item">-cp <chimera_perc> | -chimera_perc <chimera_perc></a></strong></dt>
<dd>
<p>Specify the percent of reads in amplicon libraries that should be chimeric
sequences. The 'reference' field in the description of chimeric reads will
contain the ID of all the reference sequences forming the chimeric template.
A typical value is 10% for amplicons. This option can be used to generate
chimeric shotgun reads as well. Default: 0 %</p>
</dd>
<dt><strong><a name="cd_chimera_dist_chimera_dist_chimera_dist" class="item">-cd <chimera_dist>... | -chimera_dist <chimera_dist>...</a></strong></dt>
<dd>
<p>Specify the distribution of chimeras: bimeras, trimeras, quadrameras and
multimeras of higher order. The default is the average values from Quince et al.
2011: '314 38 1', which corresponds to 89% of bimeras, 11% of trimeras and 0.3%
of quadrameras. Note that this option only takes effect when you request the
generation of chimeras with the <chimera_perc> option. Default: 314 38 1</p>
</dd>
<dt><strong><a name="ck_chimera_kmer_chimera_kmer_chimera_kmer" class="item">-ck <chimera_kmer> | -chimera_kmer <chimera_kmer></a></strong></dt>
<dd>
<p>Activate a method to form chimeras by picking breakpoints at places where k-mers
are shared between sequences. <chimera_kmer> represents k, the length of the
k-mers (in bp). The longer the kmer, the more similar the sequences have to be
to be eligible to form chimeras. The more frequent a k-mer is in the pool of
reference sequences (taking into account their relative abundance), the more
often this k-mer will be chosen. For example, CHSIM (Edgar et al. 2011) uses this
method with a k-mer length of 10 bp. If you do not want to use k-mer information
to form chimeras, use 0, which will result in the reference sequences and
breakpoints to be taken randomly on the "aligned" reference sequences. Note that
this option only takes effect when you request the generation of chimeras with
the <chimera_perc> option. Also, this options is quite memory intensive, so you
should probably limit yourself to a relatively small number of reference sequences
if you want to use it. Default: 10 bp</p>
</dd>
<dt><strong><a name="af_abundance_file_abundance_file_abundance_file" class="item">-af <abundance_file> | -abundance_file <abundance_file></a></strong></dt>
<dd>
<p>Specify the relative abundance of the reference sequences manually in an input
file. Each line of the file should contain a sequence name and its relative
abundance (%), e.g. 'seqABC 82.1' or 'seqABC 82.1 10.2' if you are specifying two
different libraries.</p>
</dd>
<dt><strong><a name="am_abundance_model_abundance_model_abundance_model" class="item">-am <abundance_model>... | -abundance_model <abundance_model>...</a></strong></dt>
<dd>
<p>Relative abundance model for the input reference sequences: uniform, linear, powerlaw,
logarithmic or exponential. The uniform and linear models do not require a
parameter, but the other models take a parameter in the range [0, infinity). If
this parameter is not specified, then it is randomly chosen. Examples:</p>
<pre>
uniform distribution: uniform
powerlaw distribution with parameter 0.1: powerlaw 0.1
exponential distribution with automatically chosen parameter: exponential</pre>
<p>Default: uniform 1</p>
</dd>
<dt><strong><a name="nl_num_libraries_num_libraries_num_libraries" class="item">-nl <num_libraries> | -num_libraries <num_libraries></a></strong></dt>
<dd>
<p>Number of independent libraries to create. Specify how diverse and similar they
should be with <diversity>, <shared_perc> and <permuted_perc>. Assign them
different MID tags with <multiplex_mids>. Default: 1</p>
</dd>
<dt><strong><a name="mi_multiplex_ids_multiplex_ids_multiplex_ids" class="item">-mi <multiplex_ids> | -multiplex_ids <multiplex_ids></a></strong></dt>
<dd>
<p>Specify an optional FASTA file that contains multiplex sequence identifiers
(a.k.a MIDs or barcodes) to add to the sequences (one sequence per library). The
MIDs are included in the length specified with the -read_dist option and can be
altered by sequencing errors. See the MIDesigner or BarCrawl programs to
generate MID sequences.</p>
</dd>
<dt><strong><a name="di_diversity_diversity_diversity" class="item">-di <diversity>... | -diversity <diversity>...</a></strong></dt>
<dd>
<p>This option specifies alpha diversity, specifically the richness, i.e. number of
reference sequences to take randomly and include in each library. Use 0 for the
maximum richness possible (based on the number of reference sequences available).
Provide one value to make all libraries have the same diversity, or one richness
value per library otherwise. Default: 0</p>
</dd>
<dt><strong><a name="sp_shared_perc_shared_perc_shared_perc" class="item">-sp <shared_perc> | -shared_perc <shared_perc></a></strong></dt>
<dd>
<p>This option controls an aspect of beta-diversity. When creating multiple
libraries, specify the percent of reference sequences they should have in common
(relative to the diversity of the least diverse library). Default: 0 %</p>
</dd>
<dt><strong><a name="pp_permuted_perc_permuted_perc_permuted_perc" class="item">-pp <permuted_perc> | -permuted_perc <permuted_perc></a></strong></dt>
<dd>
<p>This option controls another aspect of beta-diversity. For multiple libraries,
choose the percent of the most-abundant reference sequences to permute (randomly
shuffle) the rank-abundance of. Default: 0 %</p>
</dd>
<dt><strong><a name="rs_random_seed_random_seed_random_seed" class="item">-rs <random_seed> | -random_seed <random_seed></a></strong></dt>
<dd>
<p>Seed number to use for the pseudo-random number generator.</p>
</dd>
<dt><strong><a name="dt_desc_track_desc_track_desc_track" class="item">-dt <desc_track> | -desc_track <desc_track></a></strong></dt>
<dd>
<p>Track read information (reference sequence, position, errors, ...) by writing
it in the read description. Default: 1</p>
</dd>
<dt><strong><a name="ql_qual_levels_qual_levels_qual_levels" class="item">-ql <qual_levels>... | -qual_levels <qual_levels>...</a></strong></dt>
<dd>
<p>Generate basic quality scores for the simulated reads. Good residues are given a
specified good score (e.g. 30) and residues that are the result of an insertion
or substitution are given a specified bad score (e.g. 10). Specify first the
good score and then the bad score on the command-line, e.g.: 30 10. Default:</p>
</dd>
<dt><strong><a name="fq_fastq_output_fastq_output_fastq_output" class="item">-fq <fastq_output> | -fastq_output <fastq_output></a></strong></dt>
<dd>
<p>Whether to write the generated reads in FASTQ format (with Sanger-encoded
quality scores) instead of FASTA and QUAL or not (1: yes, 0: no).
<qual_levels> need to be specified for this option to be effective. Default: 0</p>
</dd>
<dt><strong><a name="bn_base_name_base_name_base_name" class="item">-bn <base_name> | -base_name <base_name></a></strong></dt>
<dd>
<p>Prefix of the output files. Default: grinder</p>
</dd>
<dt><strong><a name="od_output_dir_output_dir_output_dir" class="item">-od <output_dir> | -output_dir <output_dir></a></strong></dt>
<dd>
<p>Directory where the results should be written. This folder will be created if
needed. Default: .</p>
</dd>
<dt><strong><a name="pf_profile_file_profile_file_profile_file" class="item">-pf <profile_file> | -profile_file <profile_file></a></strong></dt>
<dd>
<p>A file that contains Grinder arguments. This is useful if you use many options
or often use the same options. Lines with comments (#) are ignored. Consider the
profile file, 'simple_profile.txt':</p>
<pre>
# A simple Grinder profile
-read_dist 105 normal 12
-total_reads 1000</pre>
<p>Running: grinder -reference_file viral_genomes.fa -profile_file simple_profile.txt</p>
<p>Translates into: grinder -reference_file viral_genomes.fa -read_dist 105 normal 12 -total_reads 1000</p>
<p>Note that the arguments specified in the profile should not be specified again on the command line.</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="cli_output">CLI OUTPUT</a></h1>
<p>For each shotgun or amplicon read library requested, the following files are
generated:</p>
<ul>
<li>
<p>A rank-abundance file, tab-delimited, that shows the relative abundance of the
different reference sequences</p>
</li>
<li>
<p>A file containing the read sequences in FASTA format. The read headers
contain information necessary to track from which reference sequence each read
was taken and what errors it contains. This file is not generated if <fastq_output>
option was provided.</p>
</li>
<li>
<p>If the <qual_levels> option was specified, a file containing the quality scores
of the reads (in QUAL format).</p>
</li>
<li>
<p>If the <fastq_output> option was provided, a file containing the read sequences
in FASTQ format.</p>
</li>
</ul>
<p>
</p>
<hr />
<h1><a name="api_examples">API EXAMPLES</a></h1>
<p>The Grinder API allows to conveniently use Grinder within Perl scripts. Here is
a synopsis:</p>
<pre>
use Grinder;</pre>
<pre>
# Set up a new factory (see the OPTIONS section for a complete list of parameters)
my $factory = Grinder->new( -reference_file => 'genomes.fna' );</pre>
<pre>
# Process all shotgun libraries requested
while ( my $struct = $factory->next_lib ) {</pre>
<pre>
# The ID and abundance of the 3rd most abundant genome in this community
my $id = $struct->{ids}->[2];
my $ab = $struct->{abs}->[2];</pre>
<pre>
# Create shotgun reads
while ( my $read = $factory->next_read) {</pre>
<pre>
# The read is a Bioperl sequence object with these properties:
my $read_id = $read->id; # read ID given by Grinder
my $read_seq = $read->seq; # nucleotide sequence
my $read_mid = $read->mid; # MID or tag attached to the read
my $read_errors = $read->errors; # errors that the read contains
# Where was the read taken from? The reference sequence refers to the
# database sequence for shotgun libraries, amplicon obtained from the
# database sequence, or could even be a chimeric sequence
my $ref_id = $read->reference->id; # ID of the reference sequence
my $ref_start = $read->start; # start of the read on the reference
my $ref_end = $read->end; # end of the read on the reference
my $ref_strand = $read->strand; # strand of the reference
}
}</pre>
<pre>
# Similarly, for shotgun mate pairs
my $factory = Grinder->new( -reference_file => 'genomes.fna',
-insert_dist => 250 );
while ( $factory->next_lib ) {
while ( my $read = $factory->next_read ) {
# The first read is the first mate of the mate pair
# The second read is the second mate of the mate pair
# The third read is the first mate of the next mate pair
# ...
}
}</pre>
<pre>
# To generate an amplicon library
my $factory = Grinder->new( -reference_file => 'genomes.fna',
-forward_reverse => '16Sgenes.fna',
-length_bias => 0,
-unidirectional => 1 );
while ( $factory->next_lib ) {
while ( my $read = $factory->next_read) {
# ...
}
}</pre>
<p>
</p>
<hr />
<h1><a name="api_methods">API METHODS</a></h1>
<p>The rest of the documentation details the available Grinder API methods.</p>
<p>
</p>
<h2><a name="new">new</a></h2>
<p>Title : new</p>
<p>Function: Create a new Grinder factory initialized with the passed arguments.
Available parameters described in the OPTIONS section.</p>
<p>Usage : my $factory = Grinder->new( -reference_file => 'genomes.fna' );</p>
<p>Returns : a new Grinder object</p>
<p>
</p>
<h2><a name="next_lib">next_lib</a></h2>
<p>Title : next_lib</p>
<p>Function: Go to the next shotgun library to process.</p>
<p>Usage : my $struct = $factory->next_lib;</p>
<p>Returns : Community structure to be used for this library, where $struct->{ids}
is an array reference containing the IDs of the genome making up the
community (sorted by decreasing relative abundance) and $struct->{abs}
is an array reference of the genome abundances (in the same order as
the IDs).</p>
<p>
</p>
<h2><a name="next_read">next_read</a></h2>
<p>Title : next_read</p>
<p>Function: Create an amplicon or shotgun read for the current library.</p>
<p>Usage : my $read = $factory->next_read; # for single read
my $mate1 = $factory->next_read; # for mate pairs
my $mate2 = $factory->next_read;</p>
<p>Returns : A sequence represented as a Bio::Seq::SimulatedRead object</p>
<p>
</p>
<h2><a name="get_random_seed">get_random_seed</a></h2>
<p>Title : get_random_seed</p>
<p>Function: Return the number used to seed the pseudo-random number generator</p>
<p>Usage : my $seed = $factory->get_random_seed;</p>
<p>Returns : seed number</p>
<p>
</p>
<hr />
<h1><a name="copyright">COPYRIGHT</a></h1>
<p>Copyright 2009-2012 Florent ANGLY <<a href="mailto:florent.angly@gmail.com">florent.angly@gmail.com</a>></p>
<p>Grinder is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License (GPL) as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Grinder is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Grinder. If not, see <http://www.gnu.org/licenses/>.</p>
<p>
</p>
<hr />
<h1><a name="bugs">BUGS</a></h1>
<p>All complex software has bugs lurking in it, and this program is no exception.
If you find a bug, please report it on the SourceForge Tracker for Grinder:
<a href="http://sourceforge.net/tracker/?group_id=244196&atid=1124737">http://sourceforge.net/tracker/</a></p>
<p>Bug reports, suggestions and patches are welcome. Grinder's code is developed
on Sourceforge (<a href="http://sourceforge.net/scm/?type=git&group_id=244196">http://sourceforge.net/scm/</a>) and is
under Git revision control. To get started with a patch, do:</p>
<pre>
git clone git://biogrinder.git.sourceforge.net/gitroot/biogrinder/biogrinder</pre>
</body>
</html>