From 5d27c199664378c993cd36ac87ac2ed98eb0f44c Mon Sep 17 00:00:00 2001 From: eead-csic-compbio Date: Fri, 9 Jun 2017 10:20:21 +0200 Subject: [PATCH] fixed bug in get_homologues.pl -X which produced zero clusters when new sequences files were added to previous results --- CHANGES.txt | 1 + get_homologues.pl | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index f621616..dc8e37b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -194,3 +194,4 @@ 16052017: added message to make_nr_pangenome_matrix.pl to warn users that BLAST files must be removed with different refs 17052017: added option -r to annotate_cluster.pl so that external sequences can be used to drive cluster alignment 30052017: updated lib/ForkManager.pm to v1.19 (http://search.cpan.org/perldoc?Parallel%3A%3AForkManager) +09062017: fixed bug in get_homologues.pl -X which produced zero clusters when new sequences files were added to previous results diff --git a/get_homologues.pl b/get_homologues.pl index 72d7894..d5e267c 100755 --- a/get_homologues.pl +++ b/get_homologues.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl -# 2016 Bruno Contreras-Moreira (1) and Pablo Vinuesa (2): +# 2017 Bruno Contreras-Moreira (1) and Pablo Vinuesa (2): # 1: http://www.eead.csic.es/compbio (Estacion Experimental Aula Dei/CSIC/Fundacion ARAID, Spain) # 2: http://www.ccg.unam.mx/~vinuesa (Center for Genomic Sciences, UNAM, Mexico) @@ -1295,14 +1295,14 @@ # now concat the other accessions $blastDBfile = $newDIR ."/". $new_infile .".others"; - if(!-s $blastDBfile.".dmnd") + if(!-s $blastDBfile.".dmnd" || $current_files ne $previous_files) { open(ALLOTHERS,">",$blastDBfile) || die "# EXIT: cannot create $blastDBfile\n"; foreach my $other_infile (@newfiles) { next if($other_infile eq $new_infile); $infile = (split(/\.$FASTAEXTENSION/,$other_infile))[0]; - next if($include_file && !$included_input_files{$infile}); + next if($include_file && !$included_input_files{$infile}); open(OTHER,"$newDIR/$other_infile") || die "# EXIT: cannot read $newDIR/$other_infile\n"; @@ -1408,7 +1408,7 @@ $clusteroutfile = $newDIR ."/_". $new_infile ."_others.queue"; push(@to_be_deleted,$clusteroutfile); - if(-s $blastout) # check previous runs + if(-s $blastout && $current_files eq $previous_files) # check previous runs { if(!-s $blast_file){ push(@tmp_blast_output_files,$blastout); } next;