Skip to content

Commit

Permalink
Added a check for all input files being devoid of sequence.
Browse files Browse the repository at this point in the history
  • Loading branch information
hepcat72 committed Aug 13, 2015
1 parent cab80e8 commit 67b33d7
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/mergeSeqs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 13,7 @@
#Copyright 2014

#These variables (in main) are used by getVersion() and usage()
my $software_version_number = '2.16';
my $software_version_number = '2.17';
my $created_on_date = '3/26/2014';

##
Expand Down Expand Up @@ -455,6 455,8 @@
my $abund_parse_errs = {};
my $diff_sizes = 0;
my $size_error_mode = ($trim_size == 0 ? 1 : 0);
my $got_something = 0;
my $got_anything = 0;

#foreach my $input_file_set (@$input_files)
foreach my $set_num (0..$#$input_file_sets)
Expand Down Expand Up @@ -588,6 590,8 @@
my($def,$seq) = @$rec;
$seq = uc($seq);

$got_anything = 1;

my $id = '';
if($def =~ /\s*[\@\>]\s*(\S )/)
{
Expand Down Expand Up @@ -687,6 691,8 @@
}
}

$got_something = 1;

#Warn about possibly erroneous duplicate records if they have the same
#ID, the sequence exists, and the abundance of one of the records is
#greater than 1
Expand Down Expand Up @@ -788,6 794,24 @@
quit(8);
}

unless($got_something)
{
if($got_anything)
{
error("No viable sequences were found in any of the input files. ",
"Please check to make sure your trim length (-b) is not too ",
"long and that your deflines are parseable.");
quit(9);
}
else
{
error("No viable sequences were found in any of the input files. ",
"Please check to make sure your file paths are correct and ",
"that your input files have sequences in them.");
quit(10);
}
}

if($isglobal)
{
foreach my $current_outfile (keys(%$abundance_hash))
Expand Down

0 comments on commit 67b33d7

Please sign in to comment.