Skip to content

Commit

Permalink
Actually make sure that input is a valid file
Browse files Browse the repository at this point in the history
  • Loading branch information
fangly committed May 10, 2012
1 parent 3b3ba68 commit 92efff0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/taxa/bp_classify_hits_kingdom.pl
Expand Up @@ -102,10 +102,13 @@ =head2 AUTHOR
my $fh;
# this file came from ftp://ftp.ncbi.nih.gov/pub/taxonomy
# I'm interested in protein hits therefor _prot file.
if (not -f $gi2taxidfile) {
die "Error: File $gi2taxidfile does not exist\n";
}
if( $gi2taxidfile =~ /\.gz$/ ) {
open($fh, "$zcat $gi2taxidfile |" ) || die "$zcat $gi2taxidfile: $!";
} else {
open($fh, $gi2taxidfile ) || die $!;
open($fh, $gi2taxidfile ) || die "Error: could not read file $gi2taxidfile: $!";
}
my $i = 0;
my $sth = $dbh2->prepare("INSERT INTO gi2taxid (gi,taxid) VALUES (?,?)");
Expand Down

0 comments on commit 92efff0

Please sign in to comment.