Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
Add check to see if table exists, and skip ahead if it doesn't
authorelserj <elserj@localhost>
Tue, 20 Oct 2015 00:46:08 +0000 (00:46 +0000)
committerelserj <elserj@localhost>
Tue, 20 Oct 2015 00:46:08 +0000 (00:46 +0000)
svn path=/; revision=636

interactome_scripts/supercluster.pl

index ba14deb31fe1985706aa88aba8ec384e059b86ae..dd986b2abb6955e9eac16a33a5fdddaaa283dc3f 100755 (executable)
@@ -88,6 +88,14 @@ my %big_count_hash;
        
 my $num_species = @species;
 
+my @tables = $dbh->tables();
+my %table_hash;
+foreach my $table (@tables) {
+        my ($db,$table_name) = split ('`.`', $table);
+        $table_name =~ s/`$//;
+        $table_hash{$table_name} = $table_name;
+}
+
 for (my $i=0; $i<$num_species-1; $i++) {
        print "Working on species: $species[$i]\n";
        
@@ -109,13 +117,22 @@ for (my $i=0; $i<$num_species-1; $i++) {
        #               $species_2 = $spec_temp;
        #               print "non optimal order\n";
        #       }
-               
-               
+       
+
        
                # create the statement handler to pull the species-pair data
                my $spec_table = "$species_1" . "_" . "$species_2";
                my $safe_species_table = $dbh->quote_identifier($spec_table);
+               
+               # Check to make sure table exists and skip if it doesn't
+               if(!defined($table_hash{$spec_table})) {
+                               next;
+               }
+               
+               
                my $sth = $dbh->prepare("select * from $safe_species_table");
+               
+               
        
                my $id_prev = "";