-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPGAP.pl
540 lines (452 loc) · 20 KB
/
PGAP.pl
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
#!/usr/bin/perl
=head1 Name
PGAP.pl -- A pipeline to annotation prokaryotic genome
=head1 Description
This is a pipeline to annotation the prokaryote genome. There are six steps:
Step 1: Gene Denovo Prediction based on HMM, contains Glimmer3 and GeneMarkS two software, default we use
Glimmer3 to predict Genes because of its higher accuracy. But GeneMarkS can get more accurat start codon
site.
Step 2: Repeat Finding, contains Tandem Repeat(TR) found by TRF and Transposon element(TE) found by RepeatMasker, by running RepeatMaskerm, we use the protein lib suppled by RepeatMasker and Repbase database supplied by EMBL.
Step 3: ncRNA Finding, contains rRNA predicted by homology blast or RNAmmer, tRNA predicted by tRNAscan, sRNA, snRNA and miRNA predicted by Rafam.
Step 4: Gene Function Annotation, we blast the predicted genes with protein database and get the relative function and
classification information. The database contains NR, SwissProt, TrEMBL, COG, KEGG.
Step 5: Draw synteny map, We sort the Scaffolds based on the reference and blast the proteins with reference proteins, then
we draw the synteny map based on the sorted Scaffold list and blast result.
Step 6: Gene Family Analysis, we use Treefam to get gene families and the evolution trees.
=head1 Version
Version: 1.0
Contact: [email protected]
=head1 Usage
perl PGAP.pl [options] Genome.fa
--all run all annotation program
--stat stat the genome scaffolds seqence
--len <int> get the scaffolds longer than this len, default 500
--predict <str> run Gene Prediction, Glimmer3 or GeneMarkS or all, --all default Glimmer3
--shape <str> set the shape of prokaryote DNA, circular,linear,partial, default=partial
--repeat
--repbase run RepeatMasker based on Repbase database
--proteinmask run RepeatProteinMasker
--trf run TRF
--ncRNA
--rRNA <str> search rRNA by RNAmmer or homology or all
--rRNA_ref<file> set the reference rRNA seqeunce file, needed for -all
--tRNA search tRNA by tRNAscan
--miRNA search miRNA by blasting with Rfam database
--sRNA search sRNA by blasting with Rfam database
--snRNA search snRNA by blasting with Rfam database
--function <str> Gene Function Annotation, --all default:nr-swissprot-trembl-cog-kegg
--reference <file> set the references list file for synteny analysis and Gene family, needed for -all
--synteny synteny analysis
--family run Treefam to get Gene Family
--lib <file> set the lib for Gene Family, default generated by Genome seqence and reference
--species <file> species tree, default, created by lib information
--category <file> category file, default, created by lib information
--run <str> set the parallel type, qsub, or multi, default=qsub
--cpu <int> set the cpu number to use in parallel, default 5 for qsub and 20 for multi
--outdir <str> set the result directory, default="."
--prefix <str> set a prefix name for results
--help output help information to screen
=head1 Example
perl ../PGAP.pl -all -prefix Ainu711 -reference input/ref.lis -rRNA_ref input/rRNA_ref.fa -outdir . -cpu 5 -run qsub input/Ainu711.seq.1000
=cut
use strict;
use warnings;
use FindBin qw($Bin $Script);
use File::Basename qw(basename dirname);
use Getopt::Long;
use Data::Dumper;
use Pod::Text;
##initialize some parameters fot GetOptions
my $All;
my($Stat,$Length);
my($Predict,$Shape);
my($Repeat,$Repbase,$ProteinMask,$TRF);
my($NcRNA,$RRNA,$RRNA_ref,$TRNA,$MiRNA,$SRNA,$SnRNA);
my($Function);
my($Reference,$Synteny);
my($Family,$Lib,$Species,$Category);
my($Run,$Cpu,$Outdir,$Prefix);
my($Verbose,$Help);
GetOptions(
"all"=>\$All,
"stat"=>\$Stat,
"len:i"=>\$Length,
"predict:s"=>\$Predict,
"shape:s"=>\$Shape,
"repeat"=>\$Repeat,
"repbase"=>\$Repbase,
"proteinmask"=>\$ProteinMask,
"trf"=>\$TRF,
"ncRNA"=>\$NcRNA,
"rRNA:s"=>\$RRNA,
"rRNA_ref:s"=>\$RRNA_ref,
"tRNA"=>\$TRNA,
"miRNA"=>\$MiRNA,
"sRNA"=>\$SRNA,
"snRNA"=>\$SnRNA,
"function:s"=>\$Function,
"reference:s"=>\$Reference,
"synteny"=>\$Synteny,
"family"=>\$Family,
"lib:s"=>\$Lib,
"species"=>\$Species,
"category"=>\$Category,
"run:s"=>\$Run,
"cpu:i"=>\$Cpu,
"outdir:s"=>\$Outdir,
"prefix:s"=>\$Prefix,
"verbose"=>\$Verbose,
"help"=>\$Help
);
##get the introduction information
die `pod2text $0` if ($Help || @ARGV==0);
#===============================================================
##set default value for some parameter
$Length ||= 500;
$Shape ||= "partial";
$Run ||= "qsub";
$Cpu ||= $Run eq 'qsub' ? 20 : 5;
$Outdir ||= ".";
$Outdir =~ s/\/$//;
my$seq_file=shift;
my$pwd=$ENV{'PWD'};
$seq_file="$pwd/$seq_file" if($seq_file!~/^\//);
$Outdir="$pwd/$Outdir" if($Outdir!~/^\//);
#$RRNA_ref needed full path
if(defined $RRNA_ref && $RRNA_ref!~/^\//){
$RRNA_ref="$pwd/$RRNA_ref";
}
my$seq_file_name=basename($seq_file);
$Prefix ||= $seq_file_name;
##defined the work directory and $command
my$cwd=$Outdir;
my$command="";
mkdir $cwd unless (-d $cwd);
$Script="$Bin/script";
mkdir "$Outdir/Result" unless -d "$Outdir/Result";
#================================================================
#make all analysis if defined all
if(defined $All){
$Stat="";
$Predict="glimmer";
$Repeat=$Repbase=$ProteinMask=$TRF="";
$NcRNA=$TRNA=$MiRNA=$SRNA=$SnRNA="";
$Function="nr-swissprot-trembl-cog-kegg";
$Synteny="";
$Family="";
if(! defined $Reference){
die "ERROR:You must defined refernce for -all!\n";
}
if(! defined $RRNA_ref){
$RRNA="RNAmmer";
}else{
$RRNA="homology";
}
}
#========================================================
# +------------------------+
# | Genome Scaffold Stat |
# | 00.Seqence |
# +------------------------+
if(defined $Stat){
print "cut the Scaffolds ...";
##creat dir
$cwd="$Outdir/00.Seqence";
mkdir $cwd unless (-d $cwd);
mkdir "$Outdir/Result/00.Seqence" unless -d "$Outdir/Result/00.Seqence";
##generate Scaffolds longer than $Len
`perl $Script/sequence.pl -l $Length -scaff $cwd/$seq_file_name.$Length $seq_file`;
#`$Script/cs $cwd/$seq_file_name.$Length > $cwd/$seq_file_name.$Length.stat`;
##save needed files
`cp $cwd/$seq_file_name.$Length $Outdir/Result/00.Seqence/$Prefix.seq`;
#`cp $cwd/$seq_file_name.$Length.stat $Outdir/Result/00.Seqence/$Prefix.seq.stat`;
my$pwd=$ENV{'PWD'};
$seq_file="$pwd/00.Seqence/$seq_file_name.$Length";
$seq_file_name=basename($seq_file);
print "Done\n";
}
#===========================================================
# +----------------------+
# | Reference files |
# | 00.Seqence/reference |
# +----------------------+
my@Reference;
if(defined $Reference){
print "Pretreat Reference files ...";
open(IN,$Reference) || die "$Reference $!\n";
while(<IN>){
chomp;
next if (/^#/);
push(@Reference , $_);
}
##creat dir
$cwd="$Outdir/00.Seqence/reference";
mkdir $cwd unless (-d $cwd);
chdir $cwd;
##get information from Reference list file
open OUT,">all.lib" || die "all.lib $!\n";
my$libline="";
$pwd=$ENV{'PWD'};
foreach my$ref(@Reference){
die "Check: $ref is not exists!" if(! -e $ref);
my$ref_name=basename($ref);
`cp $ref $ref_name`;
$libline.="Name=$ref_name\nCds=$pwd/00.Seqence/reference/$ref_name.cds\nPep=$pwd/00.Seqence/reference/$ref_name.pep\n";
next if(-e "$ref_name.pep" && -e "$ref_name.cds" && -e "$ref_name.seq");
my$filetype=get_file_type($ref_name);
if ($filetype eq "GenBank"){
`perl $Bin/script/genbank_parser.pl $ref_name`
}elsif($filetype eq "FASTA"){
`perl $Bin/gene\-prediction/bin/gene-predict.pl --glimmer --prefix $ref_name -shape circular -cpu $Cpu -run $Run -outdir ./ $ref_name`;
`mv $ref_name.glimmer.pep $ref_name.pep`;
`mv $ref_name.glimmer.cds $ref_name.cds`;
`mv $ref_name $ref_name.seq`;
}
}
print OUT $libline;
close OUT;
print "Done\n";
}
#========================================================
# +------------------------+
# | Gene Prediction |
# | 01.Gene-Prediction |
# +------------------------+
if(defined $Predict){
print "Gene Prediction ...";
##creat dir
$cwd="$Outdir/01.Gene-Prediction";
mkdir $cwd unless (-d $cwd);
mkdir "$Outdir/Result/01.Gene-Prediction" unless -d "$Outdir/Result/01.Gene-Prediction";
chdir $cwd;
#creat gene predict command and save needed files to Result folder
if($Predict =~ /all/i ){
`cp $Bin/gene\-prediction/bin/.gm_key ~/`;
$command="perl $Bin/gene\-prediction/bin/gene-predict.pl --glimmer --genemark --prefix $Prefix -shape $Shape -cpu $Cpu -run $Run -outdir ./ $seq_file\n";
$command.="cp $seq_file_name.glimmer.gff ../Result/01.Gene-Prediction/$Prefix.glimmer.gff; cp $seq_file_name.glimmer.cds ../Result/01.Gene-Prediction/$Prefix.glimmer.cds; cp $seq_file_name.glimmer.pep ../Result/01.Gene-Prediction/$Prefix.glimmer.pep\n";
$command.="cp $seq_file_name.gmhmmp.gff ../Result/01.Gene-Prediction/$Prefix.gmhmmp.gff; cp $seq_file_name.gmhmmp.cds ../Result/01.Gene-Prediction/$Prefix.gmhmmp.cds; cp $seq_file_name.gmhmmp.pep ../Result/01.Gene-Prediction/$Prefix.gmhmmp.pep\n";
}elsif($Predict =-~ /glimmer/i){
$command="$Bin/gene\-prediction/bin/gene-predict.pl --glimmer --prefix $Prefix -shape $Shape -cpu $Cpu -run $Run -outdir ./ $seq_file\n";
$command.="cp $seq_file_name.glimmer.gff ../Result/01.Gene-Prediction/$Prefix.glimmer.gff; cp $seq_file_name.glimmer.cds ../Result/01.Gene-Prediction/$Prefix.glimmer.cds; cp $seq_file_name.glimmer.pep ../Result/01.Gene-Prediction/$Prefix.glimmer.pep\n";
}elsif($Predict =~ /genemark/i){
`cp $Bin/gene\-prediction/bin/.gm_key ~/`;
$command="$Bin/gene\-prediction/bin/gene-predict.pl --genemark --prefix $Prefix -shape $Shape -cpu $Cpu -run $Run -outdir ./ $seq_file\n";
$command.="cp $seq_file_name.gmhmmp.gff ../Result/01.Gene-Predict/$Prefix.gmhmmp.gff; cp $seq_file_name.gmhmmp.cds ../Result/01.Gene-Prediction/$Prefix.gmhmmp.cds; cp $seq_file_name.gmhmmp.pep ../Result/01.Gene-Prediction/$Prefix.gmhmmp.pep\n";
}
runcmd($command,"gene_predict.sh");
chdir "../";
#stat the gene predict result
`perl $Bin/script/plot_length.pl Result/01.Gene-Prediction/$Prefix.gmhmmp.cds` if($Predict =~ /all/i or $Predict =~ /genemark/i);
`perl $Bin/script/plot_length.pl Result/01.Gene-Prediction/$Prefix.glimmer.cds` if($Predict =~ /all/i or $Predict =~ /glimmer/i );
print "Done\n";
}
#===================================================================
# +-------------------------+
# | Repeat Finding |
# | 02.Repeat-finding |
# +-------------------------+
if(defined $Repeat){
print "Repeat Finding ...";
##creat dir
$cwd="$Outdir/02.Repeat-finding";
mkdir $cwd unless (-d $cwd);
mkdir "$Outdir/Result/02.Repeat-finding" unless -d "$Outdir/Result/02.Repeat-finding";
chdir $cwd;
##creat repeat finding command and save needed files to Result folder
$command="perl $Bin/repeat/bin/repeat_pipeline.pl ";
#if(defined $Denovo){
# $command.="--denovo --repeatmodeler ";
#}
if(defined $Repbase){
$command.="--repbase ";
}
if(defined $ProteinMask){
$command.="--proteinmasker ";
}
if(defined $TRF){
$command.="--trf ";
}
$command.="--outdir ./ --prefix $Prefix --cutf 20 --run $Run --cpu $Cpu $seq_file \n";
#if(defined $Denovo){
# $command.="cp 00.Denovo/RepeatModeler/$seq_file_name.RepeatMasker.out ../Result/02.Repeat-finding/$Prefix.RepeatModeler.out\n";
# $command.="cp 00.Denovo/RepeatModeler/$seq_file_name.RepeatMasker.out.gff ../Result/02.Repeat-finding/$Prefix.RepeatModeler.out.gff\n";
#}
if(defined $Repbase){
$command.="cp 01.Repbase/$seq_file_name.RepeatMasker.out ../Result/02.Repeat-finding/$Prefix.Repbase.out\n";
$command.="cp 01.Repbase/$seq_file_name.RepeatMasker.out.gff ../Result/02.Repeat-finding/$Prefix.Repbase.out.gff\n";
}
if(defined $ProteinMask){
$command.="cp 02.RepeatProteinMasker/$seq_file_name.Proteinmask.annot ../Result/02.Repeat-finding/$Prefix.Proteinmask.annot\n";
$command.="cp 02.RepeatProteinMasker/$seq_file_name.Proteinmask.annot.gff ../Result/02.Repeat-finding/$Prefix.Proteinmask.annot.gff\n";
}
if(defined $TRF){
$command.="cp 03.trf/$seq_file_name.trf.dat ../Result/02.Repeat-finding/$Prefix.trf.dat\n";
$command.="cp 03.trf/$seq_file_name.trf.dat.gff ../Result/02.Repeat-finding/$Prefix.trf.dat.gff\n";
}
##creat and rum repeat finding shell
runcmd($command,"repeat_finding.sh");
##stat
chdir "../";
print "Done\n";
}
#===========================================================================================
# +--------------------------+
# | ncRNA Finding |
# | 03.ncRNA-finding |
# +--------------------------+#
if(defined $NcRNA){
print "ncRNA Finding ...";
##creat dir
$cwd="$Outdir/03.ncRNA-finding";
mkdir $cwd unless (-d $cwd);
mkdir "$Outdir/Result/03.ncRNA-finding" unless -d "$Outdir/Result/03.ncRNA-finding";
chdir $cwd;
##creat run ncRNA command
$command="perl $Bin/ncRNA/bin/find-RNA.pl ";
if(defined $RRNA){
$command.="--rRNA $RRNA --ref_rRNA $RRNA_ref " if(defined $RRNA_ref);
$command.="--rRNA $RRNA " if(! defined $RRNA_ref);
}
if(defined $TRNA){
$command.="--tRNA ";
}
if(defined $MiRNA){
$command.="--MiRNA ";
}
if(defined $SRNA){
$command.="--sRNA ";
}
if(defined $SnRNA){
$command.="--snRNA ";
}
$command.="--spec_tag B --species bac --prefix $Prefix --cpu $Cpu --run $Run --outdir ./ $seq_file\n";
##save needed files to Result folder
if(defined $MiRNA){
$command.="cp miRNA/$seq_file_name.miRNA.cmsearch.all.gff ../Result/03.ncRNA-finding/$Prefix.miRNA.cmsearch.all.gff\n";
$command.="cp miRNA/$seq_file_name.miRNA.cmsearch.confident.gff ../Result/03.ncRNA-finding/$Prefix.miRNA.cmsearch.confident.gff\n";
$command.="cp miRNA/$seq_file_name.miRNA.cmsearch.confident.nr.gff ../Result/03.ncRNA-finding/$Prefix.miRNA.cmsearch.confident.nr.gff\n";
}
if(defined $SnRNA){
$command.="cp snRNA/$seq_file_name.snRNA.cmsearch.all.gff ../Result/03.ncRNA-finding/$Prefix.snRNA.cmsearch.all.gff\n";
$command.="cp snRNA/$seq_file_name.snRNA.cmsearch.confident.gff ../Result/03.ncRNA-finding/$Prefix.snRNA.cmsearch.confident.gff\n";
$command.="cp snRNA/$seq_file_name.snRNA.cmsearch.confident.nr.gff ../Result/03.ncRNA-finding/$Prefix.snRNA.cmsearch.confident.nr.gff\n";
}
if(defined $SRNA){
$command.="cp sRNA/$seq_file_name.sRNA.cmsearch.all.gff ../Result/03.ncRNA-finding/$Prefix.sRNA.cmsearch.all.gff\n";
$command.="cp sRNA/$seq_file_name.sRNA.cmsearch.confident.gff ../Result/03.ncRNA-finding/$Prefix.sRNA.cmsearch.confident.gff\n";
$command.="cp sRNA/$seq_file_name.sRNA.cmsearch.confident.nr.gff ../Result/03.ncRNA-finding/$Prefix.sRNA.cmsearch.confident.nr.gff\n";
}
if(defined $TRNA){
$command.="cp tRNA/$seq_file_name.tRNA ../Result/03.ncRNA-finding/$Prefix.tRNA\n";
$command.="cp tRNA/$seq_file_name.tRNA.gff ../Result/03.ncRNA-finding/$Prefix.tRNA.gff\n";
$command.="cp tRNA/$seq_file_name.tRNA.structure ../Result/03.ncRNA-finding/$Prefix.tRNA.structure\n";
}
if(defined $RRNA_ref){
$command.="cp rRNA/$seq_file_name.rRNA.blast.tab ../Result/03.ncRNA-finding/$Prefix.rRNA.tab\n";
$command.="cp rRNA/$seq_file_name.rRNA.blast.tab.gff ../Result/03.ncRNA-finding/$Prefix.rRNA.gff\n";
}
if(defined $RRNA && ($RRNA =~ /all/i || $RRNA =~ /RNAmmer/i)){
$command.="cp rRNA/Denovo/$Prefix.rRNA.fq ../Result/03.ncRNA-finding/$Prefix.rRNA.fq\n";
$command.="cp rRNA/Denovo/$Prefix.rRNA.gff ../Result/03.ncRNA-finding/$Prefix.rRNA.gff\n";
}
#stat
#
##creat and run ncRNA sell
runcmd($command,"ncRNA.sh");
chdir "../";
print "Done\n"
}
#========================================================================
# +----------------------------+
# | Gene Function Annotation |
# | 04.gene-function |
# +----------------------------+
if(defined $Function){
print "Gene Function Annotation ...";
##creat dir
$cwd="$Outdir/04.Gene-Function";
mkdir $cwd unless -d $cwd;
mkdir "$Outdir/Result/04.Gene-Function" unless -d "$Outdir/Result/04.Gene-Function";
chdir $cwd;
if(! -e "../01.Gene-Prediction/$seq_file_name.glimmer.pep"){
die "You must predict genes first!\nIf you want to annotation only, you can turn to $Bin/gene-function/bin/run_annoflow.pl \n";
}
##creat gene function annotation command
$command="perl $Bin/gene-function/bin/run_annoflow.pl -i ../01.Gene-Prediction/$seq_file_name.glimmer.pep -c $Cpu -r $Run -b Y -d 0 -e 1e-5 -m 0 -s $Function \n";
##creat and run gene function annotation shell
runcmd($command,"gene_function.sh");
##save needed files to Result
$_=$Function;
if(/nr/){
`cp AnnoPack/03.anno.nr/nr.list.filter ../Result/04.Gene-Function/$Prefix.nr.list.filter`;
`cp AnnoPack/03.anno.nr/nr.list.filter.anno ../Result/04.Gene-Function/$Prefix.nr.list.anno`;
}
if(/swissprot/){
`cp AnnoPack/03.anno.swissprot/swissprot.list.filter ../Result/04.Gene-Function/$Prefix.swissprot.list.filter`;
`cp AnnoPack/03.anno.swissprot/swissprot.list.anno ../Result/04.Gene-Function/$Prefix.swissprot.list.anno`;
}
if(/trembl/){
`cp AnnoPack/03.anno.trembl/trembl.list.filter ../Result/04.Gene-Function/$Prefix.trembl.list.filter`;
`cp AnnoPack/03.anno.trembl/trembl.list.filter.anno ../Result/04.Gene-Function/$Prefix.trembl.list.anno`;
}
if(/cog/){
`cp AnnoPack/03.anno.cog/cog.list.filter ../Result/04.Gene-Function/$Prefix.cog.list.filter`;
`cp AnnoPack/03.anno.cog/cog.list.filter.anno ../Result/04.Gene-Function/$Prefix.cog.list.anno`;
`cp AnnoPack/03.anno.cog/cog.list.cogclass.png ../Result/04.Gene-Function/$Prefix.cog.list.cogclass.png`;
`cp AnnoPack/03.anno.cog/cog.list.class.catalog ../Result/04.Gene-Function/`;
}
if(/kegg/){
`cp AnnoPack/03.anno.kegg/kegg.list.filter ../Result/04.Gene-Function/$Prefix.kegg.list.filter`;
`cp AnnoPack/03.anno.kegg/kegg.list.anno ../Result/04.Gene-Function/$Prefix.kegg.list.anno`;
`cp -r AnnoPack/03.anno.kegg/kegg.list.catalog.map.fig/ ../Result/04.Gene-Function/KEGG_MAP`;
`cp AnnoPack/03.anno.kegg/functional_classification_2.png ../Result/04.Gene-Function/$Prefix.kegg.functional_classification_2.png`;
}
`cp AnnoPack/anno.table ../Result/04.Gene-Function/$Prefix.annotation.table`;
##stat
#
#
chdir "../";
print "Done\n";
}
#=================================================================================
# +----------------------------+
# | Synteny Analysis |
# | 05.synteny |
# +----------------------------+
if (defined $Synteny){
print "Synteny Analysis ...";
if(! -e "$Outdir/01.Gene-Prediction/$seq_file_name.glimmer.pep"){
die "You must predict genes first!\n";
}
if(! defined $Reference){
die "Synteny analysis need a reference at least !\n";
}
$cwd="$Outdir/05.Synteny";
mkdir $cwd unless -d $cwd;
mkdir "$Outdir/Result/05.Synteny" unless -d "$Outdir/Result/05.Synteny";
chdir $cwd;
foreach my$ref (@Reference){
my$ref_name=basename($ref);
##creat synteny analysis command
$command="perl $Bin/synteny/bin/synteny.pl -pep1 ../01.Gene-Prediction/$seq_file_name.glimmer.pep -chr1 ../00.Seqence/$seq_file_name -pep2 ../00.Seqence/reference/$ref_name.pep -chr2 ../00.Seqence/reference/$ref_name.seq -outdir $ref_name -scale 1 -block 1000 -prefix $Prefix\n";
##save need files to Result folder
$command.="cp $ref_name/*.reciprocal.best.list.synteny.svg ../Result/05.Synteny/$Prefix.$ref_name.synteny.svg\n";
$command.="cp $ref_name/*.reciprocal.best.stat ../Result/05.Synteny/$Prefix.$ref_name.stat\n";
$command.="cp $ref_name/*.reciprocal.best.list ../Result/05.Synteny/$Prefix.$ref_name.synteny.list\n";
##creat and run synteny analysis shell
runcmd($command,"$ref_name.synteny.sh");
}
chdir "../";
print "Done\n";
}
#=======================================================================================
# +-----------------------+
# | Gene Family |
# | 06.Gene-Family |
# +-----------------------+
if(defined $Family){
print "Gene Family ...";
##creat dir
$cwd="$Outdir/06.Gene-Family";
mkdir $cwd unless -d $cwd;
mkdir "$Outdir/Result/06.Gene-Family" unless -