I want to query uniprot/KB by accesion number to retrieve species names only.I have write this script:
#!/usr/bin/perl
use strict;
use warnings;
use Bio::Seq;
use Bio::DB::SwissProt;
use SWISS::Entry;
print "Please enter the accession number ... ";
$_ = <STDIN>;
my $db_obj = Bio::DB::SwissProt->new;
my $seq_obj = $db_obj->get_Seq_by_acc($_);
if( defined $seq->species ) {
print "Sequence coming from ",$species->binomial," [",$species->common_name,"]\n";
}
exit 0;
but it throws me this error
Name of the protein: Bio::Species=HASH(0x3bb03d8)
Can you help me understand what doesn't work ? Thanks you.
I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:
Where is the error message ?
This doesn't look like an error message but like a variable that wasn't properly dereferenced.