Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Fields, Christopher J <cjfields <at> illinois.edu>
Subject: Re: Parsing multi-record genbank file
Newsgroups: gmane.comp.lang.perl.bio.general
Date: Friday 8th November 2013 02:00:18 UTC (over 3 years ago)
A lot of problems in this one; try:

use Bio::SeqIO;
use Bio::Seq;

my $seqio_in = Bio::SeqIO->new(-file => "ls_orchid.gbk" , '-format' =>
'genbank');
my $seqio_out = Bio::SeqIO->new(-file => '>sequence.fasta', -format =>
'genbank' );

while ( my $seq = $seqio_in->next_seq ) {
    $seqio_out->write_seq($seq);
}

chris

On Nov 7, 2013, at 3:23 PM, Robert Johnson  wrote:

> Hi,
> 
> I would be happy if someone could help me get the following code to
output
> the sequences (including the ids)  of all records in the input file (
> http://biopython.org/DIST/docs/tutorial/examples/ls_orchid.gbk):
> 
> use Bio::SeqIO;
> use Bio::Seq;
> use Bio::DB::GenBank;
> 
> $seq_obj = Bio::SeqIO->new(-file => "ls_orchid.gbk" , '-format' =>
> 'genbank');
> $seqio_obj2 = Bio::SeqIO->new(-file => '>sequence.fasta', -format =>
> 'genbank' );
> 
> while ( my $seq = $seq_obj->next_seq() ) {
> print "Sequence ",$seq->id ($seq_obj)"\n";
>  #print $seq_obj->seq,"\n";
> $seqio_obj2->write_seq($seq_obj);
> }
> 
> Thank you
> _______________________________________________
> Bioperl-l mailing list
> [email protected]
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
 
CD: 3ms