SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
parsing the gff file Shishir Bioinformatics 2 09-06-2013 05:03 AM
Sequence from Genbank file Shaq Bioinformatics 2 06-26-2013 11:39 PM
Genbank, Leishmania donovani gtf file prasprag Bioinformatics 0 06-20-2013 07:09 AM
splitting big genbank file joscarhuguet Bioinformatics 9 05-20-2013 06:39 AM
merging multigenbank file of contigs in one genbank file-input to Artemis J12 Bioinformatics 2 05-10-2013 11:29 AM

Reply
 
Thread Tools
Old 11-08-2013, 12:56 PM   #1
Rob2012
Junior Member
 
Location: Montana

Join Date: Jan 2013
Posts: 6
Default Parsing a GenBank file

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/tutor...s_orchid.gbk):

HTML Code:
 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:
HTML Code:
seq1:
    ATTCGCTGCATGACAT..........
    Seq2:
    ACTGCGATGGATGGAT..

Thank you
Rob2012 is offline   Reply With Quote
Old 11-08-2013, 01:36 PM   #2
rhinoceros
Senior Member
 
Location: sub-surface moon base

Join Date: Apr 2013
Posts: 372
Default

You could try biopieces read_genbank
__________________
savetherhino.org
rhinoceros is offline   Reply With Quote
Old 11-08-2013, 02:17 PM   #3
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

For those getting here later via google, the solution was posted on biostars.
dpryan is offline   Reply With Quote
Old 11-12-2013, 12:49 PM   #4
Rob2012
Junior Member
 
Location: Montana

Join Date: Jan 2013
Posts: 6
Default

Thanks Rhinoceros.
Rob2012 is offline   Reply With Quote
Reply

Tags
bioperl, biopython, genbank files, perl, python

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 08:30 PM.


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