#!usr/bin/perl -w
use Bio::DB::GenBank;
use Bio::Restriction::EnzymeCollection;
use Bio::Restriction::Analysis;
my $gb=new Bio::DB::GenBank();
my $seq=$gb->get_Seq_by_acc('AF303112');
print $seq->seq,"\n";
my $all_collection=Bio::Restriction::EnzymeCollection;
my $my_enzyme=$all_collection->get_enzyme('EcoRI');
my $analysis=Bio::Restriction::Analysis->new(-seq=>$seq);
@fragment=$analysis->fragments($my_enzyme);
print "@fragment\n";
my $pro_obj=$seq->translate(-complete=>1);
print $pro_obj->seq;
I want to get a sequence by accession number, and then find if there is a EcoRI enzyme site in this sequence and finally translate this sequence into protein. But the output is only the Nuclear Acid sequence, what's wrong, can someone tell me? Thanks!
(1) I've indented your lines of code with 4 spaces: note how this improves readability. (2) I think you wanted to post this under category "question", not "forum"; changed that too.
Thank you very much,
Changed the title too. "Bioperl" is not very informative. Nor were "beginner's" or "task" as tags. Good titles and tags make your question easier to find and answer.