fix bug Can't exec /bin/sh: Argument list too long #247
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Andrew,
I got the following error while running roary:
Can't exec "/bin/sh": Argument list too long at /tools/roary/lib/Bio/Roary/ParallelAllAgainstAllBlast.pm line 92, line 647671.
awk: fatal: cannot open file `_blast_results' for reading (No such file or directory)
Looking at that line (the bold one in the sub below):
sub combine_blast_results {
my ( $self, $output_files ) = @;
for my $output_file ( @{$output_files} ) {
Bio::Roary::Exceptions::FileNotFound->throw( error => "Cant find blast results: " . $output_file )
unless ( -e $output_file );
}
my $output_files_param = join( ' ', @{$output_files} );
system( "cat $output_files_param > " . $self->blast_results_file_name );
return 1;
}
The error comes from the too long list in the shell while calling "cat".
So, I changed the sub above as below and it worked:
sub combine_blast_results {
my ( $self, $output_files ) = @;
for my $output_file ( @{$output_files} ) {
Bio::Roary::Exceptions::FileNotFound->throw( error => "Cant find blast results: " . $output_file )
unless ( -e $output_file );
}
if ( -e $self->blast_results_file_name )
{
system( "rm " . $self->blast_results_file_name );
}
system( "touch " . $self->blast_results_file_name );
for my $output_file ( @{$output_files} ) {
system( "cat $output_file >> " . $self->blast_results_file_name );
}
return 1;
}
You may have a better fix then mine and it would be great if that fix can be integrated in the next version of Roary.
Thanks,
Tin