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") {
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";
$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) {