1

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);
}

I would like to see an output consisting of purely sequences (preferably with headers) as follows:

seq1:
ATTCGCTGCATGACAT..........
Seq2:
ACTGCGATGGATGGAT..

Thank you

Sharif Mamun
  • 3,508
  • 5
  • 32
  • 51
user27976
  • 903
  • 3
  • 17
  • 28
  • 1
    Crossposted and answered at [BioStars.org](http://www.biostars.org/p/85992/#86001). – Kenosis Nov 08 '13 at 22:52
  • Similar: http://stackoverflow.com/questions/22073986/how-do-i-get-gene-features-in-fasta-nucleotide-format-from-ncbi-using-perl/22101281#22101281 – knb Feb 28 '14 at 22:05

0 Answers0