BIO-Perl Error when running the first program

337 views Asked by At

I tried to run bio perl using Eclipse.

The code I tried to execute is:

use Bio::Seq;
$seq_obj = BIO::Seq->new(-seq=> "atcgatgcatgcatgcatgc", -alphabet=> 'dna');
#print $seq_obj->seq;

And I got the following error:

Can't locate object method "new" via package "BIO::Seq" (perhaps you forgot to load "BIO::Seq"?) at C:/2ndSemester/BIO424-DevelopBioinformaticTools/PerlPrograms/BIOPerlExamples/TestBIOPerl1.pl line 3.

Anybody knows why this error occured?

1

There are 1 answers

1
mu is too short On BEST ANSWER

The class is called Bio::Seq, not BIO::Seq. Perl is case sensitive so you want to say:

$seq_obj = Bio::Seq->new(-seq=> "atcgatgcatgcatgcatgc", -alphabet=> 'dna');

Note the "Bio" rather than "BIO".