This is a test version of Biostars. For the public version, visit https://www.biostars.org.
error while executing code for parsing genbank file

hello can anyone tell me what does this line mean? I am executing this script on Mac

use strict; use warnings; use feature 'say'; use Bio::GenBankParser;

my $file = shift; my $parser = Bio::GenBankParser->new( file => $file ); while ( my $seq = $parser->next_seq ) { my $feat = $seq->{'FEATURES'}; for my $f (@$feat) { my $tag = $f->{'feature'}{'locus_tag'}; my $prod = $f->{'feature'}{'product'}; if (defined $tag and defined $prod) { say join "\t", $tag, $prod; } } }

and I got an error like this: @INC (you may need to install the Bio::GenBankParser module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2/darwin-thread-multi-2level /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at script.pl line 4. BEGIN failed--compilation aborted at script.pl line 4.

can anyone tell me how can I parse genbank file if i want to get location product and locus_tag information. I am unable to execute this code.

ganbank file

Please format your code using 101010 button. People won't read a mess of code.

Didn't you see what it likes like after creating this post?

1 answer

you may need to install the Bio::GenBankParser module

(In addition you need to read the error message ;)

I have already install Bio::GenBankParser module, but while executing this code it is showing error.

Perl thinks otherwise, how did you install the module? EIther you used cpan or you are out of luck, so try:

cpan Bio::GenBankParser

possibly add a sudo if you need it.

Log in to answer this question.