X-Git-Url: https://git.donarmstrong.com/?p=function2gene.git;a=blobdiff_plain;f=bin%2Ffunction2gene;fp=bin%2Ffunction2gene;h=de4915bc4f95ecbdd9c564ffb7de88938658d4c0;hp=f3bd3ddfd7364a89afac2c4d391e43b3787e8b8d;hb=af4fd770f221db1cec02393df378e079c0b9a8fc;hpb=6d24067f20698257dc1103d5c21e8a7f6a32b97b diff --git a/bin/function2gene b/bin/function2gene index f3bd3dd..de4915b 100755 --- a/bin/function2gene +++ b/bin/function2gene @@ -339,13 +339,18 @@ if ($actions{combine}) { } keys %{$state{done_keywords}{parse}}; # create temporary file to store keyword weights - - write_command_to_file('combined_results.txt', - "$base_dir/combine_results", - '--keywords', - - @parsed_results, - ); + my $file = IO::File->new('combined_keywords.txt','w') or + die "Unable to open combined_keywords.txt for writing: $!"; + for my $keyword (keys %{$state{keyword_weight}}) { + print {$file} "$keyword\t$state{keyword_weight}{$keyword}\n"; + } + system("$base_dir/combine_results", + '--keywords','combined_keywords.txt', + '--results','combined_results.txt', + '--results-table','combined_results_table.txt', + @parsed_results, + ) == 0 + or die "combine_results failed with ".($?>>8); for my $result (@parsed_results) { $result =~ s/^parsed_results_//; $result =~ s/\.txt$//; @@ -353,10 +358,6 @@ if ($actions{combine}) { $state{done_keywords}{combined}{$db}{$keyword} = 1; } save_state(\%state); - write_command_to_file('combined_results_table.txt', - "$base_dir/results_to_table", - 'combined_results.txt', - ); ADVISE("Finished; results in $options{results}/combined_results.txt"); } else {