--- 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 sequence ".$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->length 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 or 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=read_config($config,'assignment_tag',''); $command="echo $tag".$library.">> $temp_log"; chdir ($temp_dir); #we change the directory becouse lucy write some stuff 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 @@ # lucy log is moved to the results directory $command="cat $temp_log >> $log"; - system($command); + system($command) or die print localtime().": failed to append $temp_log contents to $log\n"; $command="rm $temp_log"; - system($command); + system($command) or die print localtime().": failed to delete $temp_log\n"; 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; } @@ -1490,7 +1490,7 @@ sub run_seqclean($$$$$$$$$$$$) { my $config=shift; - my $library=shift; # informational porpouse only + my $library=shift; # informational purpose only my $trimmed_fasta_file=shift; # name for the trimmed sequences file my $trimmed_qual_file=shift; # name for the trimmed quality file my $seqclean_report_file=shift; # report file with the masked area @@ -1518,7 +1518,13 @@ #The file with the vector (univec recommended) my $vec_file=read_config($config,'seqclean_vec_dat',''); unless (check_file($vec_file,"vector database")){return 0}; - + if (! -r $vec_file.".nin") { + print localtime().": Formatting database with formatdb -p F -i $vec_file\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=1; # control variable my $command; my $temp; @@ -1749,7 +1755,7 @@ sub seqclean_masking_assignments ($$$$$$) { my $config=shift; - print localtime().": Masking the sequences following seqclean's recomendations\n"; + print localtime().": Masking the sequences following seqclean's recommendations\n"; my @libraries=split(',',read_config($config,'libraries','')); # libraries names my $report=read_config($config,'seqclean_report',''); # base name for the report generated by seqclean, this is the file with the instruccions for masking the sequences my $in_seq=shift; # base name for the trimmed sequences file generated by lucy