SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
NCBI Genbank and Reference Sequence rahbz Bioinformatics 3 06-22-2013 02:12 AM
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
Assembled sequence submission to Genbank? Melissa General 0 04-26-2011 12:54 AM

Reply
 
Thread Tools
Old 06-26-2013, 06:31 AM   #1
Shaq
Junior Member
 
Location: Sweden

Join Date: Jun 2013
Posts: 5
Default Sequence from Genbank file

Hi,
I used to usethis code to download sequence from genabnk ,now bioperl complains about sequence is empty, do yiu know if gen bank structure has been changed?
use Bio::SeqIO;
use Bio::Seq;
use Bio::DB::EUtilities;


@refSeqIDs=qw(NC_000915.1 NC_017379.1 NC_017371.1 NC_017354.1);
foreach my $refSeqIDs (@refSeqIDs){
my $factory = Bio::DB::EUtilities->new(-eutil => 'efetch',-db=> 'protein',- rettype => 'gb',
-email => 'x@y.com',-id=> $refSeqIDs);
my $rawfile = "$refSeqIDs.gbk";
$factory->get_Response(-file =>"$refSeqIDs.gbk");
my $seqio_object = Bio::SeqIO->new(-format=>"Genbank",-file =>"$refSeqIDs.gbk");
while ( my $seq_object=$seqio_object->next_seq){
$sequence=$seq_object->seq;
print ("$sequence\n");
}
}
Shaq is offline   Reply With Quote
Old 06-26-2013, 09:33 AM   #2
kmcarr
Senior Member
 
Location: USA, Midwest

Join Date: May 2008
Posts: 1,177
Default

Quote:
Originally Posted by Shaq View Post
Hi,
I used to usethis code to download sequence from genabnk ,now bioperl complains about sequence is empty, do yiu know if gen bank structure has been changed?
Code:
use Bio::SeqIO;
use Bio::Seq;
use Bio::DB::EUtilities;


    @refSeqIDs=qw(NC_000915.1 NC_017379.1 NC_017371.1 NC_017354.1);
    foreach my $refSeqIDs (@refSeqIDs){
        my $factory = Bio::DB::EUtilities->new(-eutil   => 'efetch',-db=> 'protein',-  rettype => 'gb',
                                           -email   => 'x@y.com',-id=> $refSeqIDs);
        my $rawfile = "$refSeqIDs.gbk";
        $factory->get_Response(-file =>"$refSeqIDs.gbk");
        my $seqio_object = Bio::SeqIO->new(-format=>"Genbank",-file =>"$refSeqIDs.gbk");
        while ( my $seq_object=$seqio_object->next_seq){
            $sequence=$seq_object->seq;
            print ("$sequence\n");
        }
    }
The RefSeq accessions you are supplying are for chromosomes (i.e. nucleotide sequences) but you are querying the protein database. Change:

Code:
-db => 'protein'

to 

-db => 'nuccore'
The 'gb' return type (rettype) will only return the header and feature portions of the genbank file, not the full record with sequences. Change:

Code:
-rettype => 'gb'

to

-rettype => 'gbwithparts'
kmcarr is offline   Reply With Quote
Old 06-26-2013, 11:39 PM   #3
Shaq
Junior Member
 
Location: Sweden

Join Date: Jun 2013
Posts: 5
Default

Yes , it indeed fixed the problem. Thanks
Shaq is offline   Reply With Quote
Reply

Tags
bioinfomatics, bioperl, genbank

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


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