Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Switch to using DBIFloret
authorelserj <elserj@localhost>
Tue, 16 Dec 2014 23:38:23 +0000 (23:38 +0000)
committerelserj <elserj@localhost>
Tue, 16 Dec 2014 23:38:23 +0000 (23:38 +0000)
svn path=/; revision=597

interactome_scripts/inparanoid_orthologs.pl

index 194a42743c0987096b0f82bdfa10e14cf0a6e7c4..40228cfb279621e5088818316b5f9dc1199c68c8 100755 (executable)
@@ -3,36 +3,21 @@
 use warnings;
 use strict;
 
-use DBI;
-use Term::Screen::ReadLine;
 
 if ($#ARGV != 0) {
        print "usage: inparanoid_orthologs.pl output_file\n";
        exit;
 }
-open(outfile,">$ARGV[0]") || die "Error: file '$ARGV[0]' can not be opened\n";
+open(OUTFILE,">$ARGV[0]") || die "Error: file '$ARGV[0]' can not be opened\n";
 
 # define the database handle to be used 
+use lib "$ENV{HOME}/scripts/jaiswallab/interactome_scripts";
 
-my $screen = Term::Screen::ReadLine->new();
-       # clear the screen
-       $screen->clrscr;
-       # ask for username
-       $screen->at(0,0)->puts("Username: ");
-       my $username = $screen->readline(ROW => 0, COL=>11);
+use DbiFloret;
 
-       # ask for password, replace character presses with stars
-       $screen->at(1,0)->puts("Password: ");
-       my $password = $screen->readline(ROW => 1, COL => 11, PASSWORD => 1);
-
-       $screen->at(2,0);
-       undef $screen;
-       
-my $dbh = DBI->connect('DBI:mysql:inparanoid_data;host=floret.cgrb.oregonstate.edu', $username, $password,
-       { RaiseError=> 1, AutoCommit=>1 }
-       ) or die "Failed to connect to database: $DBI::errstr";
+my $dbh = DbiFloret::dbconnect;
        
-my @species = ("Maize", "Oryza_sativa", "Ath", "Sorghum", "Brachy");
+my @species = ("Arabidopsis_thaliana", "Populus_trichocarpa");
 my $num_species = @species;
 
 for (my $i=0; $i<$num_species-1; $i++) {
@@ -88,12 +73,21 @@ for (my $i=0; $i<$num_species-1; $i++) {
                
                foreach my $key (keys %species_1_gene_hash) {
                        if(defined($species_2_gene_hash{$key})) {
-                               print outfile "$species_1_gene_hash{$key}\t$species_2_gene_hash{$key}\n";
+                               my @species_1_gene_array = split(" ", $species_1_gene_hash{$key});
+                               my @species_2_gene_array = split(" ", $species_2_gene_hash{$key});
+                               foreach my $gene_1 (@species_1_gene_array) {
+                                       print OUTFILE "$gene_1\t@species_2_gene_array" ."\n";
+                               }
+                               #foreach my $gene_1 (@species_1_gene_array) {
+                               #       foreach my $gene_2 (@species_2_gene_array) {
+                               #               print OUTFILE "$gene_1\t$gene_2\n";
+                               #       }
+                               #}
                        }
                }
                $sth->finish();
        }
 }
 
-close(outfile);
+close(OUTFILE);