From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PsbSv-0002B8-Ot for garchives@archives.gentoo.org; Thu, 24 Feb 2011 13:42:50 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F089C1C048; Thu, 24 Feb 2011 13:42:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 564AF1C048 for ; Thu, 24 Feb 2011 13:42:37 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 47C551B4095 for ; Thu, 24 Feb 2011 13:42:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id ABC768006A for ; Thu, 24 Feb 2011 13:42:35 +0000 (UTC) From: "Martin Mokrejs" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Martin Mokrejs" Message-ID: <7f799f63edfc0dcebd06005b4e086ad467f619d2.mmokrejs@gentoo> Subject: [gentoo-commits] proj/sci:master commit in: sci-biology/est2uni/files/, sci-biology/est2uni/ X-VCS-Repository: proj/sci X-VCS-Files: sci-biology/est2uni/est2uni-0.27.ebuild sci-biology/est2uni/files/est_annot.pm.patch sci-biology/est2uni/files/est_annot_go.pm.patch sci-biology/est2uni/files/est_annot_psnp.pm.patch sci-biology/est2uni/files/est_annot_reciprocal_blast.pm.patch sci-biology/est2uni/files/est_clustering.pm.patch sci-biology/est2uni/files/est_prepro.pm.patch sci-biology/est2uni/files/installation_est2uni_perl.txt.patch sci-biology/est2uni/files/mysql_fixes.sql sci-biology/est2uni/files/pipe_db.pm.patch sci-biology/est2uni/files/tables.sql.patch X-VCS-Directories: sci-biology/est2uni/files/ sci-biology/est2uni/ X-VCS-Committer: mmokrejs X-VCS-Committer-Name: Martin Mokrejs X-VCS-Revision: 7f799f63edfc0dcebd06005b4e086ad467f619d2 Date: Thu, 24 Feb 2011 13:42:35 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 73594639d74f2a4e406fce053d3339f9 commit: 7f799f63edfc0dcebd06005b4e086ad467f619d2 Author: Martin Mokrejs fold natur cuni cz> AuthorDate: Thu Feb 24 13:42:21 2011 +0000 Commit: Martin Mokrejs fold natur cuni cz> CommitDate: Thu Feb 24 13:42:21 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/sci.git;a=3Dc= ommit;h=3D7f799f63 sci-biology/est2uni: working EST annotation package --- sci-biology/est2uni/est2uni-0.27.ebuild | 35 +- sci-biology/est2uni/files/est_annot.pm.patch | 456 +++++++++ sci-biology/est2uni/files/est_annot_go.pm.patch | 136 +++ sci-biology/est2uni/files/est_annot_psnp.pm.patch | 11 + .../files/est_annot_reciprocal_blast.pm.patch | 14 + sci-biology/est2uni/files/est_clustering.pm.patch | 383 ++++++++ sci-biology/est2uni/files/est_prepro.pm.patch | 85 ++ .../files/installation_est2uni_perl.txt.patch | 85 ++ sci-biology/est2uni/files/mysql_fixes.sql | 3 + sci-biology/est2uni/files/pipe_db.pm.patch | 972 ++++++++++++++= ++++++ sci-biology/est2uni/files/tables.sql.patch | 23 + 11 files changed, 2194 insertions(+), 9 deletions(-) diff --git a/sci-biology/est2uni/est2uni-0.27.ebuild b/sci-biology/est2un= i/est2uni-0.27.ebuild index 2e62216..45eaf42 100644 --- a/sci-biology/est2uni/est2uni-0.27.ebuild +++ b/sci-biology/est2uni/est2uni-0.27.ebuild @@ -8,7 +8,11 @@ inherit webapp eutils perl-module =20 DESCRIPTION=3D"EST assembly+annotation: a perl-based analysis pipeline i= ncluding php-based web interface" HOMEPAGE=3D"http://cichlid.umd.edu/est2uni/download.php" -SRC_URI=3D"http://cichlid.umd.edu/est2uni/est2uni_0.27.tar.gz" +SRC_URI=3D"http://cichlid.umd.edu/est2uni/est2uni_0.27.tar.gz + ftp://ftp.ncbi.nih.gov/pub/UniVec/UniVec + ftp://ftp.ncbi.nih.gov/pub/UniVec/UniVec_Core + http://www.geneontology.org/ontology/gene_ontology.obo + http://www.geneontology.org/doc/GO.terms_and_ids" =20 LICENSE=3D"GPL-3" KEYWORDS=3D"~amd64 ~x86" @@ -19,7 +23,7 @@ RDEPEND=3D"${DEPEND} sci-biology/lucy sci-biology/cap3-bin sci-biology/estscan - sci-biology/hmmer + =3Ddev-db/mysql-4.1 prepare($st); ++ my $sth=3D$dbh->prepare($st) or die localtime().": Error preparing INS= ERT INTO $table VALUES (?,?,?,?,?,?): $DBI::errstr\n"; + =09 + my $num_micros=3D0; +- open IN, "<$in_file"; ++ open IN, "<$in_file" or die ocaltime().": Error opening input file $in= _file: $!\n"; + my $seq_name; + my $num_micros_seq=3D0; + while (my $line=3D){ +@@ -279,7 +279,7 @@ + my $cmd=3D"$bin -u $max_unit_length -v $min_unit_length -L $min_length= _of_ssr $in_file > $out_file"; + not (system ($cmd)) or ( + print localtime().": Something went wrong running Sputnik to find mic= rosatellites\n" and +- print localtime().": Command was: $cmd\n" and ++ print localtime().": Command was: $cmd: $!\n" and + return 0 + ); + return 1; +@@ -322,7 +322,7 @@ + my $sth=3Dprepare_st($dbh,$st) or return 0; + execute_st($sth) or return 0; + open OUT,">$outf" or ( +- print localtime().": There was a problem opening the file $outf as ou= tput\n" and ++ print localtime().": There was a problem opening the file $outf as ou= tput: $!\n" and + return 0 + ); + while (my @field =3D $sth->fetchrow_array){ +@@ -371,8 +371,9 @@ + } + my $table=3Dread_config($config,'hmmer_table',''); + my $dbh=3Dopen_db($db) or return 0; +- my $st=3D"INSERT INTO $table VALUES ('',?,?,?,?,?,?,?,'');"; +- my $sth=3D$dbh->prepare($st); ++ my $st=3D"INSERT INTO $table VALUES (NULL,?,?,?,?,?,?,?,NULL);"; ++ print localtime().": Trying to prepare \"$st\" for db=3D$db and table=3D= $table\n"; ++ my $sth=3D$dbh->prepare($st) or print localtime().": Error preparing $= st statement: $DBI::errstr\n"; +=20 + =09 + my $ok=3D1; +@@ -427,7 +428,7 @@ + my $out=3Dread_config($config,'hmmer_res','');=09 + my $micros=3Dread_config($config,'micros',''); + unless ($bin and $db and $out and $micros){ +- print localtime().": Some of the parameters needed by HMMER are missi= ng\n"; ++ print localtime().": Some of the parameters needed by HMMER are missi= ng: $bin, $db, $out, $micros\n"; + return 0; + } + =09 +@@ -439,7 +440,7 @@ + $cmd=3D"$pvmd_bin $host_file &"; + print localtime().": Launching pvm: $cmd\n"; + not (system($cmd)) or ( +- print localtime().": There was a problem launching the pvm environme= nt\n" and ++ print localtime().": There was a problem launching the pvm environme= nt: $!\n" and + return 0 + ); + $cmd=3D"$bin --cpu $micros --pvm $db $in > $out"; +@@ -452,7 +453,7 @@ + stop_pvm($config); + } + if ($not_ok){ +- print localtime().": There was a problem running HMMER\n"; ++ print localtime().": There was a problem running HMMER: $!\n"; + return 0; + } + =09 +@@ -510,8 +511,8 @@ + #begin_orf mediumint unsigned not null, + #end_orf mediumint unsigned not null, + #reverse tinyint(1) not null +- my $st=3D"INSERT INTO $table VALUES ('',?,?,?,?,?,?);"; +- my $sth=3D$dbh->prepare($st); ++ my $st=3D"INSERT INTO $table VALUES (NULL,?,?,?,?,?,?);"; ++ my $sth=3D$dbh->prepare($st) or die localtime().": Error preparing $st= statement: $DBI::errstr\n"; + =09 + my $no_exit=3D1; + my $ok=3D1; +@@ -544,7 +545,7 @@ + } + $sth->execute() or $ok=3D0; + unless ($ok){ +- print localtime().": There was a problem executing the statement $= st\n"; ++ print localtime().": There was a problem executing the statement: = $st: $DBI::errstr\n"; + return 0; + } + }else{ +@@ -583,7 +584,7 @@ + my $cmd=3D"$bin $seq_file -M $matrix -t $out_pep -o $out_dna\n"; + not(system($cmd)) or ( + print localtime().": There has been a problem running ESTScan.\n" and +- print localtime().": Command was:\n$cmd\n" and ++ print localtime().": Command was:\n$cmd: $!\n" and + return 0 + ); + =09 +@@ -698,7 +699,7 @@ + if (not ($putative_e_value) or ($e_value < $putative_e_value)){ + #we evaluate if this is a good hit + #is greater than the $inf_limit +- if (($e_value<$inf_limit) and hit_is_not_annoymous($hit,$config)){ ++ if (($e_value<$inf_limit) and hit_is_not_anonymous($hit,$config)){ + #this is a good hit, we should annotate the unigene + $putative_e_value=3D$e_value; + #we remove the first word and the trailing information of the hit +@@ -718,7 +719,7 @@ + return $putative_annot; + } +=20 +-sub hit_is_not_annoymous ($$){ ++sub hit_is_not_anonymous ($$){ + my $hit=3Dshift; + my $config=3Dshift; + my $ok=3D1; +@@ -730,7 +731,7 @@ + if ($hit =3D~ /$tag/i) {return 0} + } +=20 +- # hit is also annonymous if it has no description ++ # hit is also anonymous if it has no description + # JF, 2007-01-10 + if ($hit =3D~ /^\t$/) {return 0} +=20 +@@ -747,7 +748,7 @@ + my $table=3Dread_config($config,'unigenes_table2','') or return 0; + my $st=3D"UPDATE $table SET annotation=3DNULL;"; + my $dbh=3Dopen_db($db) or ( +- print localtime().": Unable to open database $db\n" and ++ print localtime().": Unable to open database $db: $DBI::errstr\n" and + return 0 + ); + my $sth=3Dprepare_st($dbh,$st) or return 0; +@@ -776,7 +777,7 @@ + my $cmd=3D"cp $seq_file $blast_dir".$db_name; + my $fail=3Dsystem($cmd); + if ($fail){ +- print localtime().": There was a problem with the command: $cmd\n"; ++ print localtime().": There was a problem with the command: $cmd: $!\n= "; + return 0; + } + #format the database +@@ -792,7 +793,7 @@ + } + $fail=3Dsystem($cmd); #now the database is formatted + if ($fail){ +- print localtime().": There was a problem with the command: $cmd\n"; ++ print localtime().": There was a problem with the command: $cmd: $!\n= "; + print localtime().": Logfile is $log\n"; + return 0; + } +@@ -986,7 +987,7 @@ + my $in =3D new Bio::SearchIO(-format =3D> 'blast',-file =3D> $in_fil= e); + open OUT,">$out_file" or $ok=3D0; + unless ($ok) { +- print localtime().": The out file: $out_file could not be opened.\n"; ++ print localtime().": The out file: $out_file could not be opened: $!\= n"; + return 0; + } + =09 +@@ -1092,7 +1093,7 @@ +=20 + #prints a wellcome message + sub wellcome_annot () { +- print localtime().": Wellcome to the EST annotation pipe, have a pleas= ant jouney.\n\n"; ++ print localtime().": Welcome to the EST annotation pipe, have a pleasa= nt journey.\n\n"; + } +=20 +=20 +@@ -1112,6 +1113,7 @@ + my $dbh=3Dopen_db($db) or return 0; + #if the database is superunigenes previous blast superunigenes should = be removed + if ($blast_db =3D~ /superunigenes$/){ ++ print localtime().": Deleting previous BLAST results: DELETE FROM bla= st_result WHERE db=3D'superunigenes'\n"; + my $st=3D"DELETE FROM blast_result WHERE db=3D'superunigenes'"; + my $sth=3D$dbh->prepare($st) or return 0; + execute_st($sth) or return 0; +@@ -1129,18 +1131,19 @@ + if ($ext){$temp_in.=3D$separator.$ext} + =09 + #we create a new in file with the sequences that still has no blast st= ored in the database +- #if the blast is alredy done, there is no need to repeat it ++ #if the blast is already done, there is no need to repeat it + my $st; + if (read_config($config,'mysql_compress','')){ + $st=3D"SELECT UNCOMPRESS(blast_result) FROM blast_result WHERE query_= seq=3D? AND db=3D'$blast_db'"; + }else{ + $st=3D"SELECT blast_result FROM blast_result WHERE query_seq=3D? AND = db=3D'$blast_db'"; + } ++ print localtime().": Extracting from $in_file those FASTA entries whic= h have no rows matching in blast_result.query_seq using Bio::SeqIO into $= temp_in\n"; + my $sth=3D$dbh->prepare($st) or return 0; + my $num_blast_todo=3D0; + my $in_seq =3D Bio::SeqIO->new('-file' =3D> "<$in_file",'-format' =3D>= "fasta") or return 0; + my $out_seq =3D Bio::SeqIO->new('-file' =3D> ">$temp_in",'-format' =3D= > "fasta") or return 0; +- open OUT, ">$blast_file_from_db"; ++ open OUT, ">$blast_file_from_db" or print localtime().": Cannot write = to $blast_file_from_db file: $!\n"; + while (my $seq=3D$in_seq->next_seq){ + my $seq_name=3D$seq->id; + $sth->bind_param(1,$seq_name); +@@ -1162,10 +1165,11 @@ + #we run the blast + #we need to check for every blast if this blast has already been done = to avoid repeating blast from different modules + if (!$num_blast_todo){ +- print localtime().": All BLASTs are already on the database\n"; ++ print localtime().": All BLASTs are already in the database: \$num_bl= ast_todo=3D$num_blast_todo\n"; + my $cmd=3D"mv $blast_file_from_db $out_file"; + !system ($cmd) or return 0; +- return 1 ++ print localtime().": Renamed $blast_file_from_db to $out_file\n"; ++ return 1; + } + run_local_blast($temp_in,$in_type,$blast_file_from_blast,$blast_db,$co= nfig) or return 0; + $dbh=3Dopen_db($db) or return 0; +@@ -1173,14 +1177,18 @@ + #we split the result and we store it on the database + #we should do a minimal parsing but we don't use bioperl to speed up t= he process + #we just asume that every blast begins with ^BLAST and that the query = is ^Query=3D xxxxxxxx +- open IN,"<$blast_file_from_blast" or return 0; ++ if (! -r $blast_file_from_blast) { ++ print localtime().": File $blast_file_from_blast is not readable: $!\= n"; ++ return 0; ++ } ++ open IN,"<$blast_file_from_blast" or die localtime().": Cannot open $b= last_file_from_blast file: $!\n"; + my $more=3D1; + my $blast_result=3D""; + my $query=3D""; + if (read_config($config,'mysql_compress','')){ +- $st=3D"INSERT INTO blast_result (query_seq,db,blast_result) VALUES (?= ,?,COMPRESS(?))"; ++ $st=3D"INSERT DELAYED INTO blast_result (query_seq,db,blast_result) V= ALUES (?,?,COMPRESS(?))"; + }else{ +- $st=3D"INSERT INTO blast_result (query_seq,db,blast_result) VALUES (?= ,?,?)"; ++ $st=3D"INSERT DELAYED INTO blast_result (query_seq,db,blast_result) V= ALUES (?,?,?)"; + } + $sth=3D$dbh->prepare($st) or return 0; + while ($more){ +@@ -1211,6 +1219,7 @@ + #now we have two files with blast results, the one generated by the bl= ast and the one made by stored blast + #we should merge them to obtain the output file + my $cmd=3D"cat $blast_file_from_blast $blast_file_from_db > $out_file"= ; ++ print localtime().": Merging computed blast output with the one alread= y in database: 'cat $blast_file_from_blast $blast_file_from_db > $out_fil= e'\n"; + !system ($cmd) or return 0; + =09 + return 1; +@@ -1241,7 +1250,7 @@ + print localtime().": There was a problem executing the statement:\n" = and + print localtime().": Query: $query\n" and + print localtime().": Blast db: $blast_db\n" and +- print localtime().": $st\n" and ++ print localtime().": $st: $DBI::errstr\n" and + return 0=20 + ); + return 1; +@@ -1267,25 +1276,55 @@ + =09 + my $db;my $db_type; my $env_blastdir; my $program; + if (not($db_name =3D~ /unigenes\.*\d*/) and $db_name ne 'superunigenes= '){ ++ print localtime().": BLAST database $db_name does not match REGEXP wi= th /unigenes\.*\\d*/ nor =3D=3D'superunigenes',\n\t\t\tfetching its locat= ion from table db (sourced from databases.csv)\n"; + $db=3D${$$db_info{$db_name}}{'local_blast_name'}; + $db_type=3D${$$db_info{$db_name}}{'kind'};=20 ++ print localtime().": Inferred $db_type datatype from table db (source= d from databases.csv)\n"; + }else{ ++ # unigenes and superunigenes are DNA datasets generated from this EST= dataset ++ # albeit it is ugly these files were written into BLASTDB directory w= here typically site-wide, public databases exist + if ($ENV{'BLASTDB'}) { #if blastdb enviroment is set ++ print localtime().": BLAST database $db_name will be looked up via B= LASTDB=3D".$ENV{'BLASTDB'}."\n"; + #$env_blastdir =3D $ENV{'BLASTDB'}; + #$ENV{'BLASTDB'} =3D ''; + $db=3D$db_name; #db is just db name + }else{ #otherwise ++ print localtime().": Getting rid of the trailing '_dna' if possible\= n"; + $db_name =3D~ s/_dna$//; # get rid of '_dna' in db name + $db=3Dread_config($config,'blast_dir','').$db_name; #we should add t= he path to the database ++ print localtime().": BLAST database $db was looked up via est_pipe.c= onf variable \$blast_dir\n"; + } + $db_type=3D'dna'; ++ print localtime().": Forced 'dna' datatype because unigenes and super= unigenes are DNA datasets generated from this EST dataset.\n\t\t\t Howev= er, it is ugly that these files were written into BLASTDB defined directo= ry where typically site-wide, public databases exist.\n"; + } + unless (check_blastdb($ENV{'BLASTDB'},$db)) { + print localtime().": BLAST database $db cannot be found at $ENV{'BLAS= TDB'}\n"; ++ } else { ++ if (-r $ENV{'BLASTDB'}."/".$db) { ++ print localtime().": BLAST database $db exists in $ENV{'BLASTDB'}\n"= ; ++ if ($db_type eq 'dna') { ++ if (! -r $ENV{'BLASTDB'}."/".$db.".nin") { ++ system("cd $ENV{'BLASTDB'} && formatdb -p F -i $db") or die "Faile= d to formatdb -p F -i $db\n"; ++ } else { ++ print localtime().": BLAST database ".$ENV{'BLASTDB'}."/".$db." al= ready formatted, good\n"; ++ } ++ } elsif ($db_type eq 'pep') { ++ if (! -r $ENV{'BLASTDB'}."/".$db.".pin") { ++ system("cd $ENV{'BLASTDB'} && formatdb -p T -i $db") or die "Faile= d to formatdb -p T -i $db\n"; ++ } else { ++ print localtime().": BLAST database ".$ENV{'BLASTDB'}."/".$db." al= ready formatted, good\n"; ++ } ++ } else { ++ print localtime().": Do not know whether $db is a pep/dna database,= not checking whether it is formatted by formatdb, it is your job\n"; ++ } ++ } else { ++ print localtime().": Cannot find BLAST database ".$ENV{'BLASTDB'}."/= ".$db."\n"; ++ return 0; ++ } + } +=20 + if (!$db_type){ +- print localtime().": Database type (dna or pep) not defined for datab= ase $db_name\n"; ++ print localtime().": Database type (dna or pep) not defined for datab= ase $db_name in databases.csv and subsequently in table db.\n"; + return 0; + } + $program =3D ${$$db_info{$db_name}}{'blast_program'}; +@@ -1294,6 +1333,7 @@ + elsif ($in_type eq 'pep' and $db_type eq 'dna'){$program=3D'tblastn'} + elsif ($in_type eq 'dna' and $db_type eq 'pep'){$program=3D'blastx'} + elsif ($in_type eq 'pep' and $db_type eq 'pep'){$program=3D'blastp'} ++ else { print localtime().": Wrong combination of input data type=3D$i= n_type and db.kind=3D$in_type, do not know which of blastn/tblastn/blastx= /blastp to use\n"; return 0; } + }elsif($program ne'blastn' and $program ne'tblastn' and $program ne'bl= astx' and $program ne'blastp' and $program ne'tblastx'){ + print localtime().": BLAST program called $program is not allowed\n"; + return 0; +@@ -1330,7 +1370,7 @@ + $ok=3Dnot (system("rm $out_file")); + unless ($ok){ + print localtime().": The BLAST output file: $out_file\n"; +- print localtime().": exists and can not be removed\n"; ++ print localtime().": exists and can not be removed: $!\n"; + return 0; + }; + } +@@ -1346,7 +1386,7 @@ + my $fail=3Dsystem($cmd); + if ($fail){ + print localtime().": Something wen't wrong with the mpiBLAST\n"; +- print localtime().": Command was: $cmd\n"; ++ print localtime().": Command was: $cmd: $!\n"; + return 0; + } + } else { +@@ -1357,7 +1397,7 @@ + my $fail=3Dsystem($cmd); + if ($fail){ + print localtime().": Something wen't wrong with the BLAST\n"; +- print localtime().": Command was: $cmd\n"; ++ print localtime().": Command was: $cmd: $!\n"; + return 0; + } + }else{ +@@ -1371,7 +1411,7 @@ + #we create the input stream + my $in =3D Bio::SeqIO->new(-file =3D> $in_file , -format =3D> 'Fast= a') or $ok=3D0; + unless ($ok){ +- print localtime().": There was a problem opening the file $in_file\= n"; ++ print localtime().": There was a problem opening the file $in_file:= $!\n"; + } + my $seq; my $blast_report; + while ($seq=3D$in->next_seq()) { +@@ -1380,13 +1420,13 @@ + #input file there could be some memory trouble + $blast_report=3D $factory->blastall($seq); + unless ($blast_report) { +- print localtime().": There was a problem running the BLAST search\= n"; ++ print localtime().": There was a problem running the BLAST search:= $!\n"; + return 0; + } +- system("cat $temp_file >> $out_file") ++ system("cat $temp_file >> $out_file") or die "Cannot append to $out= _file: $!\n"; + } +- #we remove the temporal file +- system("rm $temp_file"); ++ #we remove the temporary file ++ system("rm $temp_file") or die "Cannot remove temporary file $temp_f= ile: $!\n"; + #my $blast_report =3D $factory->blastall($in_file); + } + } +@@ -1425,7 +1465,7 @@ + my $blast_dbs=3Dread_config($config,'blast_dbs',''); + my @blast_dbs=3Dsplit(/,/,$blast_dbs); + unless (@blast_dbs) { +- print localtime().": There are no BLAST databases defined in the conf= ig file\n"; ++ print localtime().": There are no BLAST databases defined in the conf= ig file under \$blast_dbs\n"; + return 0; + } + #how are the report files named? +@@ -1441,7 +1481,7 @@ + } + my $db=3Dread_config($config,'db_path',''); #complete path to the mysq= l db + unless (check_table($db,$table)){ +- print localtime().": Table $table for store the BLAST reports is not = in database $db\n"; ++ print localtime().": Table $table to store the BLAST reports is not i= n created in the database $db\n"; + return 0; + } +=20 +@@ -1461,7 +1501,7 @@ + my $config=3Dshift; + my $blast_db=3Dshift; + my $in_file=3Dshift; +- print localtime().": Storing BLAST report: $in_file into the database\= n"; ++ print localtime().": Storing BLAST report from $in_file into the datab= ase\n"; + my $table=3Dread_config($config,'blast_reports_table',''); + my $db=3Dread_config($config,'db_path',''); #complete path to the mysq= l db +=20 +@@ -1477,13 +1517,13 @@ + #| identity | float | | | 0 = | | + #| similarity | float | | | 0 = | | + #| e_value +- my $st=3D"INSERT INTO $table (blast_result_id,subj_acc,description,loc= ation_begin_query,location_end_query,location_query,location_begin_subj,l= ocation_end_subj,location_subj,identity,similarity,e_value) VALUES (?,?,?= ,?,?,?,?,?,?,?,?,?);"; ++ my $st=3D"INSERT DELAYED INTO $table (blast_result_id,subj_acc,descrip= tion,location_begin_query,location_end_query,location_query,location_begi= n_subj,location_end_subj,location_subj,identity,similarity,e_value) VALUE= S (?,?,?,?,?,?,?,?,?,?,?,?);"; + my $sth=3D$dbh->prepare($st) or return 0; + my $st_blast_result=3D"SELECT blast_result_id FROM blast_result WHERE = query_seq=3D? AND db=3D?"; + my $sth_blast_result=3D$dbh->prepare($st_blast_result) or return 0; + unless ($sth){ + print localtime().": There was a problem preparing statement:\n"; +- print localtime().": $st\n"; ++ print localtime().": $st: $DBI::errstr\n"; + close_db($dbh); + return 0; + } +@@ -1493,8 +1533,10 @@ + } + open IN, "<$in_file" or $ok=3D0; + unless ($ok) { +- print localtime()." There was a problem opening file $in_file\n"; ++ print localtime()." There was a problem opening file $in_file: $!\n"; + return 0; ++ } else { ++ print localtime().": Parsing $in_file with BLAST plaintext output\n"; + } + my $line;my $query;my $hit; + while ($ok){ +@@ -1513,7 +1555,7 @@ + if ($array[0]){ + $blast_result_id=3D$array[0] + }else{ +- print localtime().": BLAST result ID has not been found in the dat= abase\n"; ++ print localtime().": BLAST result blast_result_id has not been fou= nd in the database using query_seq=3D$query AND db=3D$blast_db\n"; + return 0; + } + =09 +@@ -1558,6 +1600,7 @@ + print localtime().": query: $query\n"; + print localtime().": blast_db: $blast_db\n"; + print localtime().": hit: $hit\n"; ++ print localtime().": The error was: $DBI::errstr\n"; + return 0; + } + } diff --git a/sci-biology/est2uni/files/est_annot_go.pm.patch b/sci-biolog= y/est2uni/files/est_annot_go.pm.patch new file mode 100644 index 0000000..bdda596 --- /dev/null +++ b/sci-biology/est2uni/files/est_annot_go.pm.patch @@ -0,0 +1,136 @@ +--- est_annot_go.pm.ori 2011-02-22 15:33:33.000000000 +0100 ++++ est_annot_go.pm 2011-02-23 00:12:48.000000000 +0100 +@@ -213,13 +213,13 @@ + sub annotate_go_from_blast($$){ + my $config=3Dshift; + my $db_info=3Dshift; +- print localtime().": Annotating the sequences with GO terms looking at= the BLAST results.\n"; ++ print localtime().": Annotating the sequences with GO terms from ".rea= d_config($config,'go_assoc_table','')." looking at the BLAST results in "= .read_config($config,'go_db_path','').".\n"; +=20 + #the go-blast_db association is stored in a table on a database + my $go_db_path=3Dread_config($config,'go_db_path',''); + my $assoc_table=3Dread_config($config,'go_assoc_table',''); + my $go_dbh=3Dopen_db($go_db_path) or ( +- print localtime().": There was a problem opening the database $go_db_= path\n" and ++ print localtime().": There was a problem opening the database $go_db_= path: $DBI::errstr\n" and + return 0 + ); + =09 +@@ -227,13 +227,13 @@ + my $result_table=3Dread_config($config,'go_table',''); + my $est_db_path=3Dread_config($config,'db_path',''); + my $est_dbh=3Dopen_db($est_db_path) or ( +- print localtime().": There was a problem opening the database $est_db= _path\n" and ++ print localtime().": There was a problem opening the database $est_db= _path: $DBI::errstr\n" and + return 0 + ); + #we use ignore because we're interested just in the first annotation f= or the combined seq_go_slim, it could be more but they're not important + my $est_st=3D"INSERT IGNORE INTO $result_table (db,db_symbol,qualifier= ,go_id,ori_evidence,evidence,aspect,taxon_id,e_value,is_slim,seq_id) VALU= ES (?,?,?,?,?,?,?,?,?,?,?);"; + my $est_sth=3Dprepare_st($est_dbh,$est_st) or ( +- print localtime().": There was a problem executing the statement $est= _st\n" and ++ print localtime().": There was a problem executing the statement $est= _st: $DBI::errstr\n" and + return 0 + ); + =09 +@@ -255,7 +255,7 @@ + my $real_table=3D$assoc_table.$go_db; + my $go_st=3D"SELECT db,db_symbol,qualifier,go_id,evidence,aspect,taxo= n_id,is_slim FROM $real_table WHERE db_symbol=3D? ;"; + my $go_sth=3Dprepare_st($go_dbh,$go_st) or ( +- print localtime().": There was a problem executing the statement $go= _st\n" and ++ print localtime().": There was a problem executing the statement $go= _st: $DBI::errstr\n" and + return 0 + ); + unless ($go_db){ +@@ -264,7 +264,7 @@ + } + #we go through the blast files using the bioperl blast parser + my $in =3D new Bio::SearchIO(-format =3D> 'blast',-file =3D> $blast= _file) or( +- print localtime().": There was a problem creating a bioperl handler = for the BLAST file $blast_file\n" and ++ print localtime().": There was a problem creating a bioperl handler = for the BLAST file $blast_file: $!\n" and + return 0 + ); +=20 +@@ -277,9 +277,12 @@ + my $significative_hit=3D0; + my $query=3D$result->query_name; + my $hit=3D$result->next_hit; +- unless ($hit){$done=3D1;last}; #if there isn't more hits we're finn= ished ++ unless ($hit){$done=3D1;last}; #if there isn't more hits we're fini= shed + my $acc=3D$hit->name; +- #the arabidopsis project puts an .number in the hit name that shoul= d be removed ++ if (! $acc ) { ++ print localtime().": No \$acc value parsed from \$hit->name\n"; ++ } ++ #the arabidopsis project puts a .number in the hit name that should= be removed + if (${$$db_info{$go_db}}{'orthologues_arabi_hack'}){=20 + $acc =3D~ s/\.\d$//; + } +@@ -299,7 +302,7 @@ + #is there go terms associated with this acc? + $go_sth->bind_param(1,$acc); + $go_sth->execute or ( +- print localtime().": There was a problem executing the statement = $go_st with accession $acc\n" and ++ print localtime().": There was a problem executing the statement = $go_st with accession $acc: $DBI::errstr\n" and + return 0 + ); + my $there_is_go=3D0; +@@ -319,7 +322,7 @@ + $est_sth->bind_param(10,$$go[7]); #is this a slim term? + $est_sth->bind_param(11,$query); #annotated sequence + $est_sth->execute or ( +- print localtime().": There was a problem executing the statemen= t $est_st\n" and ++ print localtime().": There was a problem executing the statemen= t $est_st: $DBI::errstr\n" and + return 0 + ); + $done=3D1; #we do not need any more hits +@@ -333,11 +336,12 @@ + $i_uni++; + } + close_st ($go_sth); ++ print localtime().": $i_uni BLAST unigenes processed from $blast_file= , $i_uni_with_go with GO annotations, and $i_go_assoc GO terms associated= \n"; + } + close_st ($est_sth); + close_db ($go_dbh); + close_db ($est_dbh); +- print localtime().": $i_uni BLAST unigenes processed, $i_uni_with_go w= ith GO annotations, and $i_go_assoc GO terms associated\n"; ++ print localtime().": $i_uni BLAST unigenes processed from $blast_file_= base and "."@go_dbs\n".", $i_uni_with_go with GO annotations, and $i_go_a= ssoc GO terms associated\n"; + return 1; + } +=20 +@@ -367,7 +371,7 @@ + my $assoc_file=3D${$$db_info{$db}}{'local_go_assoc_file'};=20 + my $cmd=3D"$bin $slim_file $go_def_file $assoc_file -o $temp_dir$base= _out_file".$sep."$db"; + not (system $cmd) or ( +- print localtime().": There was a problem executing: $cmd\n" and ++ print localtime().": There was a problem executing $cmd: $!\n" and + return 0 + ); + $i++; +@@ -447,7 +451,8 @@ + my $table=3Dread_config($config,'go_assoc_table',''); + #now it's time to fill the table with the data + my $real_table=3D$table.$go_db; +- my $st=3D"INSERT INTO $real_table (db,db_symbol,qualifier,go_id,eviden= ce,aspect,taxon_id,is_slim) VALUES (?,?,?,?,?,?,?,?);"; ++ # this is a wastefull insert inserting qualifier, taxon_id, is_slim eq= ual to NULL ++ my $st=3D"INSERT DELAYED INTO $real_table (db,db_symbol,qualifier,go_i= d,evidence,aspect,taxon_id,is_slim) VALUES (?,?,?,?,?,?,?,?);"; + my $dbh=3Dopen_db($db_path) or ( + print localtime().": There was a problem opening the database $db_pat= h\n" and + return 0 +@@ -491,7 +496,7 @@ + $sth->bind_param(5,$items[6]); #evidence + $sth->bind_param(6,$items[8]); #aspect + $sth->bind_param(7,$items[12]); #taxon_id +- $sth->bind_param(8,$is_slim); ++ $sth->bind_param(8,$is_slim); #is_slim + }else{ + print localtime().": Gene-GO association file has no defined format= in $config go_assoc_file_format\n"; + print localtime().": Or the format is not supported. Supported form= ats are goa and tair\n"; +@@ -542,7 +547,7 @@ + my $db=3Dread_config($config,'db_path',''); + =09 + open IN,"<$file" or ( +- print localtime().": Imposible to open file: $file\n" and ++ print localtime().": Error opening file $file: $!\n" and + return 0 + ); + =09 diff --git a/sci-biology/est2uni/files/est_annot_psnp.pm.patch b/sci-biol= ogy/est2uni/files/est_annot_psnp.pm.patch new file mode 100644 index 0000000..996d625 --- /dev/null +++ b/sci-biology/est2uni/files/est_annot_psnp.pm.patch @@ -0,0 +1,11 @@ +--- est_annot_psnp.pm.ori 2011-02-22 20:12:25.000000000 +0100 ++++ est_annot_psnp.pm 2011-02-22 20:12:46.000000000 +0100 +@@ -773,7 +773,7 @@ + } +=20 + my $dbh=3Dopen_db($db) or return 0; +- my $st_psnp=3D"INSERT INTO $table_psnp (psnp_id,unigene,location,is_sn= p,is_indel,score,enzymes) VALUES (?,?,?,?,?,?,'');"; ++ my $st_psnp=3D"INSERT INTO $table_psnp (psnp_id,unigene,location,is_sn= p,is_indel,score,enzymes) VALUES (?,?,?,?,?,?,NULL);"; + my $sth_psnp=3D$dbh->prepare($st_psnp); + my $st_seq=3D"INSERT INTO $table_seq (psnp_id,nucleotide,est,accession= ) VALUES (?,?,?,?);"; + my $sth_seq=3D$dbh->prepare($st_seq); diff --git a/sci-biology/est2uni/files/est_annot_reciprocal_blast.pm.patc= h b/sci-biology/est2uni/files/est_annot_reciprocal_blast.pm.patch new file mode 100644 index 0000000..e887f7e --- /dev/null +++ b/sci-biology/est2uni/files/est_annot_reciprocal_blast.pm.patch @@ -0,0 +1,14 @@ +--- est_annot_reciprocal_blast.pm.ori 2011-02-22 01:19:43.000000000 +010= 0 ++++ est_annot_reciprocal_blast.pm 2011-02-22 01:39:37.000000000 +0100 +@@ -106,8 +106,9 @@ + my @dbs=3Dsplit (',',read_config($config,'reci_dbs','')); + foreach my $db (@dbs){ + if (!$$db_info{$db}){ +- print localtime().": Database $db is not defined in db table on the = databases\n"; +- return 0; ++ print localtime().": Database $db included in \$reci_dbs is not desc= ribed in table db, skipping.\n"; ++ #return 0; ++ next; + } + my $in_file=3D$unigenes_seq_file; + my $outf=3D$in_file.$separator.$db.$separator."blast"; diff --git a/sci-biology/est2uni/files/est_clustering.pm.patch b/sci-biol= ogy/est2uni/files/est_clustering.pm.patch new file mode 100644 index 0000000..a6e553a --- /dev/null +++ b/sci-biology/est2uni/files/est_clustering.pm.patch @@ -0,0 +1,383 @@ +--- est_clustering.pm.ori 2011-02-21 13:12:39.000000000 +0100 ++++ est_clustering.pm 2011-02-22 20:23:16.000000000 +0100 +@@ -76,7 +76,7 @@ + } +=20 + sub contig_image ($) { +- print localtime().": Creating contig images\n"; ++ print localtime().": Creating contig images using contigimage.pl\n"; + my $config =3D shift; + my $bin =3D read_config($config,'contigimage_bin','contigimage.pl'); + my $ace =3D read_config($config,'ace_file',''); +@@ -94,6 +94,8 @@ + my $qual_file=3Dread_config($config,'seqclean_masked_qual',''); #outpu= t file for the qualities + my $db=3Dread_config($config,'db_path',''); #path to the database in= the format dbi:$dbi_driver:$db_name:$host + my @libraries=3Dsplit(/,/,read_config($config,'libraries','')); #libra= ries to be retrieved ++ # if populate_clone_table=3D0 then the clone table is empty, therefore= the SELECT would return empty results ++ my $populate_clone_table=3Dread_config($config,'populate_clone_table',= ''); + my $ok=3D1; + print localtime().": Fetching processed ESTs from the database\n"; + =09 +@@ -108,20 +110,36 @@ + #we create the handler for the database + my $dbh; my $sth; #database and statements handlers + if ($ok){$dbh=3Dopen_db($db) or $ok=3D0}; #we open the database +- my $st=3D"SELECT sequence.name,sequence.sequence,sequence.quality FROM= sequence,est,clone WHERE ( "; ++ ++ my $st=3D""; ++ if ($populate_clone_table) { ++ $st=3D"SELECT sequence.name,sequence.sequence,sequence.quality FROM s= equence,est,clone WHERE ( "; + foreach (@libraries) { + $st.=3D"clone.library =3D '$_' OR " + } + $_=3D$st; s/ OR $//;$st=3D$_; #this removes the trailing OR + $st.=3D" ) "; ++ } else { ++ $st=3D"SELECT sequence.name,sequence.sequence,sequence.quality FROM s= equence,est WHERE "; ++ } ++ ++ # if populate_clone_table=3D0 then the clone table is empty, therefore= the SELECT would return empty results ++ # mysql> SELECT sequence.name,sequence.sequence,sequence.quality FROM = sequence,est,clone WHERE ++ # ( clone.library =3D 'sgn' OR clone.library =3D 'fake' OR clon= e.library =3D 'tigr' ) ++ # AND clone.name=3Dest.clone AND est.processed_seq=3Dsequence.n= ame; ++ # Empty set (0.00 sec) ++ if ($populate_clone_table) { + $st.=3D "AND clone.name=3Dest.clone AND est.processed_seq=3Dsequence.n= ame"; ++ } else { ++ $st.=3D "est.processed_seq=3Dsequence.name"; ++ } + =09 + if ($ok) {$sth=3D$dbh->prepare($st) or $ok=3D0} + #we execute the statement + if ($ok) { + $sth->execute() or $ok=3D0; + unless ($ok) { +- print localtime().": There was an error executing the SELECT stateme= nt\n"; ++ print localtime().": There was an error executing the SELECT stateme= nt: $DBI::errstr\n"; + } + } + #now all the results are written in the output files +@@ -138,6 +156,7 @@ + $seq_stream->write_seq($seq); + $qual_stream->write_seq($seq->qual_obj()); + } ++ print localtime().": Fetched ".$sth->rows()." from the database.\n"; + close_st($sth); + close_db($dbh); + return $ok; +@@ -159,11 +178,11 @@ + ); + my $st=3D"DELETE FROM $table WHERE object_type=3D'contig' OR object_ty= pe=3D'singleton';"; + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": Unable to prepare the statement $st\n" and ++ print localtime().": Unable to prepare the statement $st: $DBI::errst= r\n" and + return 0 + ); + $sth->execute or ( +- print localtime().": Unable to execute the statement $st\n" and ++ print localtime().": Unable to execute the statement $st: $DBI::errst= r\n" and + return 0 + ); + close_st($sth); +@@ -172,11 +191,11 @@ + =09 + $st=3D"UPDATE $table SET unigene=3DNULL, location_begin=3DNULL, locati= on_end=3DNULL, orientation_fwd=3DNULL, r_begin_in=3DNULL, r_end_in=3DNULL= , inserts=3DNULL;"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": Unable to prepare the statement $st\n" and ++ print localtime().": Unable to prepare the statement $st: $DBI::errst= r\n" and + return 0 + ); + $sth->execute or ( +- print localtime().": Unable to execute the statement $st\n" and ++ print localtime().": Unable to execute the statement $st: $DBI::errst= r\n" and + return 0 + ); + close_st($sth); +@@ -227,7 +246,7 @@ + =09 + # First we run tgicl + chdir($temp_dir); +- $command=3D"$bin_tgicl ".$in_seq." -q ".$in_qual; ++ $command=3D"$bin_tgicl -F ".$in_seq." -q ".$in_qual; + if ($tgicl_opt) { + $command .=3D " $tgicl_opt"; + } +@@ -247,19 +266,25 @@ + unless ($tgicl_success) + { + print localtime().": There was a problem running tgicl. The command w= as:\n"; +- print "$command\n"; ++ print "$command: $!\n"; + return $tgicl_success; + } + =09 + # Now we save the results on the results dir + # file with the reads that form every contig + print localtime().": Saving the tgicl contigs results\n"; ++ if (-r $in_seq.$contigs_ext) { ++ # files from older tgicl are *_clusters + $command=3D"mv ".$in_seq.$contigs_ext." ".$contigs_file; ++ } elsif (-r $in_seq."_cl".$contigs_ext) { ++ # files from newer tgicl are *_cl_clusters ++ $command=3D"mv ".$in_seq."_cl".$contigs_ext." ".$contigs_file; ++ } + $tgicl_success=3D not(system($command)); + unless ($tgicl_success) + { + print localtime().": There was a problem moving the tgicl result. The= command was:\n"; +- print "$command\n"; ++ print "$command: $!\n"; + return $tgicl_success; + } + =09 +@@ -270,7 +295,7 @@ + unless ($tgicl_success) + { + print localtime().": There was a problem running tgicl. The command w= as:\n"; +- print "$command\n"; ++ print "$command: $!\n"; + return $tgicl_success; + } + =09 +@@ -286,7 +311,7 @@ + unless ($tgicl_success) + { + print localtime().": There was a problem running tgicl. The command w= as:\n"; +- print "$command\n"; ++ print "$command: $!\n"; + return $tgicl_success; + } + =09 +@@ -302,7 +327,7 @@ + unless ($tgicl_success) + { + print localtime().": There was a problem running tgicl. The command w= as:\n"; +- print "$command\n"; ++ print "$command: $!\n"; + return $tgicl_success; + } + =09 +@@ -313,7 +338,7 @@ + $tgicl_success=3Dnot(system($command)); + unless ($tgicl_success) + { +- print localtime().": There was a problem running cdbyank\n"; ++ print localtime().": There was a problem running $command: $!\n"; + return $tgicl_success; + } + =09 +@@ -353,7 +378,7 @@ + $ok=3Dnot(system($command)); + unless ($ok) { + print localtime().": There was a problem running cap3. The command wa= s:\n"; +- print "$command\n"; ++ print "$command: $!\n"; + return $ok; + } + my $qual_file=3D$seq_file.".qual"; +@@ -361,7 +386,7 @@ + system($command); + unless ($ok) { + print localtime().": There was a problem running cap3. The command wa= s:\n"; +- print "$command\n"; ++ print "$command: $!\n"; + return $ok; + } + =09 +@@ -390,7 +415,7 @@ + unless ($ok) + { + print localtime().": There was a problem running cap3. The command wa= s:\n"; +- print "$command\n"; ++ print "$command: $!\n"; + return $ok; + } + =09 +@@ -402,7 +427,7 @@ + unless ($ok) + { + print localtime().": There was a problem running cap3. The command wa= s:\n"; +- print "$command\n"; ++ print "$command: $!\n"; + return $ok; + } + =09 +@@ -412,7 +437,7 @@ + unless ($ok) + { + print localtime().": There was a problem running tgicl. The command w= as:\n"; +- print "$command\n"; ++ print "$command: $!\n"; + return $ok; + } + =09 +@@ -423,7 +448,7 @@ + unless ($ok) + { + print localtime().": There was a problem running tgicl. The command w= as:\n"; +- print "$command\n"; ++ print "$command: $!\n"; + return $ok; + } + =09 +@@ -442,17 +467,19 @@ + #we should keep the original singletons names=20 + my $single_file=3Dread_config($config,'singletons_list',''); + my $ori_single_file=3Dread_config($config,'original_singletons_list','= '); ++ ++ my $prefix=3Dread_config($config,'prefix',''); ++ my $postfix=3Dread_config($config,'postfix',''); ++ # doh, but the routine update_est_table_with_singletons() anyways look= s for the unchanged original file + my $cmd=3D"cp $single_file $ori_single_file"; + my $not_ok=3Dsystem ($cmd); + if ($not_ok){ +- print localtime()."; There was a problem with the command $cmd\n"; ++ print localtime()."; There was a problem with the command $cmd: $!\n"= ; + return 0; + } +- my $prefix=3Dread_config($config,'prefix',''); +- my $postfix=3Dread_config($config,'postfix',''); + unless ($prefix or $postfix){ +- print localtime().": WARNING, there are no prefix or postfix to chang= e unigene name\n"; +- print localtime().": WARNING, it won't be any name change\n"; ++ print localtime().": WARNING, there are no prefix or postfix defined = to change unigene name\n"; ++ print localtime().": WARNING, there won't be any name change\n"; + return 1; + } + change_seq_names_in_file($contigs_file,$config,'') or return 0; +@@ -470,8 +497,8 @@ + my $postfix=3Dread_config($config,'singleton_seq_tag',''); + =09 + my $temp_file=3Dselect_temp_file($config); +- open IN, "<$file"; +- open OUT, ">$temp_file\n"; ++ open IN, "<$file" or die "Error: failed to open $file: $!\n"; ++ open OUT, ">$temp_file" or die "Error: failed to write $temp_file: $!\= n"; + while (my $line =3D ){ + #for fasta files + if ($line =3D~ /^>/){ +@@ -586,7 +613,7 @@ + my $ok=3D1; + open OUT,">$outf" or $ok=3D 0; + unless ($ok){ +- print localtime().": There was a problem opening the file: $outf\n"; ++ print localtime().": There was a problem opening the file: $outf: $!\= n"; + return 0; + } + =09 +@@ -629,7 +656,7 @@ + my $ok=3D1; + open IN, "<$dnaf" or $ok=3D0; + unless ($ok){ +- print localtime().": ESTScan result file $dnaf couldn't be opened\n"; ++ print localtime().": ESTScan result file $dnaf couldn't be opened: $!= \n"; + return 0; + } + while (){ +@@ -653,18 +680,18 @@ + my $backf=3D$revf.".bak"; + my $not_ok=3Dsystem ("cp $revf $backf"); + if ($not_ok){ +- print localtime().": There was a problem when trying to do a copy of = $revf to $backf\n"; ++ print localtime().": There was a problem when trying to do a copy of = $revf to $backf: $!\n"; + return 0; + } + =09 + open OUT, ">$revf" or $ok=3D0; + unless ($ok){ +- print localtime().": Reverse file $revf couldn't be opened for output= \n"; ++ print localtime().": Reverse file $revf couldn't be opened for output= : $!\n"; + return 0; + } + open IN, "<$backf" or $ok=3D0; + unless ($ok){ +- print localtime().": Reverse file $backf couldn't be opened for input= \n"; ++ print localtime().": Reverse file $backf couldn't be opened for input= : $!\n"; + return 0; + } + while (){ +@@ -711,20 +738,20 @@ + =09 + open ACE, "<$ace_file" or $ok=3D0; + unless ($ok) { +- print localtime().": There has been a problem opening the file $ace_f= ile\n"; ++ print localtime().": There has been a problem opening the file $ace_f= ile: $!\n"; + print localtime().": Maybe is not in the correct tgicl_ace format.\n"= ; + return 0; + } +=20 + my $dbh=3Dopen_db($db); + unless ($dbh) { +- print localtime().": Database $dbh is not reachable\n"; ++ print localtime().": Database $dbh is not reachable: $DBI::errstr\n"; + return 0; + } + my $st=3D write_insert_st ($table,@fields); + my $sth=3Dprepare_st($dbh,$st); + unless ($sth) { +- print localtime().": There has been a problem preparing the statement= : $st\n"; ++ print localtime().": There has been a problem preparing the statement= : $st: $DBI::errstr\n"; + close_db($dbh); + return 0; + } +@@ -839,6 +866,10 @@ + push(@$orientation,$1); + } + $contig =3D~ s/^\n+//; ++ while ($contig =3D~ s/^BS\s+?\d+\s+?\d+\s+?([^\s]+)\s*\n//){ ++ print localtime().": Skipping BS line in the ACE output due to newe= r cap3: https://listas.upv.es/pipermail/est2uni/2008-October/000191.html\= n"; ++ } ++ $contig =3D~ s/^\n+//; + my $read_len=3D[]; my $seq_names=3D[]; + my $r_begin_in_read=3D[]; + my $r_end_in_read=3D[]; +@@ -955,7 +986,7 @@ + $table=3Dread_config($config,'est_table',''); + $st=3D"UPDATE $table SET unigene=3D?,orientation_fwd=3D?,location_begi= n=3D?,location_end=3D?,r_begin_in=3D?,r_end_in=3D?,inserts=3D? WHERE proc= essed_seq=3D?"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st\= n" and ++ print localtime().": There was a problem preparing the statement: $st= : $DBI::errstr\n" and + return 0 + ); + foreach my $contig_info (@contig_est_info){ +@@ -981,7 +1012,7 @@ + $sth->bind_param(7,$insertion); + $sth->bind_param(8,$seq_name); + $sth->execute or ( +- print localtime().": There was a problem executing the statement $s= t\n" and ++ print localtime().": There was a problem executing the statement: $= st: $DBI::errstr\n" and + return 0 + ); + unless (@{${$contig_info}[1]} and @{${$contig_info}[2]} and @{${$co= ntig_info}[3]}){ +@@ -1042,19 +1073,19 @@ + my $db=3Dread_config($config,'db_path',''); + my $dbh=3Dopen_db($db); + unless ($dbh) { +- print localtime().": Database $dbh is not reachable\n"; ++ print localtime().": Database $dbh is not reachable: $DBI::errstr\n"; + return 0; + } + my $st=3D"UPDATE $est_table SET unigene=3D?,orientation_fwd=3D1,locati= on_begin=3D1,location_end=3D?,r_begin_in=3D1,r_end_in=3D? WHERE processed= _seq=3D?"; + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st\= n" and ++ print localtime().": There was a problem preparing the statement: $st= : $DBI::errstr\n" and + return 0 + ); +=20 + my $singletons_file=3Dread_config($config,'seq_singletons_file',''); = #singletons fasta file + my $ori_singletons_file=3Dread_config($config,'original_singletons_lis= t',''); #singletons list file without the name change this is in fact th= e name of the est sequences that correspond to every singleton + open ORI, "<$ori_singletons_file" or ( +- print localtime().": There was a problem opening file: $ori_singleton= s_file\n" and ++ print localtime().": There was a problem opening file: $ori_singleton= s_file: $!\n" and + return 0 + ); +=20 +@@ -1070,7 +1101,7 @@ + $sth->bind_param(3,$len); + $sth->bind_param(4,$ori_line); + $sth->execute or ( +- print localtime().": There was a problem executing the statement $st= \n" and ++ print localtime().": There was a problem executing the statement: $s= t: $DBI::errstr\n" and + return 0 + ); =09 + } diff --git a/sci-biology/est2uni/files/est_prepro.pm.patch b/sci-biology/= est2uni/files/est_prepro.pm.patch new file mode 100644 index 0000000..7efcbe8 --- /dev/null +++ b/sci-biology/est2uni/files/est_prepro.pm.patch @@ -0,0 +1,85 @@ +--- est_prepro.pm.ori 2011-02-21 11:37:20.000000000 +0100 ++++ est_prepro.pm 2011-02-22 00:46:57.000000000 +0100 +@@ -478,7 +478,7 @@ + } + else { + print localtime()." There is a problem with the length in sequenc= e ".$temp_seq->id."\n"; +- print localtime()." from file: $seq_file\n. Quality and sequence = length don't match.\n"; ++ print localtime()." from file: $seq_file. Quality $temp_qual->len= gth and sequence $temp_seq->length length don't match.\n"; + #print $temp_seq->desc."\n"; + return 0; + } +@@ -973,7 +973,7 @@ + #check that $assignments_file exist + if (not(-r $assi_file)){ + print localtime().": ################################################= ######################\n"; +- print localtime().": WARNING: Assignment file for lucy is not found o= r not defined\n"; ++ print localtime().": WARNING: Assignment file $assi_file for lucy is = not found or not defined\n"; + print localtime().": Lucy will not be used in the preprocessing\n"; + print localtime().": ################################################= ######################\n"; + }else{ +@@ -1062,7 +1062,7 @@ + my $tag=3Dread_config($config,'assignment_tag',''); + $command=3D"echo $tag".$library.">> $temp_log"; + chdir ($temp_dir); #we change the directory becouse lucy write some st= uff in the working directory +- system($command); ++ system($command) or die print localtime().": $command failed: $!\n"; + chdir ($actual_dir); + # Options used: + # $in_seq fasta sequences generated by phred +@@ -1086,9 +1086,9 @@ + =09 + # lucy log is moved to the results directory + $command=3D"cat $temp_log >> $log"; +- system($command); ++ system($command) or die print localtime().": failed to append $temp_lo= g contents to $log\n"; + $command=3D"rm $temp_log"; +- system($command); ++ system($command) or die print localtime().": failed to delete $temp_lo= g\n"; + =09 + if ($success) + { +@@ -1112,8 +1112,8 @@ + print localtime().": Parsing the lucy output\n"; + # now we check that the input file is in place + unless (check_file($lucy_log_file,"lucy log file")){ +- print localtime().": WARNING there is no lucy log file\n"; +- print localtime().": Maybe lucy has not been used by any library\n"; ++ print localtime().": WARNING there is no lucy log file $lucy_log_file= \n"; ++ print localtime().": Maybe lucy has not been used by any library?\n"; + return 1; + } + =09 +@@ -1490,7 +1490,7 @@ + sub run_seqclean($$$$$$$$$$$$) + { + my $config=3Dshift; +- my $library=3Dshift; # informational porpouse only ++ my $library=3Dshift; # informational purpose only + my $trimmed_fasta_file=3Dshift; # name for the trimmed sequences file + my $trimmed_qual_file=3Dshift; # name for the trimmed quality file + my $seqclean_report_file=3Dshift; # report file with the masked area +@@ -1518,7 +1518,13 @@ + #The file with the vector (univec recommended) + my $vec_file=3Dread_config($config,'seqclean_vec_dat',''); + unless (check_file($vec_file,"vector database")){return 0}; +-=09 ++ if (! -r $vec_file.".nin") { ++ print localtime().": Formatting database with formatdb -p F -i $vec_f= ile\n"; ++ system("cd `dirname $vec_file` && formatdb -p F -i $vec_file"); ++ if (! -r $vec_file.".nin") { ++ die "Failed to formatdb $vec_file: $!\n"; ++ } ++ } + my $seqclean_success=3D1; # control variable + my $command; + my $temp; +@@ -1749,7 +1755,7 @@ + sub seqclean_masking_assignments ($$$$$$) + { + my $config=3Dshift; +- print localtime().": Masking the sequences following seqclean's recome= ndations\n"; ++ print localtime().": Masking the sequences following seqclean's recomm= endations\n"; + my @libraries=3Dsplit(',',read_config($config,'libraries','')); # libr= aries names + my $report=3Dread_config($config,'seqclean_report',''); # base name fo= r the report generated by seqclean, this is the file with the instruccion= s for masking the sequences + my $in_seq=3Dshift; # base name for the trimmed sequences file genera= ted by lucy diff --git a/sci-biology/est2uni/files/installation_est2uni_perl.txt.patc= h b/sci-biology/est2uni/files/installation_est2uni_perl.txt.patch new file mode 100644 index 0000000..a4d2413 --- /dev/null +++ b/sci-biology/est2uni/files/installation_est2uni_perl.txt.patch @@ -0,0 +1,85 @@ +--- installation_est2uni_perl.txt.ori 2011-02-21 11:52:15.000000000 +010= 0 ++++ installation_est2uni_perl.txt 2011-02-21 22:58:23.000000000 +0100 +@@ -84,8 +84,12 @@ + .qual. +=20 + There are some library examples on the 'test_data' directory of the EST= 2uni +-distribution. You could just copy that libraries to check the software.= Be +-aware that the sgn chromatograms could need a modification in the phred= par.dat file ++distribution. You could just copy that libraries to check the software. ++ ++ > cp /usr/local/est2uni/test_data/libraries/* ./libraries ++ > cp -r /usr/local/est2uni/test_data/data . ++ ++Be aware that the sgn chromatograms could need a modification in the ph= redpar.dat file + (see installation instructions for phred in docs/installation_external_= software.txt). +=20 + 4.- Copy the estpipe.conf.example file from the installation directory = into +@@ -205,7 +209,7 @@ + Although the clustering software could consider that two unigenes are n= ot similar + enough to be merged, it is useful to know which are these similar clust= ers of unigenes. + Accordingly, EST2uni does a clustering of the unigenes, and these clust= ers are named +-'superunigenes'. This analysis is done thorough a BLAST search, followe= d by ++'superunigenes'. This analysis is done through a BLAST search, followed= by + parsing the results. Unigenes with a similarity high enough (above user= -defined threshold + parameters) are then clustered in a superunigene. +=20 +@@ -219,15 +223,17 @@ +=20 + In EST2uni a database can have several aspects like the blast indexed f= iles, the fasta + sequence files or the related GO files. This information should be plac= ed in the file +-referenced by the parameter databases_dat. This file should be uploaded= to the database=20 +-setting the parameters populate_database_table and do_prior_data_popula= tion to 1. ++referenced by the parameter databases_dat, usually named databases.csv. ++Contents of this file will be uploaded into the database when the param= eters ++populate_database_table and do_prior_data_population are set to 1. +=20 + In that file, the name of the database is defined in the field "name" a= nd could be different + than the BLAST name. For instance the database name could be "arabidops= is" and the local +-BLAST name could be "tair6". When a BLAST against database "arabidopsis= " is +-asked, EST2uni will look for the local BLAST name in the database. In t= his example the blast should +-be asked for the database "arabidopsis", not against "tair6", despite t= he fact that the +-local blast database is named "tair6". ++BLAST filename could be "tair6". When a BLAST against database "arabido= psis" is ++asked, EST2uni will look for the local BLAST-formatted filenames tair6.= * in the BLASTDB ++of $blast_dir directory. In this example the blast should be asked for = the database ++"arabidopsis", not against "tair6", despite the fact that the local bla= st database is ++named "tair6". +=20 +=20 + BLAST ANNOTATION +@@ -243,7 +249,8 @@ + this example the arabidopsis database should be defined in the database= s_dat file. On that=20 + file the field local_blast_name should be the name given to that databa= se on the local blast + installation. For instance it could be named tair6. That means that the= name in the blast_dbs +-parameter and the name of the database in the local blast installation = could be different. ++parameter and the name of the database in the local blast installation = could be different ++(they are mapped via the databases.csv trick). +=20 + Other important field in the databases file is "kind", which should be = set to dna or pep. +=20 +@@ -357,7 +364,7 @@ + same database. The paths for these files should be specified in the lo= cal_go_assoc_file and + local_go_slim_obo_file of the databases information file. The GO assoc= iation file for the=20 + arabidopsis database can be downloaded from the www.arabidopsis.org si= te. At the time of +- this writting the file is located in: ++ this writing the file is located in: + ftp://ftp.arabidopsis.org/home/tair/Ontologies/Gene_Ontology/ATH_GO_G= OSLIM.20061021.txt + The GO slim obo file for arabidopsis and goa is on the Gene Ontology f= tp: + ftp://ftp.geneontology.org/pub/go/GO_slims/go_slim_plant.obo +@@ -376,7 +383,7 @@ + ---------------- +=20 + You just need to set the parameter do_hmmer_annot to 1 and to set the n= ame +-of the HMMER database on the parameter pfam_db. ++of the HMMER database on the parameter pfam_db with a full path. +=20 + HMMER uses the ORFs as a starting point, so it is necessary to have the= annotated + ORF already in the database or to ask for the do_estscan_annot. +@@ -400,5 +407,5 @@ + --------------------------- +=20 + Every researcher can be associated with several ESTs using the csv file= defined in the working_on_dat +-parameter. Those relationships will get loaded when the parameters popu= late_workin_on_table and ++parameter. Those relationships will get loaded when the parameters popu= late_working_on_table and + do_prior_data_population are set to 1. diff --git a/sci-biology/est2uni/files/mysql_fixes.sql b/sci-biology/est2= uni/files/mysql_fixes.sql new file mode 100644 index 0000000..ee3ec93 --- /dev/null +++ b/sci-biology/est2uni/files/mysql_fixes.sql @@ -0,0 +1,3 @@ +alter table db change kind kind enum('dna','pep') default null; +alter table db change blast_program blast_program enum('blastn', 'blastp= ', 'blastx', 'tblastn', 'tblastx') default null; +alter table db change rec_sim_type rec_sim_type enum('orthologue', 'syno= nymous') default null; diff --git a/sci-biology/est2uni/files/pipe_db.pm.patch b/sci-biology/est= 2uni/files/pipe_db.pm.patch new file mode 100644 index 0000000..139cf56 --- /dev/null +++ b/sci-biology/est2uni/files/pipe_db.pm.patch @@ -0,0 +1,972 @@ +--- pipe_db.pm.ori 2011-02-22 18:08:58.000000000 +0100 ++++ pipe_db.pm 2011-02-22 14:48:03.000000000 +0100 +@@ -90,29 +90,29 @@ +=20 + my $db=3Dread_config($config,'db_path',''); #database in the form dbi= :$dbi_driver:$db_name:$host + my $dbh=3Dopen_db($db) or ( +- print localtime().": There was a problem opening the database $db: $D= BI::errstr\n" and ++ print localtime().": There was a problem opening the database $db\n" = and + return 0 + ); #we open the database +=20 + #the location statistics + my $st=3D"INSERT INTO pssr_location_view SELECT CASE ((ssr_endorf_end)*2+(ssr_begin>orf_begin && ssr_endorf_end)*2+(ssr_begin>orf_begin && ssr_endfetchrow_array){ +@@ -196,11 +196,11 @@ + close_st($sth); + $st=3D"UPDATE unigene_structure_annotation_view SET max_est=3D$max,av= g_est=3D$avg"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + );=20 + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); +@@ -213,11 +213,11 @@ + #now the annotated unigenes + my $st=3D"SELECT COUNT(*) FROM sequence WHERE annotation IS NOT NULL A= ND (object_type=3D'contig' OR object_type=3D'singleton')"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + );=20 + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + my @record=3D$sth->fetchrow_array; +@@ -225,22 +225,22 @@ + close_st($sth); + $st=3D"UPDATE unigene_structure_annotation_view SET n_uni_with_annot=3D= $n_annot"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + );=20 + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); + #now the full len + my $st=3D"SELECT COUNT(*) FROM sequence WHERE full_length IS NOT NULL = AND (object_type=3D'contig' OR object_type=3D'singleton')"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + );=20 + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + @record=3D$sth->fetchrow_array; +@@ -248,11 +248,11 @@ + close_st($sth); + $st=3D"UPDATE unigene_structure_annotation_view SET n_uni_with_full_le= n=3D$n_annot"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + );=20 + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); +@@ -263,14 +263,14 @@ + my $dbh=3Dshift; + my $values=3Dshift; + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + my $i=3D1; + foreach my $value (@$values){ + $sth->bind_param($i,$value); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st= : $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st= " and + return 0 + ); + $i++; +@@ -282,7 +282,7 @@ + my $dbh=3Dshift; + my $intervals=3Dshift; + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + my $bottom; +@@ -293,7 +293,7 @@ + $sth->bind_param(1,$bottom); + $sth->bind_param(2,$top); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $s= t: $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $s= t" and + return 0 + ); + my @record=3D$sth->fetchrow_array; +@@ -329,16 +329,16 @@ +=20 + my $db=3Dread_config($config,'db_path',''); #database in the form dbi= :$dbi_driver:$db_name:$host + my $dbh=3Dopen_db($db) or ( +- print localtime().": There was a problem opening the database $db: $D= BI::errstr\n" and ++ print localtime().": There was a problem opening the database $db\n" = and + return 0 + ); #we open the database + my $st=3D"INSERT psnp_accessions_view (accession) SELECT DISTINCT acce= ssion FROM putative_snp_seq"; + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); +@@ -354,26 +354,26 @@ +=20 + my $db=3Dread_config($config,'db_path',''); #database in the form dbi= :$dbi_driver:$db_name:$host + my $dbh=3Dopen_db($db) or ( +- print localtime().": There was a problem opening the database $db: $D= BI::errstr\n" and ++ print localtime().": There was a problem opening the database $db\n" = and + return 0 + ); #we open the database + my $st=3D"CREATE TEMPORARY TABLE psnp_mutations_temp (nucleotides CHAR= (10),is_snp BOOL,INDEX(nucleotides,is_snp)) SELECT GROUP_CONCAT(DISTINCT(= putative_snp_seq.nucleotide) ORDER BY putative_snp_seq.nucleotide) AS nuc= leotides,putative_snp.is_snp FROM putative_snp_seq,putative_snp WHERE put= ative_snp_seq.psnp_id=3Dputative_snp.psnp_id AND putative_snp_seq.nucleot= ide!=3D'*' AND putative_snp.is_indel=3D0 GROUP BY putative_snp_seq.psnp_i= d"; + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); + $st=3D"INSERT INTO psnp_mutations_view (mutations,is_snp,count) SELECT= nucleotides,is_snp,COUNT(*) AS count FROM psnp_mutations_temp WHERE LENG= TH(nucleotides)=3D3 GROUP BY nucleotides,is_snp"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); +@@ -389,16 +389,16 @@ +=20 + my $db=3Dread_config($config,'db_path',''); #database in the form dbi= :$dbi_driver:$db_name:$host + my $dbh=3Dopen_db($db) or ( +- print localtime().": There was a problem opening the database $db: $D= BI::errstr\n" and ++ print localtime().": There was a problem opening the database $db\n" = and + return 0 + ); #we open the database + my $st=3D"INSERT reciprocal_species_view (species,type) SELECT species= ,type FROM reciprocal_similar_sequences GROUP BY species"; + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); +@@ -416,46 +416,46 @@ +=20 + my $db=3Dread_config($config,'db_path',''); #database in the form dbi= :$dbi_driver:$db_name:$host + my $dbh=3Dopen_db($db) or ( +- print localtime().": There was a problem opening the database $db: $D= BI::errstr\n" and ++ print localtime().": There was a problem opening the database $db\n" = and + return 0 + ); #we open the database + my $st=3D"INSERT INTO go_uni_aspect_view (db,aspect,num_unigenes,word)= SELECT go.db,go.aspect,count(DISTINCT go.seq_id) AS num_unigenes, CONCAT= (go.aspect,go.db) AS word FROM clone,go,est WHERE est.clone=3Dclone.name = AND go.seq_id=3Dest.unigene AND go.is_slim=3D1 GROUP BY word"; + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); + $st=3D"INSERT INTO go_uni_aspect_library_view (db,aspect,library,num_u= nigenes,word) SELECT go.db,go.aspect,clone.library,count(DISTINCT go.seq_= id) AS num_unigenes, CONCAT(go.aspect,go.db,clone.library) AS word FROM = clone,go,est WHERE est.clone=3Dclone.name AND go.seq_id=3Dest.unigene AND= go.is_slim=3D1 GROUP BY word"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); + $st=3D"INSERT INTO go_term_aspect_view (db,aspect,go_id,definition,num= _go,word) SELECT db,go.aspect,go.go_id,definition,count(DISTINCT go.seq_i= d) AS num_go, CONCAT(go.go_id,go.aspect,db) AS word FROM go,go_def WHERE = is_slim=3D1 AND go_def.go_id=3Dgo.go_id GROUP BY word"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); + $st=3D"INSERT INTO go_term_aspect_library_view (db,aspect,go_id,defini= tion,library,num_go,word) SELECT db,go.aspect,go.go_id,definition,clone.l= ibrary,count(DISTINCT go.seq_id) AS num_go, CONCAT(go.go_id,go.aspect,db,= clone.library) AS word FROM go,go_def,est,clone WHERE is_slim=3D1 AND go_= def.go_id=3Dgo.go_id AND go.seq_id=3Dest.unigene AND est.clone=3Dclone.na= me GROUP BY word"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); +@@ -473,27 +473,27 @@ +=20 + my $db=3Dread_config($config,'db_path',''); #database in the form dbi= :$dbi_driver:$db_name:$host + my $dbh=3Dopen_db($db) or ( +- print localtime().": There was a problem opening the database $db: $D= BI::errstr\n" and ++ print localtime().": There was a problem opening the database $db\n" = and + return 0 + ); #we open the database + my $st=3D"CREATE TEMPORARY TABLE super_count (INDEX(type)) SELECT supe= runigene,count(*)>1 AS type FROM superunigene GROUP BY superunigene"; + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); + =09 + $st=3D"INSERT INTO superunigene_view (type,num_superunigenes) SELECT t= ype,count(*) AS num_superunigenes FROM super_count GROUP BY type"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); +@@ -510,17 +510,17 @@ +=20 + my $db=3Dread_config($config,'db_path',''); #database in the form dbi= :$dbi_driver:$db_name:$host + my $dbh=3Dopen_db($db) or ( +- print localtime().": There was a problem opening the database $db: $D= BI::errstr\n" and ++ print localtime().": There was a problem opening the database $db\n" = and + return 0 + ); #we open the database + =09 + my $st=3D"INSERT INTO unigene_view (type,num_unigenes) SELECT object_t= ype,count(*) AS num_unigenes FROM sequence WHERE object_type=3D'contig' O= R object_type=3D'singleton' GROUP BY object_type"; + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); +@@ -539,7 +539,7 @@ + clean_tables($config,@table) or return 0; + my $db=3Dread_config($config,'db_path',''); #database in the form dbi= :$dbi_driver:$db_name:$host + my $dbh=3Dopen_db($db) or ( +- print localtime().": There was a problem opening the database $db: $D= BI::errstr\n" and ++ print localtime().": There was a problem opening the database $db\n" = and + return 0 + ); #we open the database + =09 +@@ -547,11 +547,11 @@ + #clones per library + my $st=3D"SELECT clone.library,COUNT(distinct clone.name) AS num_clone= s FROM clone GROUP BY clone.library"; + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + my %clones; +@@ -563,11 +563,11 @@ + #raw_est per library + $st=3D"SELECT clone.library,COUNT(*) AS num_raw_est FROM est,clone WHE= RE est.clone=3Dclone.name AND raw_seq IS NOT NULL GROUP BY clone.library"= ; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + my %raw_est; +@@ -579,11 +579,11 @@ + #clean_est per library + $st=3D'SELECT clone.library,COUNT(*) AS num_clean_est,AVG(sequence.len= gth) AS mean_length,STD(sequence.length) AS std_dev FROM est,sequence,clo= ne WHERE est.processed_seq=3Dsequence.name AND est.clone=3Dclone.name GRO= UP BY clone.library;'; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + my %clean_est; +@@ -599,11 +599,11 @@ + #singletons per library + $st=3D"SELECT clone.library,COUNT(distinct sequence.name) AS num_singl= etons FROM clone,sequence,est WHERE sequence.name=3Dest.unigene AND est.c= lone=3Dclone.name AND sequence.object_type=3D'singleton' GROUP BY clone.l= ibrary"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + my %singletons; +@@ -615,11 +615,11 @@ + #contigs per library + $st=3D"SELECT clone.library,COUNT(distinct sequence.name) AS num_conti= gs FROM clone,sequence,est WHERE sequence.name=3Dest.unigene AND est.clon= e=3Dclone.name AND sequence.object_type=3D'contig' GROUP BY clone.library= "; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + my %contigs; +@@ -631,11 +631,11 @@ + #unigenes per library + $st=3D"SELECT clone.library,COUNT(distinct unigene) AS num_unigenes FR= OM est,clone WHERE est.clone=3Dclone.name GROUP BY clone.library"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + my %unigenes; +@@ -647,11 +647,11 @@ + #full length per library + $st=3D"SELECT clone.library,COUNT(distinct sequence.name) AS num_full_= len FROM clone,sequence,est WHERE sequence.name=3Dest.unigene AND est.clo= ne=3Dclone.name AND sequence.full_length IS NOT NULL GROUP BY clone.libra= ry"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + my %full_len; +@@ -663,21 +663,21 @@ + #spec unigenes length per library + $st=3D"CREATE TEMPORARY TABLE uni_library_count (PRIMARY KEY(name), IN= DEX (num_lib))SELECT sequence.name, COUNT(DISTINCT clone.library) AS num_= lib, clone.library AS lib_concat FROM sequence,est,clone WHERE sequence.= name=3Dest.unigene AND est.clone=3Dclone.name GROUP BY sequence.name"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); + $st=3D"SELECT lib_concat as library,COUNT(*) AS num_unigenes_ex FROM u= ni_library_count WHERE num_lib=3D1 GROUP BY lib_concat"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + my %spec_unigenes; +@@ -689,21 +689,21 @@ + #spec contigs per library + $st=3D"CREATE TEMPORARY TABLE contig_library_count (PRIMARY KEY(name),= INDEX (num_lib))SELECT sequence.name, COUNT(DISTINCT clone.library) AS n= um_lib, clone.library AS lib_concat FROM sequence,est,clone WHERE sequenc= e.name=3Dest.unigene AND est.clone=3Dclone.name AND sequence.object_type=3D= 'contig' GROUP BY sequence.name"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); + $st=3D"SELECT lib_concat as library,COUNT(*) AS num_contigs_ex FROM co= ntig_library_count WHERE num_lib=3D1 GROUP BY lib_concat"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + my %spec_contigs; +@@ -715,21 +715,21 @@ + #spec singletons per library + $st=3D"CREATE TEMPORARY TABLE singleton_library_count (PRIMARY KEY(nam= e), INDEX (num_lib))SELECT sequence.name, COUNT(DISTINCT clone.library) A= S num_lib, clone.library AS lib_concat FROM sequence,est,clone WHERE sequ= ence.name=3Dest.unigene AND est.clone=3Dclone.name AND sequence.object_ty= pe=3D'singleton' GROUP BY sequence.name"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + close_st($sth); + $st=3D"SELECT lib_concat as library,COUNT(*) AS num_singletons_ex FROM= singleton_library_count WHERE num_lib=3D1 GROUP BY lib_concat"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st"= and + return 0 + ); + my %spec_singletons; +@@ -742,7 +742,7 @@ + #now we have all the data and we should store it in the view + $st=3D"INSERT INTO library_view (library, num_clones, num_raw_est, num= _clean_est, num_singletons, num_contigs, num_unigenes, num_full_len, num_= spec_singletons, num_spec_contigs, num_spec_unigenes,avg_est_len,std_est_= len) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)"; + $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": There was a problem preparing the statement $st:= $DBI::errstr\n" and ++ print localtime().": There was a problem preparing the statement $st"= and + return 0 + ); + foreach my $lib (keys(%libraries)){ +@@ -760,7 +760,7 @@ + $sth->bind_param(12,$avg_est_len{$lib}); + $sth->bind_param(13,$std_est_len{$lib}); + execute_st($sth) or ( +- print localtime().": There was a problem executing the statement $st= : $DBI::errstr\n" and ++ print localtime().": There was a problem executing the statement $st= " and + return 0 + ); + } +@@ -776,12 +776,12 @@ + my $config=3Dshift; + my $dir =3D $$config{'chromat_dir'}; + opendir DIR,$dir or ( +- print localtime().": It was not possible to open the chromat director= y $dir: $!\n" and ++ print localtime().": It was not possible to open the chromat director= y: $dir\n" and + return 0 + ); + my @libraries =3D grep {/^[^\.]/} readdir(DIR); + if (!$libraries[0]){ +- print localtime().": No libraries found in the libraries directory $d= ir: $!\n"; ++ print localtime().": No libraries found in the libraries directory: $= dir\n"; + return 0; + } + close DIR; +@@ -791,18 +791,18 @@ + my $db=3Dread_config($config,'db_path',''); + my $dbh=3Dopen_db($db); + unless ($dbh) { +- print localtime().": Database $dbh is not reachable: $DBI::errstr\n"; ++ print localtime().": Database $dbh is not reachable\n"; + return 0; + } + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": Unable to prepare statement: $st: $DBI::errstr\n= " and ++ print localtime().": Unable to prepare statement: $st\n" and + return 0 + ); + foreach my $lib (@libraries){ + $sth->bind_param(1,$lib); + $sth->execute() or ( + print localtime().": There was a problem executing the statement:\n"= and +- print localtime().": $st: : $DBI::errstr\n" and ++ print localtime().": $st:\n" and + print localtime().": with the library $lib:\n" and + return 0 + ); +@@ -818,7 +818,7 @@ + my $db=3Dread_config($config,'db_path',''); + my $dbh; my $sth; #database and statements handlers + $dbh=3Dopen_db($db) or ( +- print localtime().": There was a problem opening the database $db: $D= BI::errstr\n" and ++ print localtime().": There was a problem opening the database $db\n" = and + return 0 + ); #we open the database + my $st=3D"SELECT UNCOMPRESS(COMPRESS('holacaracola'))=3D'holacaracola'= "; +@@ -841,7 +841,7 @@ + if ($version){return $version} + my $dbh; my $sth; #database and statements handlers + $dbh=3Dopen_db($db) or ( +- print localtime().": There was a problem opening the database $db: $D= BI::errstr\n" and ++ print localtime().": There was a problem opening the database $db\n" = and + return 0 + ); #we open the database + $version=3D$dbh->get_info(18); +@@ -924,11 +924,11 @@ + if (!$only_clean){ #nothing more to do because we just should clean=20 + if (-r $file){ + put_csv_into_db($config,$file,$table) or ( +- print localtime().": There was a problem populating the table $tab= le with file $file\n" and ++ print localtime().": There was a problem populating the table $tab= le with file $file: $!\n" and + return 0 + ); + }else{ +- print localtime().": WARNING no database file found, it should be $= file\n"; ++ print localtime().": WARNING no database file found, it should be $= file: $!\n"; + return 0; + } + } +@@ -945,11 +945,11 @@ + if (!$only_clean){ #nothing more to do because we just should clean=20 + if (-r $file){ + put_csv_into_db($config,$file,$table) or ( +- print localtime().": There was a problem populating the table $tab= le with file $file\n" and ++ print localtime().": There was a problem populating the table $tab= le with file $file: $!\n" and + return 0 + ); + }else{ +- print localtime().": WARNING no working on file found, it should be= $file\n"; ++ print localtime().": WARNING no working_on_dat file found, it shoul= d be $file: $!\n"; + return 0; + } + } +@@ -966,11 +966,11 @@ + if (!$only_clean){ #nothing more to do because we just should clean=20 + if (-r $file){ + put_csv_into_db($config,$file,$table) or ( +- print localtime().": There was a problem populating the table $tab= le with file $file\n" and ++ print localtime().": There was a problem populating the table $tab= le with file $file: $!\n" and + return 0 + ); + }else{ +- print localtime().": WARNING no researcher file found, it should be= $file\n"; ++ print localtime().": WARNING no researcher file found, it should be= $file: $!\n"; + return 0; + } + } +@@ -987,11 +987,11 @@ + if (!$only_clean){ #nothing more to do because we just should clean=20 + if (-r $file){ + put_csv_into_db($config,$file,$table) or ( +- print localtime().": There was a problem populating the table $tab= le with file $file\n" and ++ print localtime().": There was a problem populating the table $tab= le with file $file: $!\n" and + return 0 + ); + }else{ +- print localtime().": WARNING no marker-EST file found, it should be= $file\n"; ++ print localtime().": WARNING no marker-EST file found, it should be= $file: $!\n"; + return 0; + } + } +@@ -1026,11 +1026,11 @@ + my $table =3D 'microarray_extract'; + if (-r $file){ + put_csv_into_db($config,$file,$table) or ( +- print localtime().": There was a problem populating the table $table= with file $file\n" and ++ print localtime().": There was a problem populating the table $table= with file $file: $!\n" and + return 0 + ); + }else{ +- print localtime().": WARNING no extracts file found, it should be $fi= le\n"; ++ print localtime().": WARNING no extracts file found, it should be $fi= le: $!\n"; + return 0; + } + #loading extract mixes +@@ -1038,11 +1038,11 @@ + my $table =3D 'microarray_extract_mix'; + if (-r $file){ + put_csv_into_db($config,$file,$table) or ( +- print localtime().": There was a problem populating the table $table= with file $file\n" and ++ print localtime().": There was a problem populating the table $table= with file $file: $!\n" and + return 0 + ); + }else{ +- print localtime().": WARNING no extract mixes file found, it should b= e $file\n"; ++ print localtime().": WARNING no extract mixes file found, it should b= e $file: $!\n"; + return 0; + } + #loading the hybridizations +@@ -1050,18 +1050,18 @@ + my $table =3D 'microarray_hybridization'; + if (-r $file){ + put_csv_into_db($config,$file,$table) or ( +- print localtime().": There was a problem populating the table $table= with file $file\n" and ++ print localtime().": There was a problem populating the table $table= with file $file: $!\n" and + return 0 + ); + }else{ +- print localtime().": WARNING no hybridizations file found, it should = be $file\n"; ++ print localtime().": WARNING no hybridizations file found, it should = be $file: $!\n"; + return 0; + } + my $file =3D read_config($config,'microarray_normalized_dat',''); + my $table =3D 'microarray_normalized_expression'; + if (-r $file){ + open IN,"<$file" or ( +- print localtime().": Imposible to open file: $file\n" and ++ print localtime().": Imposible to open file: $file: $!\n" and + return 0 + ); + =09 +@@ -1099,15 +1099,15 @@ + $sth->bind_param(4,$cv); + $i_hyb++; + $sth->execute or ( +- print localtime().": Unable to execute stament: $st: $DBI::errstr\= n" and +- print localtime().": With line: $line\n" and ++ print localtime().": Unable to execute stament: $st\n" and ++ print localtime().": With line: $line: $DBI::errstr\n" and + return 0 + ); + } + } + close IN; + }else{ +- print localtime().": WARNING no normalized expression file found, it = should be $file\n"; ++ print localtime().": WARNING no normalized expression file found, it = should be $file: $!\n"; + return 0; + } +=20 +@@ -1179,7 +1179,7 @@ + #print $contents{$table},"\n"; + create_table($db,$table,$contents{$table}) or $ok=3D0; + unless ($ok){ +- print localtime().": Annotation table: $table from $db can't be cre= ated\n"; ++ print localtime().": Annotation table: $table from $db can't be cre= ated: $DBI::errstr\n"; + } + } + } +@@ -1200,7 +1200,7 @@ + #if the table exist is removed + if (check_table($db,$table)) {drop_table($db,$table) or $ok=3D= 0} + unless ($ok){ +- print localtime().": Annotation table: $table from $db can't be dro= pped\n"; ++ print localtime().": Annotation table: $table from $db can't be dro= pped: $DBI::errstr\n"; + } + } + } +@@ -1220,7 +1220,7 @@ + my $db=3Dread_config($config,'db_path',''); + =09 + open IN,"<$file" or ( +- print localtime().": Imposible to open file $file: $!\n" and ++ print localtime().": Imposible to open file: $file: $!\n" and + return 0 + ); + =09 +@@ -1235,10 +1235,13 @@ + return 0; + } + my $sth=3Dprepare_st($dbh,$st) or ( +- print localtime().": Unable to prepare statement $st: $DBI::errstr\n"= and ++ print localtime().": Unable to prepare statement: $st: $DBI::errstr\n= " and + return 0 + ); + while ($line =3D ){ ++ if ($line =3D~ /^#/) { ++ next; ++ } + chomp ($line); + $line =3D~ s/"//g; + my @fields=3Dsplit (',',$line); +@@ -1248,8 +1251,8 @@ + $i++; + } + $sth->execute or ( +- print localtime().": Unable to execute stament $st: $DBI::errstr\n" = and +- print localtime().": With line: $line\n" and ++ print localtime().": Unable to execute stament: $st\n" and ++ print localtime().": With line: $line: $DBI::errstr\n" and + return 0 + ); + } +@@ -1312,7 +1315,7 @@ + #here we read all the db structure, the table fields and contigs + my %db_structure=3Dread_db_structure ($db_structure_file,$config); + unless (%db_structure) { +- print localtime().": There was a problem reading the database definit= ion from file $db_structure_file: $!\n"; ++ print localtime().": There was a problem reading the database definit= ion from file: $db_structure_file"; + return 0; + } + #the table is regenerated +@@ -1351,12 +1354,14 @@ + #Here we check that the database is reachable and has all the necesar= y tables + $ok=3Dcheck_db_structure($db_path,%db_structure); + } +- #print_db_structure(%db_structure); ++ if (!$ok) { ++ print_db_structure(%db_structure); ++ } + return $ok; + } +=20 + #Here we check that the database is reachable and has all the necesary = tables +-#this is not enough becouse fields should be checked too, so TODO=20 ++#this is not enough because fields should be checked too, so TODO=20 + #(although not a very important thing anyway) + sub check_db_structure($\%) { + my $db=3Dshift; +@@ -1375,6 +1380,8 @@ + } + } + } ++ } else { ++ $ok=3D0; + } + if ($ok) { + print localtime().": Database structure seems ok\n"; +@@ -1422,7 +1429,7 @@ + print localtime().": Connection to the database server $db_path_no_na= me has failed: $DBI::errstr\n"; + return 0; + } +- #Now we check if db exists and if does is dropped ++ #Now we check if db exists and if it does it is dropped + if(db_ok($db_path)){ + #database exits, we should remove it + if(drop_db($db_path,$db_name)) { +@@ -1458,13 +1465,23 @@ + sub populate_db ($\%) { + my $db=3Dshift; + my $tables=3Dshift; ++ my %t =3D %$tables; + my $ok=3D1; +=20 ++ print "populate_db called with db=3D$db, tables=3D$tables\n"; ++ #foreach my $table(keys(%t)) { ++ # print "table=3D$table, $t{$table}\n"; ++ #} ++ + my $table; + foreach $table(keys %$tables) { + if ($ok) { +- $ok=3Dcreate_table($db,$table,${%{$tables}}{$table}); ++ $ok=3Dcreate_table($db,$table,$t{$table}); # avoid Can't use string = ("38/64") as a HASH ref while "strict refs" in use at /opt/est2uni/pipe_d= b.pm line 1477. ++ if ($ok) { + print localtime().": Table $table created\n"; ++ } else { ++ print localtime().": Table $table could not be created under dsn=3D= $db: $DBI::errstr\n"; ++ } + } + } + return $ok; +@@ -1476,7 +1493,7 @@ + my $db=3Dshift; + my $table_name=3Dshift; + my $table_content=3Dshift; #table content in sql format +- #first we check that the database is avaliable ++ #first we check that the database is available + my $ok=3D1; + unless (db_ok($db)) { + print localtime().": Something went wrong checking database: $db\n"; +@@ -1488,9 +1505,13 @@ + my $st=3D"CREATE TABLE $table_name ($table_content);"; + if($ok) { + $sth=3Dprepare_st($dbh,$st) or $ok=3D0; ++ } else { ++ print localtime().": There was a problem preparing a statement: $DBI:= :errstr\n"; + } + if ($ok) { + execute_st($sth) or $ok=3D0; ++ } else { ++ print localtime().": There was a problem executing a statement: $DBI:= :errstr\n"; + } + #print $table; + $sth->finish(); +@@ -1533,17 +1554,13 @@ + #needs a db handler + sub close_db ($) { + my $dbh=3Dshift; +- if ($dbh){ +- $dbh->disconnect() or print localtime().": Cannot disconnect from dat= abase: $DBI::errstr\n"; +- } ++ if ($dbh){$dbh->disconnect();} + } +=20 + #needs a statement handler + sub close_st ($) { + my $sth=3Dshift; +- if ($sth){ +- $sth->finish() or print localtime().": Cannot finish execution over d= atabase: $DBI::errstr\n"; +- } ++ if ($sth){$sth->finish();} + } +=20 +=20 +@@ -1563,9 +1580,7 @@ + } + } + =09 +- if ($dbh){ +- $dbh->disconnect() or print localtime().": Cannot disconnect from dat= abase: $DBI::errstr\n"; +- } ++ if ($dbh){$dbh->disconnect();} + return $ok; + } +=20 +@@ -1581,9 +1596,7 @@ + else { + $ok=3D0; + } +- if ($dbh){ +- $dbh->disconnect() or print localtime().": Cannot disconnect from dat= abase: $DBI::errstr\n"; +- } ++ if ($dbh){$dbh->disconnect();} + return $ok; + } +=20 +@@ -1594,7 +1607,7 @@ + my $ok=3D1; + #is the database to remove ok? + unless (db_ok($db)) { +- print localtime().": Something went wrong checking database $db: $DBI= ::errstr\n"; ++ print localtime().": Something went wrong checking database: $db: $DB= I::errstr\n"; + $ok=3D0; + } + #we should open it +@@ -1619,7 +1632,7 @@ + } + } + if ($ok) {$sth->finish();} +- if ($dbh){$dbh->disconnect() or print localtime().": Cannot disconnect= from database: $DBI::errstr\n";} ++ if ($dbh){$dbh->disconnect();} + return $ok; + } +=20 diff --git a/sci-biology/est2uni/files/tables.sql.patch b/sci-biology/est= 2uni/files/tables.sql.patch new file mode 100644 index 0000000..3a83de8 --- /dev/null +++ b/sci-biology/est2uni/files/tables.sql.patch @@ -0,0 +1,23 @@ +--- tables.sql.ori 2011-02-22 10:53:26.000000000 +0100 ++++ tables.sql 2011-02-22 16:15:11.000000000 +0100 +@@ -576,15 +576,15 @@ + long_name CHAR(100), + version CHAR(40), + local_blast_name CHAR(100), +- blast_program CHAR(7), +- repository CHAR(100), +- web_site CHAR(100), +- kind CHAR(40), ++ blast_program ENUM('blastn', 'blastp', 'blastx', 'tblastn', 'tblastx')= , ++ repository CHAR(255), ++ web_site CHAR(255), ++ kind ENUM('dna','pep'), + go_annot_format CHAR(40), + link_pre CHAR(200), + link_post CHAR(200), + local_hmmer_name CHAR(40), +- rec_sim_type CHAR(40), ++ rec_sim_type ENUM('', 'orthologue', 'synonymous'), + rec_sim_evalue CHAR(40), + orthologues_arabi_hack CHAR(1), + local_go_assoc_file CHAR(200),