From a1474a3f2c44ed397dd49daf59b2fa8c4e82fec4 Mon Sep 17 00:00:00 2001 From: elserj Date: Wed, 6 Jul 2011 23:53:02 +0000 Subject: [PATCH] Switch to using dbconnect method from DbiFloret module svn path=/; revision=113 --- interactome_scripts/supercluster.pl | 36 +++++++++-------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/interactome_scripts/supercluster.pl b/interactome_scripts/supercluster.pl index 4425ee5..d30dbef 100755 --- a/interactome_scripts/supercluster.pl +++ b/interactome_scripts/supercluster.pl @@ -23,7 +23,11 @@ use warnings; use strict; use DBI; -use Term::Screen::ReadLine; +use Term::ReadKey; + +use lib "$ENV{HOME}/scripts/jaiswallab/interactome_scripts"; + +use DbiFloret; if(-e "$ENV{HOME}/scripts/jaiswallab/interactome_scripts/find_species.pl") { require "$ENV{HOME}/scripts/jaiswallab/interactome_scripts/find_species.pl"; @@ -31,33 +35,15 @@ if(-e "$ENV{HOME}/scripts/jaiswallab/interactome_scripts/find_species.pl") { require "$ENV{HOME}/bin/find_species.pl"; } -# define the database handle to be used - -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); +my $dbh = DbiFloret::dbconnect; - # Ask for the minimum score for the paralogy cutoff - $screen->at(2,0)->puts("Minimum paralogy score: "); - my $min_score = $screen->readline(ROW => 2, COL => 24); - - $screen->at(3,0); - undef $screen; +print "Minimum paralogy score: "; +chomp(my $min_score = ); if($min_score eq "") { $min_score = 0; } - -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"; + #### Note to self #### @@ -83,8 +69,8 @@ my $super_id = 0; #initialize the super cluster id my %super_hash; my %big_count_hash; -#my @species = ("Ath", "Brachy", "C_elegans", "Chlamy", "Danio", "E_coli", "Fragaria", "Glycine", "Human", "Maize", "Mouse", "Neurospora", "Oryza_sativa", "Physcomitreall", "Poplar", "P_persica", "Sacc_cerevisiae", "Sacc_pombe", "Selaginella", "Sorghum", "Synechosystis", "Vitis"); -my @species = all_species_array(); +my @species = ("Arabidopsis_lyrata", "Arabidopsis_thaliana", "Carica_papaya", "Citrus_clementina", "Citrus_sinensis", "Eucalyptus_grandis", "Fragaria_vesca", "Malus_domestica", "Oryza_sativa", "Populus_trichocarpa", "Prunus_persica", "Vitis_vinifera"); +#my @species = all_species_array(); my $num_species = @species; for (my $i=0; $i<$num_species-1; $i++) { -- 2.34.1