-
Notifications
You must be signed in to change notification settings - Fork 0
/
FASconCAT-G_v1.04.pl
5141 lines (3781 loc) · 237 KB
/
FASconCAT-G_v1.04.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
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
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/perl
use strict;
use File::Copy;
use Tie::File;
use Term::ANSIColor qw(:constants);
use Getopt::Std;
######################################### ENTER THE PROTTEST SOFTWARE NAME OF YOUR RUNNING SYSTEM IN SINGLE QUOTATION MARKS ''
# DEFINEMENT OF ACTUAL PROTTEST SOFTWARE NAME
my $prottest = 'prottest-3.3.jar' ;
##############################
# written by patrick kück, zentrales forschungsmuseum alexander koenig, bonn, germany
# email: [email protected]
# updated on 12th,january , 2009 by patrick kueck
# updated on 25th may , 2009 by patrick kueck
# updated on 28th may , 2009 by patrick kueck
# updated on 7th june , 2009 by patrick kueck
# updated on 8th june , 2009 by patrick kueck
# updated on 28th september , 2009 by patrick kueck
# updated on 16th october , 2009 by patrick kueck
# updated on 17th november , 2009 by patrick kueck
# updated on 7th january , 2010 by patrick kueck
# updated on 7th april , 2010 by patrick kueck
# updated on 8th april , 2010 by patrick kueck -> FcC v1.0
# updated on april , 2014 by patrick kueck -> FcC-G v1,0
# updated on 30th september , 2014 by patrick kueck -> FcC-G v1.1 Implementation of additional Screen Output (%Missing Data and Single Infile Sequence Ranges in the concatenated supermatrix) as well as some output result file format changes
# updated on 16th november , 2014 by patrick kueck ->input file endings line 1529-1531->FcC v1.03
# updated on 22nd november , 2016 by patrick kueck -> concatenation and print out of supermatrix ranges due to sorted infile names and not randomly. Debuged read in error of .FASTA or .fasta named files
####################################################### START #######################################################################################
my %outfile_name = (
'supermatrixFAS' => 'FcC_smatrix.fas', # Supermatrix outfile in FASTA format
'supermatrixPHY' => 'FcC_smatrix.phy', # Supermatrix outfile in PHYLIP format
'supermatrixNEX' => 'FcC_smatrix.nex', # Supermatrix outfile in NEXUS format
'structure' => 'FcC_structure.txt', # Structure sequence info file
'info' => 'FcC_info.xls', # Sequence states & concatenation info file
'prottest' => $prottest, # Name of defined prottestversion
) ;
my @parameter_all = ( 'YES', 'NO' ) ; # Parameter option of data concatenation -> 'YES' -> concatenate all files; 'NO' -> concatenate defined files
my @parameter_info = ( 'YES', 'NO' ) ; # Parameter option of additional sequence state analysis -> 'YES' -> perform and print ; 'NO' -> print only basal sequence info
my @parameter_tra = ( 'NO', 'NUC to AA','AA to NUC' ) ; # Parameter option of sequence transaltion -> 'NUC to AA' -> translate nucleotide data to amino acid data; 'AA to NUC' -> translate amino acid data to nucleotide data
my @parameter_phy = ( 'NO', 'STRICT', 'RELAXED' ) ; # Print supermatrix in PHYLIP format
my @parameter_nex = ( 'NO', 'BLOCK', 'MrBAYES' ) ; # Print supermatrix in NEXUS format
my @parameter_fas = ( 'YES', 'NO' ) ; # Print supermatrix in FASTA format
my @parameter_con = ( 'NO', 'Freq', 'Maj', 'Strict' ) ; # Perform consensus sequence of defined sequence blocks
my @parameter_file = ( 'Supermatrix', 'Convert', 'Supermatrix/Convert' ) ; # Concatenate, Convert, or both define by associated option -> 'Supermatrix': concatenation; Convert: Converting single files without adding missing sequences; 'Supermatrix/Convert': Concatenated single files and convert single files with included missing sequence taxa
my @parameter_3rd = ( 'Remain', 'Reject' ) ; # Parameter option of 3rd sequence position exclusion -> 'Remain' -> remove third position; 'Reject' -> keep third position
my @parameter_ryc = ( 'NO', 'All', '3rd' ) ; # Parameter option of RY coding -> 'NO' -> no RY coding; 'All' -> RY coding of complete sequence; '3rd' -> RY coding of 3rd sequence positions
my @parameter_par = ( 'NO', 'YES' ) ; # Print parsimonious sites as extra msa file -> 'NO' -> no print; 'YES' -> print
my @parameter_ren = ( 'NO', 'YES' ) ; # Rename taxon names of given infiles -> 'NO' ; 'YES'
my @parameter_prt = ( 'NO', 'Supermatrix' ) ; # Print OUT additional partition files if concatenated -> 'NO' ; 'Supermatrix' means yes for concatenatde files
my @parameter_pro = ( 'NO', 'Supermatrix' ) ; # Start prottest analyses für aa data -> 'NO' ; 'YES'
##############################
## READ IN ARGV and assign user defined parameter options
&argv_handling (
\@parameter_all, # List of parameter options of data concatenation -> IN (defined) / OUT (changed)
\@parameter_info, # List of parameter options of info print out -> IN (defined) / OUT (changed)
\@parameter_phy, # List of supermatrix parameter options of PHYLIP print OUT -> IN (defined) / OUT (changed)
\@parameter_nex, # List of supermatrix parameter options of NEXUS print OUT -> IN (defined) / OUT (changed)
\@parameter_con, # List of consensus options -> IN (defined) / OUT (changed)
\@parameter_file, # List of filehandling options -> IN (defined) / OUT (changed)
\@parameter_fas, # List of supermatrix parameter options of FASTA print OUT -> IN (defined) / OUT (changed)
\@parameter_3rd, # List of third position handling -> IN (defined) / OUT (changed)
\@parameter_ryc, # List of RY coding -> IN (defined) / OUT (changed)
\@parameter_tra, # List of Sequence transaltion options -> IN (defined) / OUT (changed)
\@parameter_par, # Print parsimonious sites as extra msa file -> IN (defined) / OUT (changed)
\@parameter_ren, # Rename taxon names of given ifiles -> IN (defined) / OUT (changed)
\@parameter_prt, # Print partition files for concatenated data -> IN (defined) / OUT (changed)
\@parameter_pro, # Start prottest analyses für aa data -> IN (defined) / OUT (changed)
\%outfile_name, # Outfilename of output option -> IN (defined) / OUT (unchanged)
) ;
##############################
##############################
## Open MENU
&menu ;
##############################
##############################
## Open Parameter setup
¶meter(
\@parameter_all, # List of parameter options of data concatenation -> IN (defined) / OUT (changed)
\@parameter_info, # List of parameter options of info print out -> IN (defined) / OUT (changed)
\@parameter_phy, # List of supermatrix parameter options of PHYLIP print OUT -> IN (defined) / OUT (changed)
\@parameter_nex, # List of supermatrix parameter options of NEXUS print OUT -> IN (defined) / OUT (changed)
\@parameter_con, # List of consensus options -> IN (defined) / OUT (changed)
\@parameter_file, # List of filehandling options -> IN (defined) / OUT (changed)
\@parameter_fas, # List of supermatrix parameter options of FASTA print OUT -> IN (defined) / OUT (changed)
\@parameter_3rd, # List of third position handling -> IN (defined) / OUT (changed)
\@parameter_ryc, # List of RY coding -> IN (defined) / OUT (changed)
\@parameter_tra, # List of Sequence transaltion options -> IN (defined) / OUT (changed)
\@parameter_par, # Print parsimonious sites as extra msa file -> IN (defined) / OUT (changed)
\@parameter_ren, # Rename taxon names of given ifiles -> IN (defined) / OUT (changed)
\@parameter_prt, # Print partition files for concatenated data -> IN (defined) / OUT (changed)
\@parameter_pro, # Start prottest analyses für aa data -> IN (defined) / OUT (changed)
\%outfile_name, # Outfilename of output option -> IN (defined) / OUT (unchanged)
);
##############################
################################################################## END ###############################################################################
sub argv_handling{
my $aref_parameter_all = $_[0] ; # List of parameter options of data concatenation -> IN (defined) / OUT (changed)
my $aref_parameter_inf = $_[1] ; # List of parameter options of info print out -> IN (defined) / OUT (changed)
my $aref_parameter_phy = $_[2] ; # List of supermatrix parameter options of PHYLIP print OUT -> IN (defined) / OUT (changed)
my $aref_parameter_nex = $_[3] ; # List of supermatrix parameter options of NEXUS print OUT -> IN (defined) / OUT (changed)
my $aref_parameter_con = $_[4] ; # List of consensus options -> IN (defined) / OUT (changed)
my $aref_parameter_fil = $_[5] ; # List of of file handling -> IN (defined) / OUT (changed)
my $aref_parameter_fas = $_[6] ; # List of supermatrix parameter options of FASTA print OUT -> IN (defined) / OUT (changed)
my $aref_parameter_3rd = $_[7] ; # List of third position handling -> IN (defined) / OUT (changed)
my $aref_parameter_ryc = $_[8] ; # List of RY coding -> IN (defined) / OUT (changed)
my $aref_parameter_tra = $_[9] ; # List of sequence translation options -> IN (defined) / OUT (changed)
my $aref_parameter_par = $_[10]; # List of sequence translation options -> IN (defined) / OUT (changed)
my $aref_parameter_ren = $_[11]; # Rename taxon names of given ifiles -> IN (defined) / OUT (changed)
my $aref_parameter_prt = $_[12]; # Print partition files for concatenated data -> IN (defined) / OUT (changed)
my $aref_parameter_pro = $_[13]; # Start prottest analyses für aa data -> IN (defined) / OUT (changed)
my $href_outfile_name = $_[14]; # Outfilename of output option -> IN (defined) / OUT (unchanged)
############################## START ARGV READ IN
## READ IN and assign terminal command options
## Set chosen parameter option one step further if associated command option is given
my ( $commandline ) = join "", @ARGV ;
if ( $commandline ){
##############################
## substitute blanks to '' & split up commandline using '-' signs
## delete first (empty) entry in @commands
$commandline =~ s/ |\s+// ;
my @commands = split '-', $commandline ;
shift @commands;
##############################
##############################
## Change parameter of given command
## Skip to main menu if a command option is unknown
## or '-s' command missing
for my $single_command ( sort @commands ){
if ( $single_command =~ /^help$/i ) { &help } # '-help' -> open help menu
elsif ( $single_command =~ /^i$/i ) { @$aref_parameter_inf = reverse @$aref_parameter_inf } # '-i' -> set additional info print to YES; '-i -i' -> to NO
elsif ( $single_command =~ /^f$/i ) { @$aref_parameter_all = reverse @$aref_parameter_all } # '-f' -> set infile READ IN to defined; '-f -f' -> to all possible infiles
elsif ( $single_command =~ /^a$/i ) { @$aref_parameter_fas = reverse @$aref_parameter_fas } # '-a' -> set FASTA output to NO; '-a -a' -> to YES
elsif ( $single_command =~ /^d$/i ) { @$aref_parameter_3rd = reverse @$aref_parameter_3rd } # '-d' -> Reject 3rd position; '-d -d' -> Remain 3rd position
elsif ( $single_command =~ /^j$/i ) { @$aref_parameter_par = reverse @$aref_parameter_par } # '-j' -> set PARSIMONY output to YES; '-j -j' -> to NO
elsif ( $single_command =~ /^k$/i ) { @$aref_parameter_ren = reverse @$aref_parameter_ren } # '-k' -> set rename of sequence names to YES; '-k -k' -> to NO
elsif ( $single_command =~ /^l$/i ) { @$aref_parameter_prt = reverse @$aref_parameter_prt } # '-l' -> set part. file of conc matrix to Supermatrix; '-l -l' -> to NO
elsif ( $single_command =~ /^m$/i ) { @$aref_parameter_pro = reverse @$aref_parameter_pro } # '-m' -> start prottest under linux; '-m -m' -> don't start prottest (default)
elsif ( $single_command =~ /^e$/i ) { my $tl = shift @$aref_parameter_tra ; push @$aref_parameter_tra, $tl } # '-e' -> translate nuc data to aa data; '-e -e' -> translate aa data to nuc data '-e -e -e' -> no translation
elsif ( $single_command =~ /^c$/i ) { my $tl = shift @$aref_parameter_con ; push @$aref_parameter_con, $tl } # '-c' -> Generate frequency consensus sequence; '-c -c' -> majority consensus; '-c -c -c' -> strict consensus; '-c -c -c -c' -> to default (no consensus)
elsif ( $single_command =~ /^p$/i ) { my $tl = shift @$aref_parameter_phy ; push @$aref_parameter_phy, $tl } # '-p' -> set supermatrix format to strict phylip; '-p -p' -> to relaxed phylip; '-p -p -p' -> to default (no phylip)
elsif ( $single_command =~ /^n$/i ) { my $tl = shift @$aref_parameter_nex ; push @$aref_parameter_nex, $tl } # '-n' -> set supermatrix format to nexus block; '-n -n' -> to MrBayes nexus block; '-n -n -n' -> to default (no nexus)
elsif ( $single_command =~ /^o$/i ) { my $tl = shift @$aref_parameter_fil ; push @$aref_parameter_fil, $tl } # '-o' -> convert only infiles; '-o -o' -> Supermatrix & infiles; '-o -o -o' -> print out only supermatrix file
elsif ( $single_command =~ /^b$/i ) { my $tl = shift @$aref_parameter_ryc ; push @$aref_parameter_ryc, $tl } # '-b' -> RY coding complete sequences '-b -b' -> RY coding 3rd positions; '-b -b -b' -> no RY coding
elsif ( $single_command =~ /^s$/i ) { # '-s' -> Start FASconCAT
&start(
\@$aref_parameter_all, # List of parameter options of data concatenation -> IN (defined) / OUT (changed)
\@$aref_parameter_inf, # List of parameter options of info print out -> IN (defined) / OUT (changed)
\@$aref_parameter_phy, # List of supermatrix parameter options of PHYLIP print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_nex, # List of supermatrix parameter options of NEXUS print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_con, # List of consensus options -> IN (defined) / OUT (changed)
\@$aref_parameter_fil, # List of of file handling -> IN (defined) / OUT (changed)
\@$aref_parameter_fas, # List of supermatrix parameter options of FASTA print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_3rd, # List of third position handling -> IN (defined) / OUT (changed)
\@$aref_parameter_ryc, # List of RY coding -> IN (defined) / OUT (changed)
\@$aref_parameter_tra, # List of sequence translation options -> IN (defined) / OUT (changed)
\@$aref_parameter_par, # Print parsimonious sites as extra msa file -> IN (defined) / OUT (changed)
\@$aref_parameter_ren, # Rename taxon names of given ifiles -> IN (defined) / OUT (changed)
\@$aref_parameter_prt, # Print partition files for concatenated data -> IN (defined) / OUT (changed)
\@$aref_parameter_pro, # Start Prottest -> IN (defined) / OUT (changed)
\%$href_outfile_name, # Outfilename of output option -> IN (defined) / OUT (unchanged)
)
}
else {
print "\n\tCOMMAND-ERROR!: Unknown command ", $single_command, "!\n" ; # 'unknown command' -> print ERROR prompt
##############################
## Open Menu if unknown command is given
&menu ;
¶meter (
\@$aref_parameter_all, # List of parameter options of data concatenation -> IN (defined) / OUT (changed)
\@$aref_parameter_inf, # List of parameter options of info print out -> IN (defined) / OUT (changed)
\@$aref_parameter_phy, # List of supermatrix parameter options of PHYLIP print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_nex, # List of supermatrix parameter options of NEXUS print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_con, # List of consensus options -> IN (defined) / OUT (changed)
\@$aref_parameter_fil, # List of of file handling -> IN (defined) / OUT (changed)
\@$aref_parameter_fas, # List of supermatrix parameter options of FASTA print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_3rd, # List of third position handling -> IN (defined) / OUT (changed)
\@$aref_parameter_ryc, # List of RY coding -> IN (defined) / OUT (changed)
\@$aref_parameter_tra, # List of sequence translation options -> IN (defined) / OUT (changed)
\@$aref_parameter_par, # Print parsimonious sites as extra msa file -> IN (defined) / OUT (changed)
\@$aref_parameter_ren, # Rename taxon names of given ifiles -> IN (defined) / OUT (changed)
\@$aref_parameter_prt, # Print partition files for concatenated data -> IN (defined) / OUT (changed)
\@$aref_parameter_pro, # Start Prottest -> IN (defined) / OUT (changed)
\%$href_outfile_name, # Outfilename of output option -> IN (defined) / OUT (unchanged)
)
##############################
}
}
##############################
## Open Menu if '-s' command is missing
&menu ;
¶meter (
\@$aref_parameter_all, # List of parameter options of data concatenation -> IN (defined) / OUT (changed)
\@$aref_parameter_inf, # List of parameter options of info print out -> IN (defined) / OUT (changed)
\@$aref_parameter_phy, # List of supermatrix parameter options of PHYLIP print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_nex, # List of supermatrix parameter options of NEXUS print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_con, # List of consensus options -> IN (defined) / OUT (changed)
\@$aref_parameter_fil, # List of of file handling -> IN (defined) / OUT (changed)
\@$aref_parameter_fas, # List of supermatrix parameter options of FASTA print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_3rd, # List of third position handling -> IN (defined) / OUT (changed)
\@$aref_parameter_ryc, # List of RY coding -> IN (defined) / OUT (changed)
\@$aref_parameter_tra, # List of sequence translation options -> IN (defined) / OUT (changed)
\@$aref_parameter_par, # Print parsimonious sites as extra msa file -> IN (defined) / OUT (changed)
\@$aref_parameter_ren, # Rename taxon names of given ifiles -> IN (defined) / OUT (changed)
\@$aref_parameter_prt, # Print partition files for concatenated data -> IN (defined) / OUT (changed)
\@$aref_parameter_pro, # Start Prottest -> IN (defined) / OUT (changed)
\%$href_outfile_name, # Outfilename of output option -> IN (defined) / OUT (unchanged)
)
##############################
}
############################## END ARGV READ IN
}
sub menu{ system('cls');
print "";
printf "\n%68s\n","------------------------------------------------------------" ;
printf "%53s\n" , "Welcome to FASconCAT-G v1.0 !" ;
printf "%58s\n" , "A perlscript for sequence concatenation" ;
printf "%59s\n" , "written by Patrick Kueck (ZFMK Bonn, 2010/14)" ;
printf "%68s\n\n", "------------------------------------------------------------" ;
}
sub parameter{
my $aref_parameter_all = $_[0] ; # List of parameter options of data concatenation -> IN (defined) / OUT (changed)
my $aref_parameter_inf = $_[1] ; # List of parameter options of info print out -> IN (defined) / OUT (changed)
my $aref_parameter_phy = $_[2] ; # List of supermatrix parameter options of PHYLIP print OUT -> IN (defined) / OUT (changed)
my $aref_parameter_nex = $_[3] ; # List of supermatrix parameter options of NEXUS print OUT -> IN (defined) / OUT (changed)
my $aref_parameter_con = $_[4] ; # List of consensus options -> IN (defined) / OUT (changed)
my $aref_parameter_fil = $_[5] ; # List of of file handling -> IN (defined) / OUT (changed)
my $aref_parameter_fas = $_[6] ; # List of supermatrix parameter options of FASTA print OUT -> IN (defined) / OUT (changed)
my $aref_parameter_3rd = $_[7] ; # List of third position handling -> IN (defined) / OUT (changed)
my $aref_parameter_ryc = $_[8] ; # List of RY coding -> IN (defined) / OUT (changed)
my $aref_parameter_tra = $_[9] ; # List of sequence translation options -> IN (defined) / OUT (changed)
my $aref_parameter_par = $_[10]; # List of sequence translation options -> IN (defined) / OUT (changed)
my $aref_parameter_ren = $_[11]; # Rename taxon names of given ifiles -> IN (defined) / OUT (changed)
my $aref_parameter_prt = $_[12]; # Print partition files for concatenated data -> IN (defined) / OUT (changed)
my $aref_parameter_pro = $_[13]; # Start prottest analyses für aa data -> IN (defined) / OUT (changed)
my $href_outfile_name = $_[14]; # Outfilename of output option -> IN (defined) / OUT (unchanged)
##############################
## Print parameter setting and available command options
print "\tSTART\t FASconCAT :\t\t type <s> <enter>",
"\n",
"\n\tINFILES\t ALL/SINGLE :\t\t type <f> <enter>",
"\n\tINFO\t ALL/BASIC :\t\t type <i> <enter>",
"\n",
"\n\tPROCESSING SMATRIX/CONV. :\t\t type <o> <enter>",
"\n\tSEQ.TRANS. NO/NUC/AA :\t\t type <e> <enter>",
"\n\t3rd POS. REMAIN/REJECT :\t\t type <d> <enter>",
"\n\tRY CODING NO/ALL/3rd :\t\t type <b> <enter>",
"\n\tCONSENSUS N0/YES :\t\t type <c> <enter>",
"\n\tRENAME SEQ NO/YES :\t\t type <k> <enter>",
"\n",
"\n\tNEXUS BLOCK/MrBAYES :\t\t type <n> <enter>",
"\n\tPHYLIP NO/YES :\t\t type <p> <enter>",
"\n\tFASTA YES/NO :\t\t type <a> <enter>",
"\n\tPARTITION NO/Supermatrix:\t\t type <l> <enter>",
"\n\tPARSIMONY NO/YES :\t\t type <j> <enter>",
"\n\tPROTTEST NO/YES :\t\t type <m> <enter>",
"\n",
"\n\tHELP FASconCAT :\t\t type <h> <enter>",
"\n\tQUIT FASconCAT :\t\t type <q> <enter>",
"\n\tPREFACE FASconCAT :\t\t type <g> <enter>",
"\n",
"\n\t------------------------------------------------------------",
"\n",
"\n\tFILE INPUT",
"\n\t-----------------",
"\n\tPROCESSING ALL FILES :\t$aref_parameter_all->[0]",
"\n\tPROCESSING SINGLE FILES :\t$aref_parameter_all->[1]",
"\n\tPROCESSING SEQ. TRANSL. :\t$aref_parameter_tra->[0]",
"\n\tPROCESSING 3rd POSITION\t :\t$aref_parameter_3rd->[0]",
"\n\tPROCESSING RY CODING\t :\t$aref_parameter_ryc->[0]",
"\n\tPROCESSING CONSENSUS\t :\t$aref_parameter_con->[0]",
"\n\tRENAME SEQUENCE NAMES\t :\t$aref_parameter_ren->[0]",
"\n",
"\n\tFILE OUTPUT",
"\n\t-----------------",
"\n\tALL INFO :\t$aref_parameter_inf->[0]",
"\n\tFILE PROCESSING :\t$aref_parameter_fil->[0]",
"\n\n\tNEXUS :\t$aref_parameter_nex->[0]",
"\n\tPHYLIP :\t$aref_parameter_phy->[0]",
"\n\tFASTA :\t$aref_parameter_fas->[0]\n",
"\n\tPARTITION FILE :\t$aref_parameter_prt->[0]",
"\n\tPARSIMONY :\t$aref_parameter_par->[0]",
"\n\tPROTTEST :\t$aref_parameter_pro->[0]\n",
"\n\t------------------------------------------------------------"
;
##############################
##############################
## (1) Read IN user defined comman
## (2) If command option allowed, change parameter setting
## (3) unless user defined command allowed print error prompt
my $start_string ;
my $single_command = &commandline ( \$start_string ) ; # (1)
# (2)
unless ( $single_command =~ /^s$|^i$|^f$|^q$|^h$|^n$|^p$|^a$|^c$|^o$|^a$|^b$|^q$|^d$|^e$|^g$|^j$|^k$|^l$|^m$/i ){ print "\n\tCOMMAND-ERROR!: Unknown command ".$single_command."!\n" }
# (3)
if ( $single_command =~ /^h$/i ) { &help } # '-h' -> open help menu
elsif ( $single_command =~ /^g$/i ) { &preface} # '-e' -> open preface menu
elsif ( $single_command =~ /^q$/i ) { exit } # '-q' -> exit FASconCAT
elsif ( $single_command =~ /^i$/i ) { @$aref_parameter_inf = reverse @$aref_parameter_inf } # '-i' -> set additional info print to YES; '-i -i' -> to NO
elsif ( $single_command =~ /^f$/i ) { @$aref_parameter_all = reverse @$aref_parameter_all } # '-f' -> set infile READ IN to defined; '-f -f' -> to all possible infiles
elsif ( $single_command =~ /^a$/i ) { @$aref_parameter_fas = reverse @$aref_parameter_fas } # '-a' -> set FASTA output to NO; '-a -a' -> to YES
elsif ( $single_command =~ /^j$/i ) { @$aref_parameter_par = reverse @$aref_parameter_par } # '-j' -> set PARSIMONY output to YES; '-j -j' -> to NO
elsif ( $single_command =~ /^d$/i ) { @$aref_parameter_3rd = reverse @$aref_parameter_3rd } # '-d' -> Reject 3rd position; '-d -d' -> Remain 3rd position
elsif ( $single_command =~ /^k$/i ) { @$aref_parameter_ren = reverse @$aref_parameter_ren } # '-k' -> set rename of sequence names to YES; '-k -k' -> to NO
elsif ( $single_command =~ /^l$/i ) { @$aref_parameter_prt = reverse @$aref_parameter_prt } # '-l' -> set part. file of conc matrix to Supermatrix; '-l -l' -> to NO
elsif ( $single_command =~ /^m$/i ) { @$aref_parameter_pro = reverse @$aref_parameter_pro } # '-m' -> start prottest under linux; '-m -m' -> don't start prottest (default)
elsif ( $single_command =~ /^e$/i ) { my $tl = shift @$aref_parameter_tra ; push @$aref_parameter_tra, $tl } # '-e' -> translate nuc data to aa data; '-e -e' -> translate aa data to nuc data '-e -e -e' -> no translation
elsif ( $single_command =~ /^c$/i ) { my $tl = shift @$aref_parameter_con ; push @$aref_parameter_con, $tl } # '-c' -> Generate frequency consensus sequence; '-c -c' -> majority consensus; '-c -c -c' -> strict consensus; '-c -c -c -c' -> to default (no consensus)
elsif ( $single_command =~ /^p$/i ) { my $tl = shift @$aref_parameter_phy ; push @$aref_parameter_phy, $tl } # '-p' -> set supermatrix format to strict phylip; '-p -p' -> to relaxed phylip; '-p -p -p' -> to default (no phylip)
elsif ( $single_command =~ /^n$/i ) { my $tl = shift @$aref_parameter_nex ; push @$aref_parameter_nex, $tl } # '-n' -> set supermatrix format to nexus block; '-n -n' -> to MrBayes nexus block; '-n -n -n' -> to default (no nexus)
elsif ( $single_command =~ /^b$/i ) { my $tl = shift @$aref_parameter_ryc ; push @$aref_parameter_ryc, $tl } # '-b' -> RY coding complete sequences '-b -b' -> RY coding 3rd positions; '-b -b -b' -> no RY coding
elsif ( $single_command =~ /^o$/i ) { my $tl = shift @$aref_parameter_fil ; push @$aref_parameter_fil, $tl } # '-o' -> convert only infiles; '-o -o' -> Supermatrix & infiles; '-o -o -o' -> print out only supermatrix file
elsif ( $single_command =~ /^s$/i ) { # '-s' -> Start FASconCAT
&start(
\@$aref_parameter_all, # List of parameter options of data concatenation -> IN (defined) / OUT (changed)
\@$aref_parameter_inf, # List of parameter options of info print out -> IN (defined) / OUT (changed)
\@$aref_parameter_phy, # List of supermatrix parameter options of PHYLIP print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_nex, # List of supermatrix parameter options of NEXUS print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_con, # List of consensus options -> IN (defined) / OUT (changed)
\@$aref_parameter_fil, # List of of file handling -> IN (defined) / OUT (changed)
\@$aref_parameter_fas, # List of supermatrix parameter options of FASTA print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_3rd, # List of third position handling -> IN (defined) / OUT (changed)
\@$aref_parameter_ryc, # List of RY coding -> IN (defined) / OUT (changed)
\@$aref_parameter_tra, # List of sequence translation options -> IN (defined) / OUT (changed)
\@$aref_parameter_par, # Print parsimonious sites as extra msa file -> IN (defined) / OUT (changed)
\@$aref_parameter_ren, # Rename taxon names of given ifiles -> IN (defined) / OUT (changed)
\@$aref_parameter_prt, # Print partition files for concatenated data -> IN (defined) / OUT (changed)
\@$aref_parameter_pro, # Start Prottest -> IN (defined) / OUT (changed)
\%$href_outfile_name, # Outfilename of output option -> IN (defined) / OUT (unchanged)
)
}
&menu;
¶meter(
\@$aref_parameter_all, # List of parameter options of data concatenation -> IN (defined) / OUT (changed)
\@$aref_parameter_inf, # List of parameter options of info print out -> IN (defined) / OUT (changed)
\@$aref_parameter_phy, # List of supermatrix parameter options of PHYLIP print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_nex, # List of supermatrix parameter options of NEXUS print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_con, # List of consensus options -> IN (defined) / OUT (changed)
\@$aref_parameter_fil, # List of of file handling -> IN (defined) / OUT (changed)
\@$aref_parameter_fas, # List of supermatrix parameter options of FASTA print OUT -> IN (defined) / OUT (changed)
\@$aref_parameter_3rd, # List of third position handling -> IN (defined) / OUT (changed)
\@$aref_parameter_ryc, # List of RY coding -> IN (defined) / OUT (changed)
\@$aref_parameter_tra, # List of sequence translation options -> IN (defined) / OUT (changed)
\@$aref_parameter_par, # Print parsimonious sites as extra msa file -> IN (defined) / OUT (changed)
\@$aref_parameter_ren, # Rename taxon names of given ifiles -> IN (defined) / OUT (changed)
\@$aref_parameter_prt, # Print partition files for concatenated data -> IN (defined) / OUT (changed)
\@$aref_parameter_pro, # Start Prottest -> IN (defined) / OUT (changed)
\%$href_outfile_name, # Outfilename of output option -> IN (defined) / OUT (unchanged)
) ;
##############################
}
sub help{
system('cls');
print
<<help
--------------------FASconCAT-G HELP-MENU---------------------------
'Features'
--------------------------
- Sequence concatenation of single infiles of different formats:
- FASTA (.fas or .FASTA)
- PHYLIP (.phy -> Relaxed or Strict)
- CLUSTAL (.aln)
- Multiple supermatrix output formats in one process run:
- FASTA (.fas or .FASTA)
- PHYLIP (.phy -> Relaxed or Strict)
- NEXUS (.nex -> BLOCK with or without MrBayes commands)
- Multiple file conversion of infiles in one process run:
- FASTA (.fas or .FASTA)
- PHYLIP (.phy -> Relaxed or Strict)
- NEXUS (.nex -> BLOCK with or without MrBayes commands)
- Processing of specific consensus sequences using either...
- Strict consensus rules
- Majority consensus rules or
- Frequency consensus rules
- RY-Coding of complete sequences (nucleotide data only)
- RY-Coding of 3rd codon positions (nucleotide data only)
- Removing of 3rd codon positions (nucleotide data only)
- Sequence translation (nucleotide data to amino acid data
and vice versa)
- Print OUT of parsimony informative sites within infiles
and concatenated supermatrix
- Handling & identification of specific secondary structure positions
- Additional output information includes...
- Infile ranges in supermatrix sequences
- Character state distributions within individual infiles and the supermatrix
- Sequence type of individual infiles and the supermatrix
- Sequence lengths of individual infiles
- Number of gaps and ambiguous sites within infiles and the supermatrix
- Number of missing sequences for each individual from the supermatrix
- Number of GC character states within individual infiles and the supermatrix
- Number of parsimony informative sites in individual infiles and the supermatrix
- Proportion of character states in supermatrix sequences
- Proportion of gaps and ambiguous sites in supermatrix sequences
- Proportion of GC in supermatrix sequences
- Proportion of parsimony informative sites in supermatrix sequences
- Number of structure characters seperated in loops and stems
- Number and percent of loop and stem positions per fragment
- Separated list (FcC_structure.txt) for loop positions and
stem pairings whitin the supermatrix and the infiles
- All features can be optionally combined or modified via:
- Terminal command line
- The FASconCAT (FcC) terminal menu
--------------------------
'Start FASconCAT'
--------------------------
To start FASconCAT, open the script by via the terminal.
>Via FASconCAT terminal menu:
- Open the menu by entering command:
perl FASconCAT-G_v1.0.pl <enter> (Linux/Mac)
FASconCAT-G_v1.0.pl <enter> (Windows)
- To start FASconCAT under default, enter command:
s <enter>
>Via terminal command line, enter command:
- perl FASconCAT_v1.0.pl [command options] <enter> (Linux/Mac)
- FASconCAT_v1.0.pl [command options] <enter> (Windows)
- To start FASconCAT under default, enter command:
perl FASconCAT_v1.0.pl -s <enter>
--------------------------
Command options:
--------------------------
The following command options can be used as stand alone commands
or in combination with other commands. Command options can be invoked
in a single line via the terminal command window or individually via
the FASconCAT menu (without the minus'-' specification in the menu).
Command options can be input in any order.
- Output processing (-o option)
- FcC can be used for sequence concatenation and/or file
conversion.
- Under default, FcC prints OUT a supermatrix with concatenated
sequences in FASTA format in a file called
"FcC_supermatrix.fas".
- For infile format conversions WITHOUT printing
a supermatrix, enter command:
-o
- For format conversions of given infiles AND
concatenated supermatrix output, enter command:
-o -o
- Sequence translation (-e option)
- FcC can translate nucleotide data to amino acid data and
vice versa. Sequence translation happens before exclusion of
third nucleotide codon positions (if -d option is defined).
- FcC does not recognize stop codons in amino acid data or
reading frames in nucleotide data. Stop codons have to be
excluded in amino acid data before using FcC!
- Nucleotide triplets are translated to their corresponding
amino acid. Ambiguity states in triplets are recognized if
their coding nucleotide states can be definitively assigned
to a specific amino acid state (e.g., 'YTR' -> Leucine/L).
Undefined triplets, such as 'A-G' are translated to '?'. To
select for translation of nucleotide data, enter command:
-e
- Amino acid states are translated to nucleotide triplets using
the compressed IUPAC triplet code for the corresponding amino
acid (e.g. Phenylalanin/F -> 'TTY'). Unrecognized states, such
as '-' or 'X', are translated to '???'.
To define reverse translation of amino acid data, enter command:
-e -e
- Renaming sequence names (-k option)
- To rename defined sequence names prior to file
file processing, enter command:
-k
- Note: the user must provide an extra info file named
"new_seq_names.txt" in the FcC home folder where each row
has the old name delimited from the new name by a tabstop.
- Sequences not specified in the "new_seq_names.txt" file are
left unchanged. FcC prints additional information of the
renaming process to "FcC_rename_control.txt".
- Rejecting 3rd codon position (-d option)
- To exclude 3rd codon positions in given nucleotide infiles and/or
supermatrices, enter command:
-d
- RY coding (-b option)
- To translate third codon positions of nucleotide data into R/Y
code (nucleotide data only), enter command:
-b
e.g., File_1 (nucleotide data):
tax1_allel_0 ACGTTTTGGTTT -> ACRTTYTGRTTY...
- To translate complete sequences into R/Y code, enter command:
-b -b
e.g., File_1 (nucleotide data):
tax1_allel_0 ACGTTTTGGTTT -> RYRYYYYRRYYY...
- Processing consensus sequences (-c option)
- FASconCAT can generate consensus sequences for given infile and/or
supermatrix sequences by building consensus states for sequences
with identical sequence names (identical alphanumeric characters
before the first underscore). Consensus outfile sequences are
named by their sequence names, followed by the suffix '_consensus'.
If no underscore is found in sequence names, FcC will use the
complete sequence name for identification of unique sequences.
e.g., MSA infile: -> Consensus outfile:
Taxon_1 AAAACCC
Taxon_2 AAAACCC
Taxon AAAACCC -> Taxon_consensus AAAACCC
taxon1 AAAACCC -> taxon_1_consensus AAAACCC
Tax_1 AAAGCCT
Tax_2 AAAGCCT -> Tax_consensus AAAGCCT
- There are three different options for building a consensus sequence:
- Most frequent, enter command: -c
- Majority rule, enter command: -c -c
- Strict, enter command: -c -c -c
- Most Frequent ('Freq')
- Builds consensus by taking most frequent character state
of each site. If two or more character states are equally frequent,
FASconCAT uses the corresponding IUPAC ambiguity code
as the consensus state for nucleotide data or '?' (amino acid data).
e.g., File_1 (nucleotide data):
tax1_allel_0 ACGTTTTCGTTT...
tax1_allel_1 ACGTTTTGTTTT...
tax1_allel_2 ACGTTTTGGTTT...
tax1 ACGTTTTTTTTT...
--------------
tax1_consensus ACGTTTTGKTTT...
e.g., File_2 (amino acid data):
tax1_allel_0 NYGKRDEDPWFP...
tax1_allel_1 NYGKRDEDCWFP...
tax1_allel_2 NYGKRDEQCWFP...
tax1 NYGKRDEQCWFP...
--------------
tax1_consensus NYGKRDE?CWFP...
- Majority Frequent ('Maj'):
- Builds consensus by only considering character states that
occur in more than 50% of sequences on a specific site as
consensus state, otherwise assigns '?' (nucleotide & amino
acid data).
e.g., File_1 (nucleotide or amino acid data):
tax1_allel_0 ACGTTTTGGTTT...
tax1_allel_1 ACGTTTTGTTTT...
tax1_allel_2 ACGTTTTGGTTT...
tax1 ACGTTTTTTTTT...
--------------
tax1_consensus ACGTTTTG?TTT...
- Strict Consensus ('Strict'):
- Builds consensus by taking either sequence states
which are fixed in all sequences at a given site or by
using the corresponding IUPAC ambiguity code (nucleotide
data) or 'X' (amino acid data)
e.g., File_1 (nucleotide data):
tax1_allel_0 ACGTTTTGGTTT...
tax1_allel_1 ACGTTTTGTTTT...
tax1_allel_2 ACGTTTTGGTTT...
tax1 ACGTTTTTTTTT...
--------------
tax1_consensus ACGTTTTKKTTT...
e.g., File_2 (amino acid data):
tax1_allel_0 NYGKRDEDPWFP...
tax1_allel_1 NYGKRDEDCWFP...
tax1_allel_2 NYGKRDEQCWFP...
tax1 NYGKRDEQCWFP...
--------------
tax1_consensus NYGKRDEXXWFP...
- READ IN specific sequence infiles (-f option)
- Under default settings, FASconCAT reads in all
files in the working directory that are in FASTA
(.fas or .FASTA), PHYLIP (.phy) or CLUSTAL (.aln)
format. If the '-f' option is chosen, a new list-window
opens after starting FcC. Here input files can be
defined by typing each files assigned numbers (separated
by commas and without line spaces) in a single row.
e.g. -f -s <enter> :
0 infile_1.fas
1 infile_2.phy
2 infile_3.aln
3 infile_4.FASTA
Type: 1,2 <enter> to choose infile_2.phy & infile_3.aln
- Reduction of FASconCAT sequence information (-i option)
- To increase computation speed and reduce the amount of
information FcC prints OUT regarding the infiles and
supermatrix, enter command:
-i
- Print OUT of parsimony informative sites (-j option)
- FASconCAT can print OUT parsimony informative sites
for given infiles and the supermatrix (regarded to
the selected -o option). To print OUT parsimony
informative sites, enter command:
-j
- Definition of output file formats:
- Under default options, FASconCAT prints all output files in
FASTA format. To switch off output of FASTA formatted files,
enter command:
-a
- FcC can also output NEXUS and PHYLIP formatted files:
- To output files in PHYLIP (STRICT) format (sequence
names are restricted to 10 characters), enter command:
-p
- To output files in PHYLIP (RELAXED) format (sequence names
can be up to 250 characters), enter command:
-p -p
- To output files in NEXUS (BLOCK) format (NEXUS blocks),
enter command:
-n
- To output files in NEXUS (MrBAYES) format (NEXUS blocks
with additional MrBayes commands), enter command:
-n -n
- Print OUT partition file(s) (-l option)
- When the sequence concatenation option has been defined, the
user can print additional partition files by entering this
command:
-l
- If the user selects to output a supermatrix in FASTA and/or
PHYLIP format, FcC will print an associated gene partition file
"FcC_supermatrix_partition.txt", which can be directly used for
maximum likelihood analyses in RAxML.
- If the user has selected to output a supermatrix in NEXUS (MrBayes)
format, FcC prints an additional NEXUS file
"FcC_supermatrix_partition.nex" in which gene partitions are
defined.
- Note: the parameters in the partitioned NEXUS (MrBayes) file
differ from those in the non-partitioned version.
--------------------------
For further detailed information please consult
the manual or write an email to patrick_kueck\@web.de
------------------------------------------------------------
help
;
print "\tBACK to FASconCAT MAIN-Menu:\t\t type <return>\n" ;
print "\n\t------------------------------------------------------------\n\t" ;
chomp ( my $answer_xy = <STDIN> );
&menu; ¶meter ;
}
sub preface{
system('cls');
print
<<preface
--------------------FASconCAT PREFACE---------------------
Version : G-1.0
Language : PERL
Last Update : April, 2014
Author : Patrick Kueck, ZFMK Bonn, GERMANY
e-mail : patrick_kueck\@web.de
Homepage : http://fasconcat.zfmk.de
This program is free software; you can distribute it
and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation ;
either version 2 of the License, or (at your option) any
later version.
This program 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 this program; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
USA.
For further free downloadable programs visit:
http://software.zfmk.de
------------------------------------------------------------
preface
;
print "\tBACK to FASconCAT MAIN-Menu:\t\t type <return>\n" ;
print "\n\t------------------------------------------------------------\n\t" ;
chomp ( my $answer_xy = <STDIN> );
&menu; ¶meter ;
}
sub start{
my $aref_parameter_all = $_[0] ; # List of parameter options of data concatenation -> IN (defined) / OUT (unchanged)
my $aref_parameter_inf = $_[1] ; # List of parameter options of info print out -> IN (defined) / OUT (unchanged)
my $aref_parameter_phy = $_[2] ; # List of supermatrix parameter options of PHYLIP print OUT -> IN (defined) / OUT (unchanged)
my $aref_parameter_nex = $_[3] ; # List of supermatrix parameter options of NEXUS print OUT -> IN (defined) / OUT (unchanged)
my $aref_parameter_con = $_[4] ; # List of consensus options -> IN (defined) / OUT (unchanged)
my $aref_parameter_fil = $_[5] ; # List of of file handling -> IN (defined) / OUT (unchanged)
my $aref_parameter_fas = $_[6] ; # List of supermatrix parameter options of FASTA print OUT -> IN (defined) / OUT (unchanged)
my $aref_parameter_3rd = $_[7] ; # List of third position handling -> IN (defined) / OUT (unchanged)
my $aref_parameter_ryc = $_[8] ; # List of RY coding -> IN (defined) / OUT (unchanged)
my $aref_parameter_tra = $_[9] ; # List of sequence translation options -> IN (defined) / OUT (unchanged)
my $aref_parameter_par = $_[10]; # Print parsimonious sites as extra msa file -> IN (defined) / OUT (unchanged)
my $aref_parameter_ren = $_[11]; # Rename taxon names of given ifiles -> IN (defined) / OUT (unchanged)
my $aref_parameter_prt = $_[12]; # Print partition files for concatenated data -> IN (defined) / OUT (unchanged)
my $aref_parameter_pro = $_[13]; # Start prottest analyses for aa data -> IN (defined) / OUT (unchanged)
my $href_outfile_name = $_[14]; # Outfilename of output option -> IN (defined) / OUT (unchanged)
##############################
## Print Menu Header and start info
&menu ;
print "\n\n\t#### FASconCAT-G: START ! ####" ;
print "\n\t------------------------------------------------------------\n\n" ;
##############################
##############################
## Check if any outputformat has been chosen
if ( ( $aref_parameter_fas->[0] eq 'NO' ) && ( $aref_parameter_phy->[0] eq 'NO' ) && ( $aref_parameter_nex->[0] eq 'NO' ) ){ die "\n\t!COMMAND-ERROR!: No output format selected!\n" }
##############################
##############################
## Definement of global variabels used in these subroutine and further sub-subroutines
my (
%hol_seq_of_tax_of_infile, # key: input file name; value ; list of taxa and corresponding sequences (e.g. infile_1 = taxon1, sequence_of_taxon1, taxon2, sequence_of_taxon2, taxon3....)
%taxa_all_files, # key: taxon name; value : number of occurence in infiles
%hoh_info_of_infile_of_type, # key1: infilename, key2: type of info (e.g. 'seqlength'); info type associated value
@input_files, # list of input files found in fas, FASTA, phy, or aln format
$structure_seq # defined if structure sequence present in infiles
) ;
##############################
##############################
## READ IN of possible infile names (CLUSTAL, FASTA, PHYLIP formatted files)
## Store file names in @input_files
for my $format ( qw/aln phy FASTA fas fasta/ ){
for my $file_input ( <*.$format> ){ push @input_files, $file_input }
}
############################## checked !
##############################
## If only single, user specified infiles should be concatenated
## open file request via FASconCAT menu and store only user defined infiles in @input_files
if ( $aref_parameter_all->[0] eq 'NO' ){
&single_define (
\@$aref_parameter_all, # List of parameter options of data concatenation -> IN (defined) / OUT (unchanged)
\@$aref_parameter_inf, # List of parameter options of info print out -> IN (defined) / OUT (unchanged)
\@$aref_parameter_phy, # List of supermatrix parameter options of PHYLIP print OUT -> IN (defined) / OUT (unchanged)
\@$aref_parameter_nex, # List of supermatrix parameter options of NEXUS print OUT -> IN (defined) / OUT (unchanged)
\@$aref_parameter_con, # List of consensus options -> IN (defined) / OUT (unchanged)
\@$aref_parameter_fil, # List of of file handling -> IN (defined) / OUT (unchanged)
\@$aref_parameter_fas, # List of supermatrix parameter options of FASTA print OUT -> IN (defined) / OUT (unchanged)
\@$aref_parameter_3rd, # List of third position handling -> IN (defined) / OUT (unchanged)
\@$aref_parameter_ryc, # List of RY coding -> IN (defined) / OUT (unchanged)
\@$aref_parameter_tra, # List of sequence translation options -> IN (defined) / OUT (unchanged)
\@$aref_parameter_par, # Print parsimonious sites as extra msa file -> IN (defined) / OUT (unchanged)
\@$aref_parameter_ren, # Rename taxon names of given ifiles -> IN (defined) / OUT (unchanged)
\@$aref_parameter_prt, # Print partition files for concatenated data -> IN (defined) / OUT (unchanged)
\@$aref_parameter_pro, # Start prottest analyses for aa data -> IN (defined) / OUT (unchanged)
\%$href_outfile_name, # Outfilename of output option -> IN (defined) / OUT (unchanged)
\@input_files # list of input files found in fas, FASTA, phy, or aln format -> IN (defined) / OUT (unchanged)
);
}
##############################
############################################################ START FILE READ IN & FILE CHECK
## READ IN file content and check for correct format of infiles -> &input_check
&input_check (
\%hol_seq_of_tax_of_infile, # key: input file name; value ; list of taxa and corresponding sequences -> IN (undefined) / OUT (defined)
\%taxa_all_files, # key: taxon name; value : number of occurence in infiles -> IN (undefined) / OUT (defined)
\@input_files, # list of input files found in fas, FASTA, phy, or aln format -> IN (defined) / OUT (unchanged)
\%hoh_info_of_infile_of_type, # key1: infilename, key2: type of info (e.g. 'seqlength'); info type associated value -> IN (undefined) / OUT (defined)
\$structure_seq # defined if structure sequence present in infiles -> IN (undefined) / OUT (defined)
) ;
############################################################ END FILE READ IN & FILE CHECK
############################################################ START SEQ RENAMING
unless ( $aref_parameter_ren->[0] eq 'NO' ){
&seq_renaming(
\%hol_seq_of_tax_of_infile, # key: input file name; value ; list of taxa and corresponding sequences -> IN (defined) / OUT (changed)
\%hoh_info_of_infile_of_type, # key1: infilename, key2: type of info (e.g. 'seqlength'); info type associated value -> IN (defined) / OUT (changed)
\%taxa_all_files, # key: taxon name; value : number of occurence in infiles -> IN (defined) / OUT (changed)
\$structure_seq # defined if structure sequence present in infiles -> IN (defined) / OUT (changed)
);
}
############################################################ END SEQ RENAMING
############################################################ START SEQ TRANSLATION
unless ( $aref_parameter_tra->[0] eq 'NO' ){
&seq_translation(
\%hol_seq_of_tax_of_infile, # key: input file name; value ; list of taxa and corresponding sequences -> IN (defined) / OUT (changed)
\%hoh_info_of_infile_of_type, # key1: infilename, key2: type of info (e.g. 'seqlength'); info type associated value -> IN (defined) / OUT (changed)
\$aref_parameter_tra->[0] # defined ry coding parameter option -> IN (defined) / OUT (unchanged)
);
}
############################################################ END SEQ TRANSLATION
############################################################ START CONSENSUS PROCESS OF SEQUENCE BLOCKS IF DEFINED
## If consensus setup is set to yes ('Freq', 'Maj', or 'Strict') built consensus sequence of defined sequence blocks (sequences with identic taxon names before the first underscore)
## regarded to chosen consensus option and store consensus sequence of defined sequence blocks in...
## ...%consensus_seq_of_taxon -> key consensus taxon name (original taxon prefix before first underscore with additional '_consensus' suffix); value: consensus sequence
## -----------------
## e.g.:
## tax1_allel_0 -> ACGTTTTCGTTT...
## tax1_allel_1 -> ACGTTTTAATTT...
## tax1_allel_2 -> ACGTTTTGCTTT...
## tax1 -> ACGTTTTTTTTT...
## $consensus_seq_of_taxon{tax1_consensus} = ACGTTTTNNTTT...
## -----------------
## Consensus sequence built in subroutine -> &make_consensus
unless ( $aref_parameter_con->[0] eq 'NO' ){
##############################
## Create consensus sequences of defined sequence blocks in given infile
&make_consensus (
\%hol_seq_of_tax_of_infile, # key: input file name; value ; list of taxa and corresponding sequences -> IN (defined) / OUT (changed)
\$aref_parameter_con->[0], # defined consensus parameter (Freq, Maj, or Strict) -> IN (defined) / OUT (unchanged)
\%hoh_info_of_infile_of_type, # key1: infilename, key2: type of info (e.g. 'seqlength'); info type associated value -> IN (defined) / OUT (unchanged)
\%taxa_all_files, # key: taxon name; value : number of occurence in infiles -> IN (defined) / OUT (changed)
)
##############################
}
############################################################ END CONSENSUS PROCESS OF SEQUENCE BLOCKS IF DEFINED
############################################################ START RY CODING
## If defined, RY coding of either complete nucleotide sequences or 3rd positions of nuc sequences
unless ( $aref_parameter_ryc->[0] eq 'NO' ){
&ry_coding(
\%hol_seq_of_tax_of_infile, # key: input file name; value ; list of taxa and corresponding sequences -> IN (defined) / OUT (changed)
\%hoh_info_of_infile_of_type, # key1: infilename, key2: type of info (e.g. 'seqlength'); info type associated value -> IN (defined) / OUT (unchanged)
\$aref_parameter_ryc->[0] # defined ry coding parameter option -> IN (defined) / OUT (unchanged)
) ;
}
############################################################ END RY CODING
############################################################ START REMOVING 3RD SEQUENCE POSITION
## If defined, remove third sequence position (only in nucleotide data)
unless ( $aref_parameter_3rd->[0] eq 'Remain' ){
&reject_third_nuc_position(
\%hol_seq_of_tax_of_infile, # key: input file name; value ; list of taxa and corresponding sequences -> IN (defined) / OUT (changed)
\%hoh_info_of_infile_of_type, # key1: infilename, key2: type of info (e.g. 'seqlength'); info type associated value -> IN (defined) / OUT (changed)
) ;
}
############################################################ START REMOVING 3RD SEQUENCE POSITION
########################################################### START SEQUENCE CONCATENATION
## Sequence concatenation and extraction of basal sequence information
## unless file handling parameter is set to 'Convert' -> Convert single files to other output format without adding missing sequences
unless ( $aref_parameter_fil->[0] eq 'Convert' ){
&concatenate (
\%hol_seq_of_tax_of_infile, # key: input file name; value ; list of taxa and corresponding sequences -> IN (defined) / OUT (changed)
\%hoh_info_of_infile_of_type, # key1: infilename, key2: type of info (e.g. 'seqlength'); info type associated value -> IN (undefined) / OUT (defined)
\%taxa_all_files, # key: taxon name; value : number of occurence in infiles -> IN (defined) / OUT (unchanged)
\$structure_seq # defined if structure sequence present in infiles -> IN (defined) / OUT (unchanged)
)
}
########################################################### END SEQUENCE CONCATENATION
############################################################ START PROTTEST
## If defined, RY coding of either complete nucleotide sequences or 3rd positions of nuc sequences
unless ( $aref_parameter_pro->[0] eq 'NO' ){
unless ( ( $aref_parameter_fas->[0] eq 'NO' ) && ( $aref_parameter_phy->[0] eq 'NO' ) ){
&start_prottest(