You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(27) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
|
Dec
|
2008 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: kirovs <ki...@us...> - 2008-01-09 20:16:50
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13578 Modified Files: setup.pl Log Message: Bug fixes Index: setup.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/setup.pl,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** setup.pl 1 Feb 2006 20:37:40 -0000 1.10 --- setup.pl 9 Jan 2008 20:16:45 -0000 1.11 *************** *** 2,6 **** use DBI; ! my $envchk=(($ENV{ENS_HOST})&&($ENV{ENS_ADMIN})&&($ENV{ENS_PASS})&&$ENV{ENS_DATA}); unless ($envchk) { print "The environment is not set\n"; --- 2,7 ---- use DBI; ! my ! $envchk=(($ENV{ENS_HOST})&&($ENV{ENS_ADMIN})&&($ENV{ENS_PASS})&&($ENV{ENS_DATA})); unless ($envchk) { print "The environment is not set\n"; *************** *** 28,37 **** chomp $shell; $shcom=$shell==1?'export':'setenv'; ! print "To set your environment add this to your ~/.tcshrc file: ! $shcom ENS_HOST $host ! $shcom ENS_ADMIN $admin ! $shcom ENS_PASS $pass ! $shcom ENS_DATA $ddir restart your shell then run this script again\n"; --- 29,39 ---- chomp $shell; $shcom=$shell==1?'export':'setenv'; + $shsep=$shell==1?'=':''; ! print "To set your environment add this to your ~/.tcshrc or ~/.bashrc file: ! $shcom ENS_HOST $shsep $host ! $shcom ENS_ADMIN $shsep $admin ! $shcom ENS_PASS $shsep $pass ! $shcom ENS_DATA $shsep $ddir restart your shell then run this script again\n"; |
From: kirovs <ki...@us...> - 2008-01-09 20:10:16
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11155 Modified Files: getensembl.pl Log Message: Bug fixes Index: getensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/getensembl.pl,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** getensembl.pl 23 Oct 2007 20:23:24 -0000 1.9 --- getensembl.pl 9 Jan 2008 20:10:13 -0000 1.10 *************** *** 40,44 **** $rmtdir = '/pub'; chdir $prefix; ! #system("rmdir -fr newdata") if (!(-e 'newdata')); system("mkdir newdata") if (!(-e 'newdata')); $locdir = "$prefix/newdata"; --- 40,44 ---- $rmtdir = '/pub'; chdir $prefix; ! #system("rmdir -fr newdata") if (-e 'newdata'); system("mkdir newdata") if (!(-e 'newdata')); $locdir = "$prefix/newdata"; *************** *** 79,82 **** --- 79,83 ---- #This is only for the core DB- get foreach my $db (@dbs) { + next unless ($db=~/^d/); if ($#list>-1) { my $req; #Check if this DB is requested *************** *** 107,114 **** #$ftp->cwd($name)||die $name; - my @all=$ftp->dir; - foreach my $d (@all) { - - my @files=grep (!/total/,$ftp->dir); my $cf=$ftp->pwd; --- 108,111 ---- *************** *** 135,147 **** $ftp->login('anonymous', $enslogin) or die "Cannot login ($host)\n:". $ftp->message; } - $ftp->cwd("/$cf")||die "CF: $cf"; $ftp->cwd(".."); print 'CW1',$ftp->pwd,"\n"; } - $ftp->cwd("../../.."); - print 'CW2',$ftp->pwd,"\n"; - - } open (DBS, ">dbs" )||die "Cannot write the database data\n"; foreach my $db (@cores) { --- 132,140 ---- $ftp->login('anonymous', $enslogin) or die "Cannot login ($host)\n:". $ftp->message; + $ftp->cwd("$cf")||die "CF: $cf"; } $ftp->cwd(".."); print 'CW1',$ftp->pwd,"\n"; } open (DBS, ">dbs" )||die "Cannot write the database data\n"; foreach my $db (@cores) { |
From: kirovs <ki...@us...> - 2008-01-09 20:09:46
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10744 Modified Files: load_ensembl.pl Log Message: Overflow system implemented Index: load_ensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/load_ensembl.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** load_ensembl.pl 14 Sep 2007 18:04:55 -0000 1.6 --- load_ensembl.pl 9 Jan 2008 20:09:42 -0000 1.7 *************** *** 1,3 **** ! #!/usr/bin/perl use DBI; --- 1,3 ---- ! #!/stf/sys/bin/perl use DBI; *************** *** 16,20 **** my $msqldir=$ENV{MYSQL_DATA}; open (MSQLV,'mysql -V|')||die 'Mysql crashed or no mysql installed'; - if ($overfl) { $avail=check_for_overflow($msqldir) ; } my $msqlv=<MSQLV>; close MSQLV; --- 16,19 ---- *************** *** 27,30 **** --- 26,30 ---- $cs .= "port=$port;" if ($port); my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; + $dbh->{mysql_auto_reconnect}=1; #Special table with every DB that loads, should be created in advance *************** *** 50,53 **** --- 50,55 ---- my $dbname=join('_', @ver); my ($obsol)=grep(/$dbname/,@dbs); + my $ifed=$dbh->prepare("drop database if exists $db") ||die "Couldn't create DB $db\n"; #Should we check first and drop it if exists? + $ifed->execute||die; my $str=$dbh->prepare("create database $db") ||die "Couldn't create DB $db\n"; #Should we check first and drop it if exists? my $list=$dbh->prepare("insert into ens_dbnames (db_name, version,current) values (?,?,'yes')") ||die "Couldn't prepare- recording the DB list\n",$DBI::errstr; *************** *** 62,71 **** $up=$pass ? "-u $user -p$pass " : "-u $user"; my $sarg="mysql -h $host $up $db <$ddlfile"; ! my $avail; ! if ($overfl) { $avail=check_for_overflow($msqldir) ; } if (($avail<25)&&($msqldir)) { ! print "Using $overfl overflow\n"; ! system("mv $msqldir/$db $overfl")==0||die "Could not move to $overfl $?:$!"; ! system("ln -s $overfl/$db $msqldir")==0||die "Could not move to $overfl $?:$!"; } print "$sarg\n"; --- 64,74 ---- $up=$pass ? "-u $user -p$pass " : "-u $user"; my $sarg="mysql -h $host $up $db <$ddlfile"; ! my ($avail,$next); ! if ($overfl) { ($avail,$next)=check_for_overflow($msqldir,$overfl) ; } if (($avail<25)&&($msqldir)) { ! die "No space left on original device and in overflow devices (if defined), cannot continue" unless ($next); ! print "Using $overfl $next\n"; ! system("mv $msqldir/$db $next")==0||die "Could not move to $overfl $?:$!"; ! system("ln -s $next/$db $msqldir")==0||die "Could not move to $overfl $?:$!"; } print "$sarg\n"; *************** *** 78,81 **** --- 81,91 ---- system($load)==0||die"Couldn't import\n$load\n"; } + open (DATF, "ls *.txt| wc -l|")||die; + my $cntd=<DATF>; + close DATF; + if ($cntd>0) { + my $load="mysqlimport -L -h $host $up $db *.txt"; + system($load)==0||die"Couldn't import\n$load\n"; + } $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; if ($obsol) { *************** *** 99,105 **** sub check_for_overflow { ! my $storage=shift; ! unless ($storage) { die "Do not know where to overflow to, see that environment var MYSQL_DATA is set"; } ! open (SZ,"df -h $storage|")||die "$?:$!"; my $head=<SZ>; my $where=<SZ>; --- 109,114 ---- sub check_for_overflow { ! my $default=shift; ! open (SZ,"df -h $default|")||die "$?:$!"; my $head=<SZ>; my $where=<SZ>; *************** *** 107,113 **** $dat=~s/^[\s\t]+//; my ($size,$used,$avail,$mount)=split(/[\t\s]+/,$dat); ! unless ($avail=~/G$/) { return 0}; ! $avail=~s/\D//g; ! return $avail; } --- 116,140 ---- $dat=~s/^[\s\t]+//; my ($size,$used,$avail,$mount)=split(/[\t\s]+/,$dat); ! if ($avail=~/G$/) { ! $avail=~s/\D//g; ! return $avail,undef if ($avail>20); ! } ! my $disks=shift; ! unless ($disks) { die "Do not know where to overflow to, see that environment var MYSQL_DATA is set"; } ! my @storage=split(/:/,$disks); ! my $next; ! foreach my $storage (@storage) { ! open (SZ,"df -h $storage|")||die "$?:$!"; ! my $head=<SZ>; ! #my $where=<SZ>; ! my $dat=<SZ>; ! $dat=~s/^[\s\t]+//; ! my ($fs,$size,$used,$availnext,$mount)=split(/[\t\s]+/,$dat); ! unless ($availnext=~/G$/) { next }; ! $availnext=~s/\D//g; ! if ($availnext>20) { $next=$storage;} ! } ! ! return $avail,$next; } |
From: kirovs <ki...@us...> - 2007-10-23 20:23:28
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29078 Modified Files: getensembl.pl Log Message: New ftp rep structure, some bugs Index: getensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/getensembl.pl,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** getensembl.pl 14 Sep 2007 18:06:12 -0000 1.8 --- getensembl.pl 23 Oct 2007 20:23:24 -0000 1.9 *************** *** 28,32 **** my @current=@{$currenth->fetchall_arrayref}; foreach my $val (@current) { ! $current{$val->[0]}=$val->[1]; } my $prefix=$ENV{ENS_DATA}; --- 28,34 ---- my @current=@{$currenth->fetchall_arrayref}; foreach my $val (@current) { ! my @dat=split(/_/,$val->[0]); ! my $cn=join('_',@dat[0..2]); ! $current{$cn}=$val->[1]; } my $prefix=$ENV{ENS_DATA}; *************** *** 70,74 **** } } ! $ftp->cwd($lr)||die; print "Retrieving files\n"; --- 72,76 ---- } } ! $ftp->cwd("$lr/mysql")||die; print "Retrieving files\n"; *************** *** 77,89 **** #This is only for the core DB- get foreach my $db (@dbs) { ! my @cl=split(/\s/,$db); ! my $name=pop @cl; ! $ftp->cwd("$name/data/mysql")||die $name; ! my @all=$ftp->dir; ! foreach my $d (@all) { ! if ($#list>-1) { my $req; #Check if this DB is requested foreach my $target (@list) { ! if ($d=~/$target/) { $req++; last; --- 79,86 ---- #This is only for the core DB- get foreach my $db (@dbs) { ! if ($#list>-1) { my $req; #Check if this DB is requested foreach my $target (@list) { ! if ($db=~/$target/) { $req++; last; *************** *** 92,98 **** next unless ($req); } ! ! my @long=split(/\s/,$d); ! my $core=pop @long; #Check if newer my @dat=split(/_/,$core); --- 89,94 ---- next unless ($req); } ! my @cl=split(/\s/,$db); ! my $core=pop @cl; #Check if newer my @dat=split(/_/,$core); *************** *** 100,110 **** my $v2=($#dat<2)? 1:pop @dat; my $version=$v2."_".$v1; ! next unless ($current{$core}<$v1); next if (-e $core); ! $ftp->cwd("$core")||die $@,$core; print "Working on $core\n"; push @cores,$core;#Remember the DB names mkdir($core); chdir($core); my @files=grep (!/total/,$ftp->dir); my $cf=$ftp->pwd; --- 96,114 ---- my $v2=($#dat<2)? 1:pop @dat; my $version=$v2."_".$v1; ! my $dbname=join('_',@dat); ! next unless ($current{$dbname}<$version); next if (-e $core); ! $ftp->cwd($core)||die $@,$core; print "Working on $core\n"; push @cores,$core;#Remember the DB names mkdir($core); chdir($core); + + + #$ftp->cwd($name)||die $name; + my @all=$ftp->dir; + foreach my $d (@all) { + + my @files=grep (!/total/,$ftp->dir); my $cf=$ftp->pwd; *************** *** 118,122 **** print "Getting $gfile..\n"; #$ftp->get($gfile); ! my $cloc="ftp:\/\/ftp.ensembl.org/$cf/$gfile"; print $cloc,"\n"; unless (system("wget $cloc")==0) { warn "No $cloc"; next; } --- 122,126 ---- print "Getting $gfile..\n"; #$ftp->get($gfile); ! my $cloc="ftp:\/\/ftp.ensembl.org$cf/$gfile"; print $cloc,"\n"; unless (system("wget $cloc")==0) { warn "No $cloc"; next; } |
From: kirovs <ki...@us...> - 2007-09-14 18:10:42
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16156 Added Files: generate_keywords.pl Log Message: generate mysql table for searching ensembl --- NEW FILE: generate_keywords.pl --- #!/stf/sys/bin/perl use BMS::ensembl::talk; use strict; my %uh; my $host=$ENV{ENS_HOST}; my $port=$ENV{ENS_PORT}; my $drv=$ENV{ENS_DRV}; my $user=$ENV{ENS_ADMIN}; my $pass=$ENV{ENS_ADMINPASS}; my $ens=new BMS::ensembl::talk(DRV=>$drv,HOST=>$host,ADD=>$port,PASS=>$pass,USER=>$user)||die; my @tables=$ens->marttables('xref'); my $dbh=$ens->get_mart; foreach my $table (@tables) { next if ($table=~/concat/); my $sth=$dbh->prepare("select gene_stable_id,transcript_stable_id,translation_stable_id,display_id_list,dbprimary_id from $table")||die; $sth->execute||die; my $all=$sth->fetchall_arrayref; $sth->finish; foreach my $row (@$all) { my ($gid,$tid,$pid,$list,$ppid)=@$row; $list=~s/[,:]/|/g if ($list); my $com; if ($list) { $com=$ppid?"$ppid|$list|":"$list|"; } else { $com="$ppid|"; } next if ($com eq '|'); if ($gid) { unless (exists($uh{$gid})) {$uh{$gid}='|'; } $uh{$gid} .= $com; next; } if ($tid) { unless (exists($uh{$tid})) {$uh{$tid}='|'; } $uh{$tid} .= $com; next; } if ($pid) { unless (exists($uh{$pid})) {$uh{$pid}='|'; } $uh{$pid} .= $com; next; } } } $dbh->disconnect; my $dbh=$ens->{ENSdbh1}; my $sth=$dbh->prepare("update stable_org set keywords=? where stable_id=?")||die; foreach my $key (keys %uh) { $sth->execute($uh{$key},$key); } $sth->finish; $dbh->disconnect; |
From: kirovs <ki...@us...> - 2007-09-14 18:08:40
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv15322 Modified Files: ensdbnames_org.pl Log Message: added mysql connect params , bugs Index: ensdbnames_org.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/ensdbnames_org.pl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ensdbnames_org.pl 2 Dec 2005 17:04:01 -0000 1.1.1.1 --- ensdbnames_org.pl 14 Sep 2007 18:08:37 -0000 1.2 *************** *** 1,10 **** ! #!/usr/bin/perl use DBI; ! my $user=$ENV{ENS_USER}; ! my $pass=$ENV{ENS_PASS}; my $host=$ENV{ENS_HOST}; my $sock=$ENV{ENS_SOCK}; my $sid='ensembl_databases'; ! my $cs = "dbi:mysql:$sid:$host;mysql_socket=$sock"; my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; --- 1,11 ---- ! #!/stf/sys/bin/perl use DBI; ! my $user=$ENV{ENS_ADMIN}; ! my $pass=$ENV{ENS_ADMINPASS}; my $host=$ENV{ENS_HOST}; my $sock=$ENV{ENS_SOCK}; + my $port=$ENV{ENS_PORT}; my $sid='ensembl_databases'; ! my $cs = "dbi:mysql:$sid:$host;mysql_socket=$sock;port=$port"; my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; *************** *** 13,19 **** $qh1->execute||die; while (my $name=$qh1->fetchrow_array) { my @dat=split(/_/,$name); my $sp; ! if ($#dat==4) { $sp=$dat[0].' '.$dat[1]; } --- 14,21 ---- $qh1->execute||die; while (my $name=$qh1->fetchrow_array) { + next if ($name =~/web/); my @dat=split(/_/,$name); my $sp; ! if (($#dat==4)&&($name!~/web/)&&($name!~/compara/)&&($name!~/mart/)) { $sp=$dat[0].' '.$dat[1]; } |
From: kirovs <ki...@us...> - 2007-09-14 18:07:36
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14926 Modified Files: ensid_org.pl Log Message: added mysql connect params, add all g/p/t stable ids , bugs Index: ensid_org.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/ensid_org.pl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ensid_org.pl 2 Dec 2005 17:04:01 -0000 1.1.1.1 --- ensid_org.pl 14 Sep 2007 18:07:32 -0000 1.2 *************** *** 1,32 **** ! #!/usr/bin/perl use DBI; ! my $user=$ENV{ENS_USER}; ! my $pass=$ENV{ENS_PASS}; my $host=$ENV{ENS_HOST}; my $sock=$ENV{ENS_SOCK}; my $sid='ensembl_databases'; ! my $cs = "dbi:mysql:$sid:$host;mysql_socket=$sock"; my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; my $qh1=$dbh->prepare("select db_name,organism from ens_dbnames where current='yes' and ! organism<>'multispecies'")||die; $qh1->execute||die; my $all=$qh1->fetchall_arrayref; ! my $ih1=$dbh->prepare("insert into stable_org(organism,stable_id) values (?,?)")||die; foreach my $row (@$all) { my ($name,$org)=@$row; ! my $constr = "dbi:mysql:$name:$host;mysql_socket=$sock"; my $ensdbh= DBI->connect($constr,$user,$pass) or die "connecting: $DBI::errstr" ; my $gstblid=$ensdbh->prepare("select stable_id from gene_stable_id")||die; my $tstblid=$ensdbh->prepare("select stable_id from transcript_stable_id")||die; $gstblid->execute||die; $tstblid->execute||die; ! while (my $id=$gstblid->fetchrow_array) { ! $ih1->execute($org,$id)||die; ! } my $trs=$tstblid->fetchall_arrayref; foreach my $row(@$trs) { my $id=shift @$row; ! $ih1->execute($org,$id)||die; } } --- 1,50 ---- ! #!/stf/sys/bin/perl use DBI; ! my $user=$ENV{ENS_ADMIN}; ! my $pass=$ENV{ENS_ADMINPASS}; my $host=$ENV{ENS_HOST}; my $sock=$ENV{ENS_SOCK}; + my $port=$ENV{ENS_PORT}; + open (MSQLV,'mysql -V|')||die 'Mysql crashed or no mysql installed'; + my $msqlv=<MSQLV>; + close MSQLV; + my ($tr,$mver1)=split(/Distrib/,$msqlv); + my ($mver,$tr)=split(/,/,$mver1); + my ($majormver,@mver)=split(/\./,$mver); my $sid='ensembl_databases'; ! my $cs = "dbi:mysql:database=$sid;host=$host;"; ! $cs .= "mysql_socket=$sock;" if ($sock); ! $cs .= "port=$port;" if ($port); my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; my $qh1=$dbh->prepare("select db_name,organism from ens_dbnames where current='yes' and ! organism<>'multispecies' and db_name like '%_core_%'")||die; $qh1->execute||die; my $all=$qh1->fetchall_arrayref; ! my $dh1=$dbh->prepare("delete from stable_org")||die; ! $dh1->execute||die; ! my $ih1=$dbh->prepare("insert into stable_org(organism,stable_id,type) values (?,?,?)")||die; foreach my $row (@$all) { my ($name,$org)=@$row; ! my $constr = "dbi:mysql:$name:$host;mysql_socket=$sock;port=$port;"; my $ensdbh= DBI->connect($constr,$user,$pass) or die "connecting: $DBI::errstr" ; my $gstblid=$ensdbh->prepare("select stable_id from gene_stable_id")||die; my $tstblid=$ensdbh->prepare("select stable_id from transcript_stable_id")||die; + my $protstablid=$ensdbh->prepare("select stable_id from translation_stable_id")||die; $gstblid->execute||die; $tstblid->execute||die; ! $protstablid->execute||die; ! while (my $id=$gstblid->fetchrow_array) { ! $ih1->execute($org,$id,'gene')||die; ! } my $trs=$tstblid->fetchall_arrayref; foreach my $row(@$trs) { my $id=shift @$row; ! $ih1->execute($org,$id,'transcript')||die; } + my $pep=$protstablid->fetchall_arrayref; + foreach my $row(@$pep) { + my $id=shift @$row; + $ih1->execute($org,$id,'protein')||die; } + } \ No newline at end of file |
From: kirovs <ki...@us...> - 2007-09-14 18:06:16
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14538 Modified Files: getensembl.pl Log Message: added mysql connect params, wget alt, bugs Index: getensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/getensembl.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** getensembl.pl 6 Dec 2005 14:58:55 -0000 1.7 --- getensembl.pl 14 Sep 2007 18:06:12 -0000 1.8 *************** *** 7,11 **** # changes to remote directory <rmtdir> # puts files in the local directory <locdir> ! # Load the Net::FTP package --- 7,12 ---- # changes to remote directory <rmtdir> # puts files in the local directory <locdir> ! use lib '/perl/newlib/ia64-linux-multi-stdio'; ! #use lib '/perl/newlib/ia64-linux-multi-stdio/auto'; # Load the Net::FTP package *************** *** 18,24 **** my $host=$ENV{ENS_HOST}; my $sock=$ENV{ENS_SOCK}; $enslogin=$user; my $sid='ensembl_databases'; ! my $cs = "dbi:mysql:$sid:$host;mysql_socket=$sock"; my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; my $currenth=$dbh->prepare("select db_name, version from ens_dbnames where current = 'yes'")||die "Couldn't prepare the select statement\n"; --- 19,26 ---- my $host=$ENV{ENS_HOST}; my $sock=$ENV{ENS_SOCK}; + my $port=$ENV{ENS_PORT}; $enslogin=$user; my $sid='ensembl_databases'; ! my $cs = "dbi:mysql:$sid:$host;mysql_socket=$sock;port=$port"; my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; my $currenth=$dbh->prepare("select db_name, version from ens_dbnames where current = 'yes'")||die "Couldn't prepare the select statement\n"; *************** *** 77,81 **** my @cl=split(/\s/,$db); my $name=pop @cl; ! $ftp->cwd("$name/data/mysql")||die; my @all=$ftp->dir; foreach my $d (@all) { --- 79,83 ---- my @cl=split(/\s/,$db); my $name=pop @cl; ! $ftp->cwd("$name/data/mysql")||die $name; my @all=$ftp->dir; foreach my $d (@all) { *************** *** 100,104 **** next unless ($current{$core}<$v1); next if (-e $core); ! $ftp->cwd("$core")||die; print "Working on $core\n"; push @cores,$core;#Remember the DB names --- 102,106 ---- next unless ($current{$core}<$v1); next if (-e $core); ! $ftp->cwd("$core")||die $@,$core; print "Working on $core\n"; push @cores,$core;#Remember the DB names *************** *** 106,109 **** --- 108,112 ---- chdir($core); my @files=grep (!/total/,$ftp->dir); + my $cf=$ftp->pwd; foreach my $file (@files) { my @long=split(/\s+/,$file); *************** *** 114,118 **** next if (-e $dfile); print "Getting $gfile..\n"; ! $ftp->get($gfile); #Gunzip as we go system ("gunzip $gfile &"); --- 117,124 ---- next if (-e $dfile); print "Getting $gfile..\n"; ! #$ftp->get($gfile); ! my $cloc="ftp:\/\/ftp.ensembl.org/$cf/$gfile"; ! print $cloc,"\n"; ! unless (system("wget $cloc")==0) { warn "No $cloc"; next; } #Gunzip as we go system ("gunzip $gfile &"); *************** *** 120,126 **** print "Done with $core\n"; chdir(".."); ! $ftp->cwd('..'); } $ftp->cwd("../../.."); } --- 126,141 ---- print "Done with $core\n"; chdir(".."); ! unless ($ftp->pwd) { ! $ftp = Net::FTP->new($host) or ! die "Cannot contact $host\n:$!"; ! $ftp->login('anonymous', $enslogin) or ! die "Cannot login ($host)\n:". $ftp->message; ! } ! $ftp->cwd("/$cf")||die "CF: $cf"; ! $ftp->cwd(".."); ! print 'CW1',$ftp->pwd,"\n"; } $ftp->cwd("../../.."); + print 'CW2',$ftp->pwd,"\n"; } |
From: kirovs <ki...@us...> - 2007-09-14 18:04:59
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13804 Modified Files: load_ensembl.pl Log Message: added mysql connect params, overflow, bugs Index: load_ensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/load_ensembl.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** load_ensembl.pl 12 Dec 2005 14:29:42 -0000 1.5 --- load_ensembl.pl 14 Sep 2007 18:04:55 -0000 1.6 *************** *** 6,16 **** my $drop=shift; my $clean=shift; ! chdir($locdir); my (%db,@dbs); my $user=$ENV{ENS_ADMIN}; ! my $pass=$ENV{ENS_PASS}; my $host=$ENV{ENS_HOST}; my $sock=$ENV{ENS_SOCK}; open (MSQLV,'mysql -V|')||die 'Mysql crashed or no mysql installed'; my $msqlv=<MSQLV>; close MSQLV; --- 6,20 ---- my $drop=shift; my $clean=shift; ! chdir($locdir)||die $locdir; my (%db,@dbs); my $user=$ENV{ENS_ADMIN}; ! my $pass=$ENV{ENS_ADMINPASS}; my $host=$ENV{ENS_HOST}; my $sock=$ENV{ENS_SOCK}; + my $port=$ENV{ENS_PORT}; + my $overfl=$ENV{ENS_OVERFLOW}; + my $msqldir=$ENV{MYSQL_DATA}; open (MSQLV,'mysql -V|')||die 'Mysql crashed or no mysql installed'; + if ($overfl) { $avail=check_for_overflow($msqldir) ; } my $msqlv=<MSQLV>; close MSQLV; *************** *** 21,29 **** my $cs = "dbi:mysql:database=$sid;host=$host;"; $cs .= "mysql_socket=$sock;" if ($sock); my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; #Special table with every DB that loads, should be created in advance ! my $chdb=$dbh->prepare("use ensembl_databases")||die "Couldn't prepare- recording the DB\n"; ! my $list=$dbh->prepare("insert into ens_dbnames (db_name, version,current) values (?,?,'yes')") ||die "Couldn't prepare- recording the DB list\n",$DBI::errstr; ! my $updatec=$dbh->prepare("update ens_dbnames set current='no' where db_name=?") ||die "Couldn't prepare- recording the DB list\n",$DBI::errstr; my $droplist=$dbh->prepare("select db_name from ens_dbnames where current='yes'") ||die "Couldn't prepare- reading the DB list\n",$DBI::errstr; $droplist->execute; --- 25,33 ---- my $cs = "dbi:mysql:database=$sid;host=$host;"; $cs .= "mysql_socket=$sock;" if ($sock); + $cs .= "port=$port;" if ($port); my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; #Special table with every DB that loads, should be created in advance ! ! my $droplist=$dbh->prepare("select db_name from ens_dbnames where current='yes'") ||die "Couldn't prepare- reading the DB list\n",$DBI::errstr; $droplist->execute; *************** *** 47,61 **** my ($obsol)=grep(/$dbname/,@dbs); my $str=$dbh->prepare("create database $db") ||die "Couldn't create DB $db\n"; #Should we check first and drop it if exists? $chdb->execute ||die $DBI::errstr,"\n"; $str->execute ||die "Couldn't create DB $db\n ",$DBI::errstr; $list->execute($db,$ver) ||die "Couldn't record the database\n",$DBI::errstr; chdir($db); system('pwd'); my $ddlfile=($majormver<5)?"$db.mysql40_compatible.sql":"$db.sql"; ! my $sarg="mysql -h $host -u $user -p$pass $db <$ddlfile"; print "$sarg\n"; system($sarg)==0 ||die "Failed to create schema for $db\n"; ! my $load="mysqlimport -L -h $host -u $user -p$pass $db *.txt.table"; ! system($load)==0||die"Couldn't import\n"; $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; if ($obsol) { --- 51,81 ---- my ($obsol)=grep(/$dbname/,@dbs); my $str=$dbh->prepare("create database $db") ||die "Couldn't create DB $db\n"; #Should we check first and drop it if exists? + my $list=$dbh->prepare("insert into ens_dbnames (db_name, version,current) values (?,?,'yes')") ||die "Couldn't prepare- recording the DB list\n",$DBI::errstr; + my $chdb=$dbh->prepare("use ensembl_databases")||die "Couldn't prepare- recording the DB\n"; $chdb->execute ||die $DBI::errstr,"\n"; $str->execute ||die "Couldn't create DB $db\n ",$DBI::errstr; $list->execute($db,$ver) ||die "Couldn't record the database\n",$DBI::errstr; + my $updatec=$dbh->prepare("update ens_dbnames set current='no' where db_name=?") ||die "Couldn't prepare- recording the DB list\n",$DBI::errstr; chdir($db); system('pwd'); my $ddlfile=($majormver<5)?"$db.mysql40_compatible.sql":"$db.sql"; ! $up=$pass ? "-u $user -p$pass " : "-u $user"; ! my $sarg="mysql -h $host $up $db <$ddlfile"; ! my $avail; ! if ($overfl) { $avail=check_for_overflow($msqldir) ; } ! if (($avail<25)&&($msqldir)) { ! print "Using $overfl overflow\n"; ! system("mv $msqldir/$db $overfl")==0||die "Could not move to $overfl $?:$!"; ! system("ln -s $overfl/$db $msqldir")==0||die "Could not move to $overfl $?:$!"; ! } print "$sarg\n"; system($sarg)==0 ||die "Failed to create schema for $db\n"; ! open (DATF, "ls *.txt.table| wc -l|")||die; ! my $cntd=<DATF>; ! close DATF; ! if ($cntd>0) { ! my $load="mysqlimport -L -h $host $up $db *.txt.table"; ! system($load)==0||die"Couldn't import\n$load\n"; ! } $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; if ($obsol) { *************** *** 77,78 **** --- 97,113 ---- close DBS; print "$count databases loaded successfully\n"; + + sub check_for_overflow { + my $storage=shift; + unless ($storage) { die "Do not know where to overflow to, see that environment var MYSQL_DATA is set"; } + open (SZ,"df -h $storage|")||die "$?:$!"; + my $head=<SZ>; + my $where=<SZ>; + my $dat=<SZ>; + $dat=~s/^[\s\t]+//; + my ($size,$used,$avail,$mount)=split(/[\t\s]+/,$dat); + unless ($avail=~/G$/) { return 0}; + $avail=~s/\D//g; + return $avail; + } + |
From: kirovs <ki...@us...> - 2006-03-03 12:44:36
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5542 Modified Files: update.sh Log Message: Few bug fixes: Index: update.sh =================================================================== RCS file: /cvsroot/cogs/ensupdate/update.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** update.sh 1 Feb 2006 20:44:15 -0000 1.2 --- update.sh 3 Mar 2006 12:44:31 -0000 1.3 *************** *** 1,5 **** ! getensembl.pl core mart compara ! load_ensembl.pl drop clean #The next two lines will create link between database names and organisms and organism and stable ids (gene and transcript) ! ensdbnames_org.pl ! ensid_org.pl \ No newline at end of file --- 1,5 ---- ! perl getensembl.pl core mart compara ! perl load_ensembl.pl drop clean #The next two lines will create link between database names and organisms and organism and stable ids (gene and transcript) ! perl ensdbnames_org.pl ! perl ensid_org.pl |
From: kirovs <ki...@us...> - 2006-02-01 20:44:23
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15731 Modified Files: update.sh Log Message: added as an example how to link orgs to dbnames and stable ids Index: update.sh =================================================================== RCS file: /cvsroot/cogs/ensupdate/update.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** update.sh 6 Dec 2005 15:41:54 -0000 1.1 --- update.sh 1 Feb 2006 20:44:15 -0000 1.2 *************** *** 1,2 **** getensembl.pl core mart compara ! load_ensembl.pl drop clean \ No newline at end of file --- 1,5 ---- getensembl.pl core mart compara ! load_ensembl.pl drop clean ! #The next two lines will create link between database names and organisms and organism and stable ids (gene and transcript) ! ensdbnames_org.pl ! ensid_org.pl \ No newline at end of file |
From: kirovs <ki...@us...> - 2006-02-01 20:37:48
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12788 Modified Files: setup.pl Log Message: misleading config info printed Index: setup.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/setup.pl,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** setup.pl 5 Dec 2005 16:53:11 -0000 1.9 --- setup.pl 1 Feb 2006 20:37:40 -0000 1.10 *************** *** 27,46 **** my $shell=<STDIN>; chomp $shell; ! if ($shell eq 2) { print "To set your environment add this to your ~/.tcshrc file: ! SETENV ENS_HOST $host ! SETENV ENS_ADMIN $admin ! STEENV ENS_PASS $pass ! STEENV ENS_DATA $ddir ! then run this script again\n"; ! } ! else { ! print "To set your environment add this to your ~/.bashrc file: ! EXPORT ENS_HOST=$host ! EXPORT ENS_ADMIN=$admin ! EXPORT ENS_PASS=$pass ! EXPORT ENS_DATA=$ddir then run this script again\n"; - } exit(); } --- 27,39 ---- my $shell=<STDIN>; chomp $shell; ! $shcom=$shell==1?'export':'setenv'; ! print "To set your environment add this to your ~/.tcshrc file: ! $shcom ENS_HOST $host ! $shcom ENS_ADMIN $admin ! $shcom ENS_PASS $pass ! $shcom ENS_DATA $ddir ! restart your shell then run this script again\n"; exit(); } |
From: kirovs <ki...@us...> - 2005-12-29 19:56:11
|
Update of /cvsroot/cogs/AESIG In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18247 Added Files: graph_to_seq.pl Log Message: visualize sequences for a graph --- NEW FILE: graph_to_seq.pl --- use Bio::SeqIO; my $sf=shift; my $gf=shift; my $win=shift; open (GF,$gf)||die; my $seqio=new Bio::SeqIO(-file=>$sf,-format=>'fasta'); my %seqs; while (my $seq=$seqio->next_seq) { $seqs{$seq->id}=$seq; my $ps=$seq->translate; $pss{$seq->id}=$ps; } my $head=<GF>; while (my $buf=<GF>) { chomp $buf; my ($s1,$s2,$v)=split(/[\s\t]/,$buf); my ($id1,$p1)=split(/_/,$s1); $p1++; my ($id2,$p2)=split(/_/,$s2); $p2++; my $c1=int($p1/3); my $cm1=$p1%3; my $c11=$c1+3; $c1++ if ($c1==0); my $codon1=$pss{$id1}->subseq($c1,$c11); my ($id2,$p2)=split(/_/,$s2); my $c2=int($p2/3); my $cm2=$p2%3; my $c21=$c2+3; $c2++ if ($c2==0); my $codon2=$pss{$id2}->subseq($c2,$c21); my $sseq1=$seqs{$id1}->trunc($p1,$p1+$win-1); my $psseq1=$sseq1->translate; print $psseq1->seq,' ',$seqs{$id1}->subseq($p1,$p1+$win-1)," $p1 "; print "$codon1 $cm1\t\t"; my $sseq2=$seqs{$id2}->trunc($p2,$p2+$win-1); my $psseq2=$sseq2->translate; print $psseq2->seq,' ',$seqs{$id2}->subseq($p2,$p2+$win-1)," $p2",$v; print " $codon2 $cm2\n"; } |
From: kirovs <ki...@us...> - 2005-12-12 14:29:56
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26717 Modified Files: load_ensembl.pl Log Message: backcompatibility with mysql older than v5 Index: load_ensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/load_ensembl.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** load_ensembl.pl 6 Dec 2005 20:26:54 -0000 1.4 --- load_ensembl.pl 12 Dec 2005 14:29:42 -0000 1.5 *************** *** 12,15 **** --- 12,21 ---- my $host=$ENV{ENS_HOST}; my $sock=$ENV{ENS_SOCK}; + open (MSQLV,'mysql -V|')||die 'Mysql crashed or no mysql installed'; + my $msqlv=<MSQLV>; + close MSQLV; + my ($tr,$mver1)=split(/Distrib/,$msqlv); + my ($mver,$tr)=split(/,/,$mver1); + my ($majormver,@mver)=split(/\./,$mver); my $sid='ensembl_databases'; my $cs = "dbi:mysql:database=$sid;host=$host;"; *************** *** 46,50 **** chdir($db); system('pwd'); ! my $sarg="mysql -h $host -u $user -p$pass $db <$db.sql"; print "$sarg\n"; system($sarg)==0 ||die "Failed to create schema for $db\n"; --- 52,57 ---- chdir($db); system('pwd'); ! my $ddlfile=($majormver<5)?"$db.mysql40_compatible.sql":"$db.sql"; ! my $sarg="mysql -h $host -u $user -p$pass $db <$ddlfile"; print "$sarg\n"; system($sarg)==0 ||die "Failed to create schema for $db\n"; |
From: kirovs <ki...@us...> - 2005-12-06 20:27:04
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25273 Modified Files: load_ensembl.pl Log Message: some messages... Index: load_ensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/load_ensembl.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** load_ensembl.pl 6 Dec 2005 15:40:52 -0000 1.3 --- load_ensembl.pl 6 Dec 2005 20:26:54 -0000 1.4 *************** *** 30,34 **** push @dbs,$db; } ! open (DBS, "dbs" )||die"Cannot write the database data\n"; while (my $db=<DBS>) { chomp $db; --- 30,35 ---- push @dbs,$db; } ! open (DBS, "dbs" )||die "No the databases to load\n"; ! my $count; while (my $db=<DBS>) { chomp $db; *************** *** 65,69 **** } chdir(".."); } close DBS; ! --- 66,71 ---- } chdir(".."); + $count++; } close DBS; ! print "$count databases loaded successfully\n"; |
From: kirovs <ki...@us...> - 2005-12-06 15:42:03
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23091 Added Files: update.sh Log Message: typical update script --- NEW FILE: update.sh --- getensembl.pl core mart compara load_ensembl.pl drop clean |
From: kirovs <ki...@us...> - 2005-12-06 15:41:00
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22822 Modified Files: load_ensembl.pl Log Message: use ens_admin instead of user Index: load_ensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/load_ensembl.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** load_ensembl.pl 5 Dec 2005 16:10:23 -0000 1.2 --- load_ensembl.pl 6 Dec 2005 15:40:52 -0000 1.3 *************** *** 8,12 **** chdir($locdir); my (%db,@dbs); ! my $user=$ENV{ENS_USER}; my $pass=$ENV{ENS_PASS}; my $host=$ENV{ENS_HOST}; --- 8,12 ---- chdir($locdir); my (%db,@dbs); ! my $user=$ENV{ENS_ADMIN}; my $pass=$ENV{ENS_PASS}; my $host=$ENV{ENS_HOST}; |
From: kirovs <ki...@us...> - 2005-12-06 14:59:03
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15486 Modified Files: getensembl.pl Log Message: release system in place Index: getensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/getensembl.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** getensembl.pl 5 Dec 2005 17:57:10 -0000 1.6 --- getensembl.pl 6 Dec 2005 14:58:55 -0000 1.7 *************** *** 14,18 **** #Check for current version ! my $user=$ENV{ENS_USER}; my $pass=$ENV{ENS_PASS}; my $host=$ENV{ENS_HOST}; --- 14,18 ---- #Check for current version ! my $user=$ENV{ENS_ADMIN}; my $pass=$ENV{ENS_PASS}; my $host=$ENV{ENS_HOST}; *************** *** 54,93 **** $ftp->cwd($rmtdir) or die "Cannot change directory ($rmtdir)\n:".$ftp->message; ! my @files=grep(/-/&&!/README/i&&!/Current/i&&!/\-2$/,$ftp->dir); #Hope there are not going to be any more db-2 entries in the future ! ! my @names; ! foreach my $row (@files) { ! my @dat=split(/\s/,$row); ! my $name=pop @dat; ! if (($name=~/-/) && (!grep(/\b$name\b/,@exclusion_list))){ ! push @names,$name; ! } ! } ! #Get only the most recent version ! my %dbs; ! foreach my $name (@names) { my @dat=split(/-/,$name); my $version=pop @dat; ! my $dbname=join("-",@dat); ! if ($dbs{$dbname} <$version) { ! $dbs{$dbname}=$version; ! } ! } ! my @dbs; ! foreach my $key (keys %dbs) { ! push @dbs, $key."-".$dbs{$key}; } print "Retrieving files\n"; ! my @cores; #This is only for the core DB- get foreach my $db (@dbs) { ! $ftp->cwd("$db/data/mysql/"); ! ! my @all=$ftp->dir; foreach my $d (@all) { - next unless ($d=~/current/i);#Only data dirs if ($#list>-1) { my $req; #Check if this DB is requested --- 54,83 ---- $ftp->cwd($rmtdir) or die "Cannot change directory ($rmtdir)\n:".$ftp->message; ! my @files=grep(/^d.*\srelease/,$ftp->dir); #Use new release system ! #Get only the most recent release ! my ($lv,$lr); ! foreach my $rel (@files) { ! my @all=split(/\s/,$rel); ! my $name=pop @all; my @dat=split(/-/,$name); my $version=pop @dat; ! if ($version>$lv) { ! $lv=$version; ! $lr=$name; ! } } + $ftp->cwd($lr)||die; print "Retrieving files\n"; ! my @dbs=$ftp->dir; my @cores; #This is only for the core DB- get foreach my $db (@dbs) { ! my @cl=split(/\s/,$db); ! my $name=pop @cl; ! $ftp->cwd("$name/data/mysql")||die; ! my @all=$ftp->dir; foreach my $d (@all) { if ($#list>-1) { my $req; #Check if this DB is requested *************** *** 108,114 **** my $v2=($#dat<2)? 1:pop @dat; my $version=$v2."_".$v1; ! next unless ($current{$core}<$version); next if (-e $core); ! $ftp->cwd("$core/data/mysql")||die; print "Working on $core\n"; push @cores,$core;#Remember the DB names --- 98,104 ---- my $v2=($#dat<2)? 1:pop @dat; my $version=$v2."_".$v1; ! next unless ($current{$core}<$v1); next if (-e $core); ! $ftp->cwd("$core")||die; print "Working on $core\n"; push @cores,$core;#Remember the DB names *************** *** 135,139 **** } ! open (DBS, ">dbs" )||die"Cannot write the database data\n"; foreach my $db (@cores) { print DBS $db,"\n"; --- 125,129 ---- } ! open (DBS, ">dbs" )||die "Cannot write the database data\n"; foreach my $db (@cores) { print DBS $db,"\n"; |
From: kirovs <ki...@us...> - 2005-12-05 17:57:42
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32336 Modified Files: getensembl.pl Log Message: Index: getensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/getensembl.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** getensembl.pl 5 Dec 2005 17:46:50 -0000 1.5 --- getensembl.pl 5 Dec 2005 17:57:10 -0000 1.6 *************** *** 110,114 **** next unless ($current{$core}<$version); next if (-e $core); ! $ftp->cwd($core); print "Working on $core\n"; push @cores,$core;#Remember the DB names --- 110,114 ---- next unless ($current{$core}<$version); next if (-e $core); ! $ftp->cwd("$core/data/mysql")||die; print "Working on $core\n"; push @cores,$core;#Remember the DB names |
From: kirovs <ki...@us...> - 2005-12-05 17:47:02
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30896 Modified Files: getensembl.pl Log Message: only data dirs Index: getensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/getensembl.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** getensembl.pl 5 Dec 2005 17:43:02 -0000 1.4 --- getensembl.pl 5 Dec 2005 17:46:50 -0000 1.5 *************** *** 89,92 **** --- 89,93 ---- my @all=$ftp->dir; foreach my $d (@all) { + next unless ($d=~/current/i);#Only data dirs if ($#list>-1) { my $req; #Check if this DB is requested |
From: kirovs <ki...@us...> - 2005-12-05 17:43:10
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30128 Modified Files: getensembl.pl Log Message: do not chek unless list is suppl. Index: getensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/getensembl.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** getensembl.pl 5 Dec 2005 17:40:07 -0000 1.3 --- getensembl.pl 5 Dec 2005 17:43:02 -0000 1.4 *************** *** 89,100 **** my @all=$ftp->dir; foreach my $d (@all) { ! my $req; #Check if this DB is requested ! foreach my $target (@list) { ! if ($d=~/$target/) { ! $req++; ! last; ! } ! } next unless ($req); my @long=split(/\s/,$d); --- 89,102 ---- my @all=$ftp->dir; foreach my $d (@all) { ! if ($#list>-1) { ! my $req; #Check if this DB is requested ! foreach my $target (@list) { ! if ($d=~/$target/) { ! $req++; ! last; ! } ! } next unless ($req); + } my @long=split(/\s/,$d); |
From: kirovs <ki...@us...> - 2005-12-05 17:40:15
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29431 Modified Files: getensembl.pl Log Message: wrong again... Index: getensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/getensembl.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** getensembl.pl 5 Dec 2005 17:26:40 -0000 1.2 --- getensembl.pl 5 Dec 2005 17:40:07 -0000 1.3 *************** *** 1,5 **** #!/usr/bin/perl # ! # getensembl.pl # set the following in the code below # connects to ftpsite <host> --- 1,6 ---- #!/usr/bin/perl + # ! # Developed by Stefan Kirov 2004 # set the following in the code below # connects to ftpsite <host> *************** *** 7,194 **** # puts files in the local directory <locdir> ! # # Load the Net::FTP package - # use Net::FTP; ! my $prefix=$ENV{ENS_HOME}; ! my $cprefix=$ENV{GKDB_HOME}; ! # # Load the directory parser - # use File::Listing qw(parse_dir); ! $| = 1; $host = 'ftp.ensembl.org'; $locdir = "$prefix/newdata"; ! ! # ! # open a file to collect the database versions ! # ! #if (! ! open (DATAVER, ">>$locdir/ensembl_version.dat"); ! # { print "Cannot open .dat file $locdir/ensembl_version.dat\n"; ! # exit(1); ! # } ! ! # ! # connect to ENSEMBL ftp site ! # $ftp = Net::FTP->new($host) or die "Cannot contact $host\n:$!"; ! $ftp->login('anonymous', 'sch...@or...') or die "Cannot login ($host)\n:". $ftp->message; print " Logged into $host\n\n"; $ftp->binary(); - - # - # for each organism retrieve 7 files - # - %orgdirs = qw (human homo_sapiens_core - mouse mus_musculus_core - rat rattus_norvegicus_core - zebrafish danio_rerio_core - fly drosophila_melanogaster_core - mosquito anopheles_gambiae_core - celegans caenorhabditis_elegans_core - ); - - %orgval = ('human','Homo sapiens', - 'mouse','Mus musculus', - 'rat','Rattus norvegicus', - 'zebrafish','Danio rerio', - 'fly', 'Drosophila melanogaster', - 'mosquito', 'Anopheles gambiae', - 'celegans', 'Caenordhabditis elegans' - ); - - @organisms = keys(%orgdirs); - - @getfiles = qw (external_db.txt.table.gz - external_synonym.txt.table.gz - gene_stable_id.txt.table.gz - identity_xref.txt.table.gz - object_xref.txt.table.gz - transcript.txt.table.gz - transcript_stable_id.txt.table.gz - translation.txt.table.gz - xref.txt.table.gz); - - - foreach $organism (@organisms) - { - # - # delete existing .gz files to prepare for replacements - # - foreach $getfile (@getfiles) - { $gzfile = $locdir."/".$organism."_".$getfile; - if (-e $gzfile) - { print "Deleting $gzfile\n"; - unlink($gzfile); - } - } - - # - # delete existing .table files to prepare for replacements - # - foreach $getfile (@getfiles) - { $tablefile = $locdir."/".$organism."_".substr($getfile,0,length($getfile) - 3); - if (-e $tablefile) - { print "Deleting $tablefile\n"; - unlink($tablefile); - } - } - - $tablefile =''; - } - - # - # delete existing .dat files to prepare for replacements - # - foreach $getfile (@getfiles) - { $datfile = $locdir."/".substr($getfile,0,length($getfile) - 13).".dat"; - if (-e $datfile) - { print "Deleting $datfile\n"; - unlink($datfile); - } - } - - $datfile = ''; - - # # change to the directory where files will be stored - # - chdir "$locdir"; - my ($done,$syndone); ! foreach $organism (@organisms) ! { ! # ! # determine remote directory for the current version ! # ! $rmtdir = "/pub/current_$organism/data/mysql"; ! $ftp->cwd($rmtdir) or die "Cannot change directory ($rmtdir)\n:".$ftp->message; ! @ls = $ftp->ls('-lR'); ! foreach $file (parse_dir(\@ls)){ ! my($name, $type, $size, $mtime, $mode) = @$file; ! if (index($name,"$orgdirs{$organism}") == 0) ! {$orgversion = $name; ! print (DATAVER "$orgval{$organism}|$orgversion\n"); ! } ! } ! ! $ftp->cwd("$rmtdir/$orgversion") or ! die "Cannot change directory ($rmtdir/$orgversion)\n:".$ftp->message; ! foreach $getfile (@getfiles) ! { print "Retrieving $orgversion/$getfile\n"; ! $ftp->get ("$getfile", "${organism}_$getfile" ) or ! warn "Could not get $orgversion/$getfile\n"; ! system("gunzip ${organism}_$getfile"); ! $tablefile = substr($getfile,0,length($getfile) - 3); ! $datfile = 'ens_'.substr($getfile,0,length($getfile) - 13).".dat"; ! unless ($datfile=~/identity/) { $datfile=~s/\_id//i; } ! $datfile=~s/ernal//i; ! if ($datfile eq 'ens_ext_db.dat') { ! next if ($done); #All external_db files are the same now...may change ! $done++; ! } ! # if ($datfile eq 'ens_external_synonym.dat') { ! # next if ($syndone); #All external_db files are the same now...may change ! # $syndone++; ! # } ! ! if (!open (DATFILE, ">>$locdir/$datfile")) ! { print "Cannot open .dat file $locdir/$datfile\n"; ! exit(1); ! } ! ! if (!open (TABLEFILE, "$locdir/${organism}_$tablefile")) ! { print "Cannot open .table file $locdir/${organism}_$tablefile\n"; ! exit(1); ! } ! ! while ($buf = <TABLEFILE>) ! {chomp($buf); ! $buf =~ s/\t/|/g; ! $buf =~ s/\\N/na/g; #weird stuff from ensembl??? ! $line = $orgval{$organism}.'|'.$buf."|\n"; ! print (DATFILE "$line"); ! } ! close DATFILE; ! close TABLEFILE; ! } } ! close DATAVER; ! print "Done with download\n"; ! $ftp->quit or ! die "Could not close the connection cleanly\n: $!"; exit; --- 8,143 ---- # puts files in the local directory <locdir> ! # Load the Net::FTP package use Net::FTP; ! use DBI; ! #Check for current version ! my $user=$ENV{ENS_USER}; ! my $pass=$ENV{ENS_PASS}; ! my $host=$ENV{ENS_HOST}; ! my $sock=$ENV{ENS_SOCK}; ! $enslogin=$user; ! my $sid='ensembl_databases'; ! my $cs = "dbi:mysql:$sid:$host;mysql_socket=$sock"; ! my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; ! my $currenth=$dbh->prepare("select db_name, version from ens_dbnames where current = 'yes'")||die "Couldn't prepare the select statement\n"; ! $currenth->execute||die "Couldn't execute select: ",$DBI::errstr,"\n"; ! my @current=@{$currenth->fetchall_arrayref}; ! foreach my $val (@current) { ! $current{$val->[0]}=$val->[1]; ! } ! my $prefix=$ENV{ENS_DATA}; # Load the directory parser use File::Listing qw(parse_dir); ! my $target; ! my @list=@ARGV; $host = 'ftp.ensembl.org'; + $rmtdir = '/pub'; + chdir $prefix; + #system("rmdir -fr newdata") if (!(-e 'newdata')); + system("mkdir newdata") if (!(-e 'newdata')); $locdir = "$prefix/newdata"; ! # connect to ftp site $ftp = Net::FTP->new($host) or die "Cannot contact $host\n:$!"; ! $ftp->login('anonymous', $enslogin) or die "Cannot login ($host)\n:". $ftp->message; print " Logged into $host\n\n"; + chdir ('newdata'); $ftp->binary(); # change to the directory where files will be stored ! $ftp->cwd($rmtdir) or die "Cannot change directory ($rmtdir)\n:".$ftp->message; + my @files=grep(/-/&&!/README/i&&!/Current/i&&!/\-2$/,$ftp->dir); #Hope there are not going to be any more db-2 entries in the future ! my @names; ! foreach my $row (@files) { ! my @dat=split(/\s/,$row); ! my $name=pop @dat; ! if (($name=~/-/) && (!grep(/\b$name\b/,@exclusion_list))){ ! push @names,$name; ! } ! } ! #Get only the most recent version ! my %dbs; ! foreach my $name (@names) { ! my @dat=split(/-/,$name); ! my $version=pop @dat; ! my $dbname=join("-",@dat); ! if ($dbs{$dbname} <$version) { ! $dbs{$dbname}=$version; } + } + my @dbs; + foreach my $key (keys %dbs) { + push @dbs, $key."-".$dbs{$key}; + } ! print "Retrieving files\n"; + my @cores; + #This is only for the core DB- get + foreach my $db (@dbs) { + $ftp->cwd("$db/data/mysql/"); + my @all=$ftp->dir; + foreach my $d (@all) { + my $req; #Check if this DB is requested + foreach my $target (@list) { + if ($d=~/$target/) { + $req++; + last; + } + } + next unless ($req); + my @long=split(/\s/,$d); + my $core=pop @long; + #Check if newer + my @dat=split(/_/,$core); + my $v1=pop @dat; + my $v2=($#dat<2)? 1:pop @dat; + my $version=$v2."_".$v1; + next unless ($current{$core}<$version); + next if (-e $core); + $ftp->cwd($core); + print "Working on $core\n"; + push @cores,$core;#Remember the DB names + mkdir($core); + chdir($core); + my @files=grep (!/total/,$ftp->dir); + foreach my $file (@files) { + my @long=split(/\s+/,$file); + my $gfile=pop @long; + next if ($gfile=~/^\./); + $dfile=$gfile; + $dfile=~s/\.gz//; + next if (-e $dfile); + print "Getting $gfile..\n"; + $ftp->get($gfile); + #Gunzip as we go + system ("gunzip $gfile &"); + } + print "Done with $core\n"; + chdir(".."); + $ftp->cwd('..'); + } + $ftp->cwd("../../.."); + + } + open (DBS, ">dbs" )||die"Cannot write the database data\n"; + foreach my $db (@cores) { + print DBS $db,"\n"; + } + close DBS; + print "Done with download\n"; + $ftp->quit or + warn "Could not close the connection cleanly\n: $!"; + exit; |
From: kirovs <ki...@us...> - 2005-12-05 17:26:48
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27022 Modified Files: getensembl.pl Log Message: wrong ver Index: getensembl.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/getensembl.pl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** getensembl.pl 2 Dec 2005 17:04:01 -0000 1.1.1.1 --- getensembl.pl 5 Dec 2005 17:26:40 -0000 1.2 *************** *** 1,6 **** #!/usr/bin/perl - # ! # Developed by Stefan Kirov 2004 # set the following in the code below # connects to ftpsite <host> --- 1,5 ---- #!/usr/bin/perl # ! # getensembl.pl # set the following in the code below # connects to ftpsite <host> *************** *** 8,143 **** # puts files in the local directory <locdir> ! # Load the Net::FTP package use Net::FTP; ! use DBI; ! #Check for current version ! my $user=$ENV{ENS_USER}; ! my $pass=$ENV{ENS_PASS}; ! my $host=$ENV{ENS_HOST}; ! my $sock=$ENV{ENS_SOCK}; ! $enslogin=$user; ! my $sid='ensembl_databases'; ! my $cs = "dbi:mysql:$sid:$host;mysql_socket=$sock"; ! my $dbh= DBI->connect($cs,$user,$pass) or die "connecting: $DBI::errstr" ; ! my $currenth=$dbh->prepare("select db_name, version from ens_dbnames where current = 'yes'")||die "Couldn't prepare the select statement\n"; ! $currenth->execute||die "Couldn't execute select: ",$DBI::errstr,"\n"; ! my @current=@{$currenth->fetchall_arrayref}; ! foreach my $val (@current) { ! $current{$val->[0]}=$val->[1]; ! } ! my $prefix=$ENV{ENS_DATA}; # Load the directory parser use File::Listing qw(parse_dir); ! my $target; ! my @list=@ARGV; $host = 'ftp.ensembl.org'; - $rmtdir = '/pub'; - chdir $prefix; - #system("rmdir -fr newdata") if (!(-e 'newdata')); - system("mkdir newdata") if (!(-e 'newdata')); $locdir = "$prefix/newdata"; ! # connect to ftp site $ftp = Net::FTP->new($host) or die "Cannot contact $host\n:$!"; ! $ftp->login('anonymous', $enslogin) or die "Cannot login ($host)\n:". $ftp->message; print " Logged into $host\n\n"; - chdir ('newdata'); $ftp->binary(); - # change to the directory where files will be stored ! $ftp->cwd($rmtdir) or ! die "Cannot change directory ($rmtdir)\n:".$ftp->message; ! my @files=grep(/-/&&!/README/i&&!/Current/i&&!/\-2$/,$ftp->dir); #Hope there are not going to be any more db-2 entries in the future ! my @names; ! foreach my $row (@files) { ! my @dat=split(/\s/,$row); ! my $name=pop @dat; ! if (($name=~/-/) && (!grep(/\b$name\b/,@exclusion_list))){ ! push @names,$name; ! } ! } ! #Get only the most recent version ! my %dbs; ! foreach my $name (@names) { ! my @dat=split(/-/,$name); ! my $version=pop @dat; ! my $dbname=join("-",@dat); ! if ($dbs{$dbname} <$version) { ! $dbs{$dbname}=$version; ! } ! } ! my @dbs; ! foreach my $key (keys %dbs) { ! push @dbs, $key."-".$dbs{$key}; ! } - print "Retrieving files\n"; ! my @cores; ! #This is only for the core DB- get ! foreach my $db (@dbs) { ! $ftp->cwd("$db/data/mysql/"); ! my @all=$ftp->dir; ! foreach my $d (@all) { ! my $req; #Check if this DB is requested ! foreach my $target (@list) { ! if ($d=~/$target/) { ! $req++; ! last; ! } } - next unless ($req); ! my @long=split(/\s/,$d); ! my $core=pop @long; ! #Check if newer ! my @dat=split(/_/,$core); ! my $v1=pop @dat; ! my $v2=($#dat<2)? 1:pop @dat; ! my $version=$v2."_".$v1; ! next unless ($current{$core}<$version); ! next if (-e $core); ! $ftp->cwd($core); ! print "Working on $core\n"; ! push @cores,$core;#Remember the DB names ! mkdir($core); ! chdir($core); ! my @files=grep (!/total/,$ftp->dir); ! foreach my $file (@files) { ! my @long=split(/\s+/,$file); ! my $gfile=pop @long; ! next if ($gfile=~/^\./); ! $dfile=$gfile; ! $dfile=~s/\.gz//; ! next if (-e $dfile); ! print "Getting $gfile..\n"; ! $ftp->get($gfile); ! #Gunzip as we go ! system ("gunzip $gfile &"); ! } ! print "Done with $core\n"; ! chdir(".."); ! $ftp->cwd('..'); ! } ! $ftp->cwd("../../.."); ! } ! open (DBS, ">dbs" )||die"Cannot write the database data\n"; ! foreach my $db (@cores) { ! print DBS $db,"\n"; ! } ! close DBS; ! print "Done with download\n"; ! $ftp->quit or ! warn "Could not close the connection cleanly\n: $!"; exit; --- 7,194 ---- # puts files in the local directory <locdir> ! # # Load the Net::FTP package + # use Net::FTP; ! my $prefix=$ENV{ENS_HOME}; ! my $cprefix=$ENV{GKDB_HOME}; ! # # Load the directory parser + # use File::Listing qw(parse_dir); ! $| = 1; $host = 'ftp.ensembl.org'; $locdir = "$prefix/newdata"; ! ! # ! # open a file to collect the database versions ! # ! #if (! ! open (DATAVER, ">>$locdir/ensembl_version.dat"); ! # { print "Cannot open .dat file $locdir/ensembl_version.dat\n"; ! # exit(1); ! # } ! ! # ! # connect to ENSEMBL ftp site ! # $ftp = Net::FTP->new($host) or die "Cannot contact $host\n:$!"; ! $ftp->login('anonymous', 'sch...@or...') or die "Cannot login ($host)\n:". $ftp->message; print " Logged into $host\n\n"; $ftp->binary(); + # + # for each organism retrieve 7 files + # + %orgdirs = qw (human homo_sapiens_core + mouse mus_musculus_core + rat rattus_norvegicus_core + zebrafish danio_rerio_core + fly drosophila_melanogaster_core + mosquito anopheles_gambiae_core + celegans caenorhabditis_elegans_core + ); ! %orgval = ('human','Homo sapiens', ! 'mouse','Mus musculus', ! 'rat','Rattus norvegicus', ! 'zebrafish','Danio rerio', ! 'fly', 'Drosophila melanogaster', ! 'mosquito', 'Anopheles gambiae', ! 'celegans', 'Caenordhabditis elegans' ! ); ! @organisms = keys(%orgdirs); ! @getfiles = qw (external_db.txt.table.gz ! external_synonym.txt.table.gz ! gene_stable_id.txt.table.gz ! identity_xref.txt.table.gz ! object_xref.txt.table.gz ! transcript.txt.table.gz ! transcript_stable_id.txt.table.gz ! translation.txt.table.gz ! xref.txt.table.gz); ! foreach $organism (@organisms) ! { ! # ! # delete existing .gz files to prepare for replacements ! # ! foreach $getfile (@getfiles) ! { $gzfile = $locdir."/".$organism."_".$getfile; ! if (-e $gzfile) ! { print "Deleting $gzfile\n"; ! unlink($gzfile); ! } ! } ! # ! # delete existing .table files to prepare for replacements ! # ! foreach $getfile (@getfiles) ! { $tablefile = $locdir."/".$organism."_".substr($getfile,0,length($getfile) - 3); ! if (-e $tablefile) ! { print "Deleting $tablefile\n"; ! unlink($tablefile); ! } ! } ! ! $tablefile =''; } ! # ! # delete existing .dat files to prepare for replacements ! # ! foreach $getfile (@getfiles) ! { $datfile = $locdir."/".substr($getfile,0,length($getfile) - 13).".dat"; ! if (-e $datfile) ! { print "Deleting $datfile\n"; ! unlink($datfile); ! } ! } ! $datfile = ''; ! ! # ! # change to the directory where files will be stored ! # ! chdir "$locdir"; ! ! my ($done,$syndone); ! ! foreach $organism (@organisms) ! { ! # ! # determine remote directory for the current version ! # ! $rmtdir = "/pub/current_$organism/data/mysql"; ! $ftp->cwd($rmtdir) or ! die "Cannot change directory ($rmtdir)\n:".$ftp->message; ! ! @ls = $ftp->ls('-lR'); ! foreach $file (parse_dir(\@ls)){ ! my($name, $type, $size, $mtime, $mode) = @$file; ! if (index($name,"$orgdirs{$organism}") == 0) ! {$orgversion = $name; ! print (DATAVER "$orgval{$organism}|$orgversion\n"); ! } ! } ! ! $ftp->cwd("$rmtdir/$orgversion") or ! die "Cannot change directory ($rmtdir/$orgversion)\n:".$ftp->message; ! foreach $getfile (@getfiles) ! { print "Retrieving $orgversion/$getfile\n"; ! $ftp->get ("$getfile", "${organism}_$getfile" ) or ! warn "Could not get $orgversion/$getfile\n"; ! system("gunzip ${organism}_$getfile"); ! $tablefile = substr($getfile,0,length($getfile) - 3); ! $datfile = 'ens_'.substr($getfile,0,length($getfile) - 13).".dat"; ! unless ($datfile=~/identity/) { $datfile=~s/\_id//i; } ! $datfile=~s/ernal//i; ! if ($datfile eq 'ens_ext_db.dat') { ! next if ($done); #All external_db files are the same now...may change ! $done++; ! } ! # if ($datfile eq 'ens_external_synonym.dat') { ! # next if ($syndone); #All external_db files are the same now...may change ! # $syndone++; ! # } + if (!open (DATFILE, ">>$locdir/$datfile")) + { print "Cannot open .dat file $locdir/$datfile\n"; + exit(1); + } + + if (!open (TABLEFILE, "$locdir/${organism}_$tablefile")) + { print "Cannot open .table file $locdir/${organism}_$tablefile\n"; + exit(1); + } + + while ($buf = <TABLEFILE>) + {chomp($buf); + $buf =~ s/\t/|/g; + $buf =~ s/\\N/na/g; #weird stuff from ensembl??? + $line = $orgval{$organism}.'|'.$buf."|\n"; + print (DATFILE "$line"); + } + close DATFILE; + close TABLEFILE; + + } + } + + close DATAVER; + print "Done with download\n"; + $ftp->quit or + die "Could not close the connection cleanly\n: $!"; + + + exit; |
From: kirovs <ki...@us...> - 2005-12-05 16:53:20
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17924 Modified Files: setup.pl Log Message: some messages Index: setup.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/setup.pl,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** setup.pl 5 Dec 2005 16:41:45 -0000 1.8 --- setup.pl 5 Dec 2005 16:53:11 -0000 1.9 *************** *** 52,59 **** $cs.=";mysql_socket=$sock;" if ($sock); my $dbh; ! eval { ! $dbh=DBI->connect($cs,$admin, $pass)||die $DBI::errstr; ! }; if ($@) { my $tcs="DBI:mysql:host=$host;"; $tcs.=";mysql_socket=$sock;" if ($sock); --- 52,58 ---- $cs.=";mysql_socket=$sock;" if ($sock); my $dbh; ! eval { $dbh=DBI->connect($cs,$admin, $pass)||die $DBI::errstr; }; if ($@) { + print "DB not yet initialized, setup continuing OK, disregard error message above\n"; my $tcs="DBI:mysql:host=$host;"; $tcs.=";mysql_socket=$sock;" if ($sock); *************** *** 76,77 **** --- 75,78 ---- } system("mysql -h $host -p$pass -u $admin <initmgmtdb.sql")==0||die "Could not initialize correctly the management tables"; + print "Setup completed successfully.\n"; + print "You can setup a cron job now as explained in the README.\n"; |
From: kirovs <ki...@us...> - 2005-12-05 16:41:56
|
Update of /cvsroot/cogs/ensupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15647 Modified Files: setup.pl Log Message: can't run before setting the env Index: setup.pl =================================================================== RCS file: /cvsroot/cogs/ensupdate/setup.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** setup.pl 5 Dec 2005 04:27:45 -0000 1.7 --- setup.pl 5 Dec 2005 16:41:45 -0000 1.8 *************** *** 43,46 **** --- 43,47 ---- then run this script again\n"; } + exit(); } my $host=$ENV{ENS_HOST}; |