comparison orthologs/ucsb_hamster/install_ucsb_hamster.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 # UCSB Hamster Installation Script
4
5 use strict;
6 use warnings;
7 use Cwd;
8
9 my $galaxy_hamster = getcwd();
10
11 my @tokens = split('/', $galaxy_hamster);
12
13 # Checking if all dependencies in environment variable or not.
14 # If conflicts are found, install will abort. Otherwise, the
15 # hamster dependencies will be added to the path
16
17 chdir("\/$tokens[1]\/$tokens[2]\/");
18
19 open(BASHRCIN, "<".".bashrc");
20 while(my $currLine = <BASHRCIN>) {
21 if($currLine eq "export PATH=\"$galaxy_hamster:\$PATH\";\n") {
22 die "Error: Please make sure there are no conflicting files in your environment variables of your .bashrc file.\n\nIf you are unsure what to do, refer to the detailed installation procedures in the README file.\nAborted installation.";
23 }
24 }
25 close(BASHRCIN);
26
27 open(BASHRC, ">>".".bashrc");
28 print BASHRC "export PATH=\"$galaxy_hamster:\$PATH\";\n";
29 close(BASHRC);
30
31 # edit wisecfg to include $galaxy_hamster/lib/wisecfg
32 chdir("$galaxy_hamster\/lib");
33
34 open(WISECFG, "<"."run_genewise.pm");
35 my $new_run_genewise_pm = "";
36 my $i = 0;
37 while(my $currLine = <WISECFG>) {
38 $i++;
39 if($i == 3) {
40 $currLine = "$ENV{'WISECONFIGDIR'} = "."\"$galaxy_hamster".'/lib/wisecfg"'.";\n";
41 }
42 $new_run_genewise_pm = $new_run_genewise_pm.$currLine;
43 }
44 close(WISECFG);
45
46 open(WISECFGOUT, ">"."run_genewise.pm");
47 print WISECFGOUT $new_run_genewise_pm;
48 close(WISECFGOUT);
49
50 # installation was a success
51 print "Installation was a SUCCESS!\n\nYou may re-run this script in the future to reconfigure UCSB Hamster.\n\n"