Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
Fixed to use dbifloret (generalizes the script so it doesn't have to be modfied by...
authorelserj <elserj@localhost>
Fri, 28 Jun 2013 23:08:13 +0000 (23:08 +0000)
committerelserj <elserj@localhost>
Fri, 28 Jun 2013 23:08:13 +0000 (23:08 +0000)
svn path=/; revision=489

interactome_scripts/inparanoid_output_parse.pl

index f02373e5ac23ae238d09833affc61212adead72f..92d3a7a8d4523d2bd63afedb5dd9ae0922942728 100755 (executable)
@@ -19,11 +19,25 @@ use strict;
 use warnings;
 
 use DBI;
-use Term::Screen::ReadLine;
 
 use Getopt::Long;
 my $new = '';
-GetOptions ('new' => \$new);
+my $strip = '';
+GetOptions ('new' => \$new, 'strip' => \$strip);
+
+
+# set up the database connection
+use lib "$ENV{HOME}/scripts/jaiswallab/interactome_scripts";
+
+use DbiFloret;
+
+my $dbh = DbiFloret::dbconnect;
+
+if($new) {
+               $database = $dbh->selectrow_array("select DATABASE()");
+               $dbh->do("drop database if exists $database");
+               $dbh->do("create database $database");
+}
 
 
 if(-e "$ENV{HOME}/scripts/jaiswallab/interactome_scripts/find_species.pl") {
@@ -36,35 +50,7 @@ if(-e "$ENV{HOME}/scripts/jaiswallab/interactome_scripts/find_species.pl") {
 
 my @files = glob("sqltable*");
 
-# define the database handle to be used 
-
-my $database;
-
-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);
-
-       # 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;
-       if($new) {
-               $database = "";
-               my $dbh_temp = DBI->connect("DBI:mysql:$database;host=floret.cgrb.oregonstate.edu", $username, $password,
-               { RaiseError=> 1, AutoCommit=>1 }
-               ) or die "Failed to connect to database: $DBI::errstr";
-               $dbh_temp->do("drop database inparanoid_data");
-               $dbh_temp->do("create database inparanoid_data");
-               $dbh_temp->disconnect;
-       }
-       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 $clust_table = "clusters";
@@ -149,17 +135,27 @@ foreach my $input_file (@files) {
                $species = find_species($species);
                # the next line is no longer neccessary, future inparanoid runs will fix the gene headers before running
                #my $gene = find_gene($gene_header,$species);
-               # skip isomers that are not .1
-               next if ($gene =~ /\.[2-9]$/);
-               next if ($gene =~ /\.1[0-9]$/);
-               next if ($gene =~ /\.2[0-9]$/);
-               next if ($gene =~ /\.3[0-9]$/);
-               next if ($gene =~ /\.4[0-9]$/);
-               next if ($gene =~ /\.5[0-9]$/);
-               next if ($gene =~ /\.6[0-9]$/);
-               next if ($gene =~ /\.7[0-9]$/);
-               next if ($gene =~ /\.8[0-9]$/);
-               next if ($gene =~ /\.9[0-9]$/);
+               # skip isomers that are not .1 if asked
+               if ($strip) {
+                               if($species ne "Jatropha_curcas") { #Jatropha gene ids are .10, .20, .30, etc...
+                                       next if ($gene =~ /\.[2-9]$/);
+                                       next if ($gene =~ /\.1[0-9]$/);
+                                       next if ($gene =~ /\.2[0-9]$/);
+                                       next if ($gene =~ /\.3[0-9]$/);
+                                       next if ($gene =~ /\.4[0-9]$/);
+                                       next if ($gene =~ /\.5[0-9]$/);
+                                       next if ($gene =~ /\.6[0-9]$/);
+                                       next if ($gene =~ /\.7[0-9]$/);
+                                       next if ($gene =~ /\.8[0-9]$/);
+                                       next if ($gene =~ /\.9[0-9]$/);
+                               }
+                               
+                               # skip Maize genes that are not the first transcript
+                               if($species eq "Zea_mays") {
+                                               next if ($gene =~ /\_T0[2-9]$/);
+                                               next if ($gene =~ /\_T1[0-9]$/);
+                               }
+               }
        
                if(!defined($id_hash{$clust_id})) {
                        if ($clust_id ne $clust_id_prev) {