SEQanswers

Go Back   SEQanswers > General



Similar Threads
Thread Thread Starter Forum Replies Last Post
does bioperl::seqIO:: Kojo Bioinformatics 2 10-08-2012 04:49 AM
Simulations in Bioperl? A_Morozov Bioinformatics 0 04-11-2012 11:10 PM
perl bioperl version m_elena_bioinfo Bioinformatics 1 02-21-2011 10:37 AM
bioperl for samtools m_elena_bioinfo Bioinformatics 4 09-07-2010 05:39 AM
Bioperl jsun529 Bioinformatics 7 09-01-2009 07:27 AM

Reply
 
Thread Tools
Old 11-06-2012, 12:37 PM   #1
cindylanzao
Member
 
Location: chicago

Join Date: Nov 2012
Posts: 19
Default Bioperl beginner's program

!usr/bin/perl -w

use Bio:B::GenBank;
use Bio::Restriction::EnzymeCollection;
use Bio::Restriction::Analysis;
my $gb=new Bio:B::GenBank();
my $seq=$gb->getSeqbyacc('AF303112');
print $seq->seq,"\n";
my $allcollection=Bio::Restriction::EnzymeCollection;
my $myenzyme=$allcollection->getenzyme('EcoRI');
my $analysis=Bio::Restriction::Analysis->new(-seq=>$seq); @fragment=$analysis->fragments($myenzyme);
print "@fragment\n";
my $proobj=$seq->translate(-complete=>1);
print $proobj->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!
cindylanzao is offline   Reply With Quote
Old 11-06-2012, 05:39 PM   #2
krobison
Senior Member
 
Location: Boston area

Join Date: Nov 2007
Posts: 747
Default

Note: if you use the advanced editor, you can wrap your code in tags which will make it much easier to read (I've added use strict, which you should use strictly!). My tweaks to your code are in bold.

Code:
!usr/bin/perl -w
use strict;
use Bio:B::GenBank; 
use Bio::Restriction::EnzymeCollection; 
use Bio::Restriction::Analysis; 
my $gb=new Bio:B::GenBank(); 
my $seq=$gb->getSeqbyacc('AF303112'); 
print $seq->seq,"\n"; 
my $allcollection=Bio::Restriction::EnzymeCollection; 
my $myenzyme=$allcollection->getenzyme('EcoRI'); 
my $analysis=Bio::Restriction::Analysis->new(-seq=>$seq); 
my @fragment=$analysis->fragments($myenzyme); 
print "@fragment\n"; 
my $proobj=$seq->translate(-complete=>1); 
print $proobj->seq;
My next suggestion is that your learn the Perl debugger. If you use EMACS, you can run the debugger very nicely in the editor & easily set breakpoints.

I'm afraid I don't see an obvious problem, but if you look at what is contained in @fragment it might give a hint. Are you sure this sequence has an EcoRI site?
krobison is offline   Reply With Quote
Reply

Tags
bioperl beginner program

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 12:54 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO