3 die ("Usage: [Fasta file with aligned pairwise sequences]\n");
5 print "*****************************************************************
6 Function: Parse fasta file with aligned pairwise sequences into AXT file
7 Reference: Zhang Z, Li J, Zhao XQ, Wang J, Wong GK, Yu J: KaKs Calculator: Calculating Ka and Ks through model selection and model averaging. Genomics Proteomics Bioinformatics 2006 , 4:259-263.
8 Web Link: Documentation, example and updates at <http://code.google.com/p/kaks-calculator>
9 *****************************************************************
12 print "Input file = $ARGV[0]\n";
13 print "Opening the input file...\n";
14 unless (open (MYFILE
, $ARGV[0])) {
15 die ("Cannot open file\n");
25 print "Reading sequences";
26 while ($count < @array) {
28 if(index($array[$count], ">")==0) {
29 push(@name, substr($array[$count], 1, length($array[$count])-1));
36 $tmp_seq .= $array[$count];
46 print "\nFormatting AXT sequences...\n";
47 $output = join("-", @name)."\n";
48 $output .= join("\n", @seq)."\n";
51 $outfile = $ARGV[0].".axt";
52 print "Outputing AXT file: $outfile\n";
53 open(OUTFILE
, ">$outfile");
54 print OUTFILE
($output);
56 print "\nMission accomplished.\n";