Skip to content

Commit

Permalink
update sra download error check and display
Browse files Browse the repository at this point in the history
  • Loading branch information
chienchi committed Dec 6, 2016
1 parent 3e799f2 commit d5f501b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 5 additions & 6 deletions runPipeline
Original file line number Diff line number Diff line change
Expand Up @@ -727,17 +727,16 @@ sub read_SRAD_Download_dir
opendir(my $sra_dir_fh,$dir) or die "Cannot read $dir\n";
my @files = sort grep {/fastq/} readdir($sra_dir_fh);
closedir $sra_dir_fh;
if (!@files && !@pairedReadsFile && !@unpairedReadsFile)
if (`grep -i -a "Error" $dir/log.txt`){
&lprint("The SRA download failed.\n");
exit;
}elsif (!@files && !@pairedReadsFile && !@unpairedReadsFile)
{
&lprint("No fastq file from the SRA download. try again\n");
&Download_SRA();
return;
#die "No input\n";
}
if (`grep -i -a "Error" $dir/log.txt`){
`rm -rf $dir/*fastq*`;
&lprint("The SRA download failed. try again\n");
&Download_SRA();
}
my %pair;
if (scalar(@files)==1)
{
Expand Down
1 change: 1 addition & 0 deletions scripts/munger/outputMunger_w_temp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ sub pull_blast {
sub pull_sra_download {
my $err;
$err = `grep Failed $out_dir/SRA_Download/log.txt` if (-e "$out_dir/SRA_Download/log.txt");
$err .= `grep "ERROR" $out_dir/SRA_Download/log.txt` if (-e "$out_dir/SRA_Download/log.txt");
if ($err){
$err =~ s/(http\S+)/<a href=\"$1\" target=\"_blank\">$1<\/a>/;
$vars->{SRADERR} = $err;
Expand Down

0 comments on commit d5f501b

Please sign in to comment.