comparison orthologs/evolmap.pl @ 0:5b9a38ec4a39 draft default tip

First commit of old repositories
author osiris_phylogenetics <ucsb_phylogenetics@lifesci.ucsb.edu>
date Tue, 11 Mar 2014 12:19:13 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:5b9a38ec4a39
1 #!/usr/bin/perl
2
3 my $evolmapPath = "\/home\/galaxy\/galaxy_dist\/tool-data\/shared\/jars\/evolmap";
4
5 my $file = "Options.txt";
6
7 my $tree_Input = $ARGV[0];
8 my $tag_Input = ".dat";
9 my $protein_Input = $ARGV[1];
10 my $database_name_Input = "dataout";
11 my $read_database_Input = $ARGV[3];
12 my $Blastall_Input = $ARGV[4];
13 my $read_blast_scores_Input = $ARGV[5];
14 my $alignments_Input = $ARGV[6];
15 my $bit_scores_Input = $ARGV[7];
16 my $read_scores_Input = $ARGV[8];
17 my $read_ancestors_Input = $ARGV[9];
18 my $view_ancestors_Input = "false";
19 my $sfa_Input = $ARGV[10];
20 my $ortholog_threshold_Input = $ARGV[11];
21 my $diverged_threshold_Input = $ARGV[12];
22 my $diverged_std_Input = $ARGV[13];
23 my $avg_of_paralogs_Input = $ARGV[14];
24 #my $numDiffGenes = $ARGV[15];
25
26 my $temp = $tree_Input;
27 $temp =~ tr/(),/ /;
28 my @genes = split(' ', $temp);
29 my $size = @genes;
30
31 my @treeFiles;
32 my $argIndex = 15;
33 my $count;
34 for($count = 0; $count < $size; $count++) {
35 $treeFiles[$count] = $ARGV[$argIndex];
36 $argIndex++;
37 }
38
39 my $tree_copy = "";
40 my $index = 0;
41 my $flag = 1;
42 for($count = 0; $count < length($tree_Input); $count++) {
43 if(substr($tree_Input, $count, 1) eq '(' || substr($tree_Input, $count, 1) eq ')' || substr($tree_Input, $count, 1) eq ',') {
44 $tree_copy = $tree_copy.substr($tree_Input, $count, 1);
45 $flag = 1;
46 }
47 else {
48 if($flag) {
49 $tree_copy = $tree_copy.$treeFiles[$index];
50 $index++;
51 }
52 $flag = 0;
53 }
54 }
55
56 $tree_copy =~ s/\Q.dat\E//g;
57
58 open(CONFIG, '>'.$file);
59
60 print CONFIG "processors = 10\n";
61 #print CONFIG "tree = ".$tree_Input."\n";
62 print CONFIG "tree = ".$tree_copy."\n";
63 print CONFIG "tag = ".$tag_Input."\n";
64 print CONFIG "protein = ".$protein_Input."\n";
65 print CONFIG "database_name = ".$database_name_Input."\n";
66 print CONFIG "read_database = ".$read_database_Input."\n";
67 print CONFIG "Blastall = ".$Blastall_Input."\n";
68 print CONFIG "read_blast_scores = ".$read_blast_scores_Input."\n";
69 print CONFIG "alignments = ".$alignments_Input."\n";
70 print CONFIG "bit_scores = ".$bit_scores_Input."\n";
71 print CONFIG "read_scores = ".$read_scores_Input."\n";
72 print CONFIG "read_ancestors = ".$read_ancestors_Input."\n";
73 print CONFIG "view_ancestors = ".$view_ancestors_Input."\n";
74 print CONFIG "sfa = ".$sfa_Input."\n";
75 print CONFIG "ortholog_threshold = ".$ortholog_threshold_Input."\n";
76 print CONFIG "diverged_threshold = ".$diverged_threshold_Input."\n";
77 print CONFIG "diverged_std = ".$diverged_std_Input."\n";
78 print CONFIG "avg_of_paralogs = ".$avg_of_paralogs_Input."\n";
79
80 close(CONFIG);
81
82 if($read_ancestors_Input eq "false" || $read_scores_Input eq "false") {
83 my $run = qx/java -jar -Xms8000m -Xmx8000m $evolmapPath\/EvolMAP.jar $file/;
84 print $run;
85 }
86