[Bioperl-l] different interpretion of get_seq_by_id by DB::GenBank and DB:Entrez::Gene

Hermann Norpois hnorpois at googlemail.com
Mon Apr 30 12:45:50 EDT 2012


I am a confused by the different interpretation of get_seq_by_id. Obviously
it is something different for the two modules.

Script1:
#!/bin/perl -w
use Bio::DB::GenBank;
use Bio::SeqIO;

# Das output-Format wird festgelegt
$seqio_obj = Bio::SeqIO->new(-file => '>sequence.fasta', -format => 'fasta'
);



$db_obj = Bio::DB::GenBank->new;
$id = "BC049766";                                      # accesscion number
$seq_obj = $db_obj->get_Seq_by_id($id);



$seqio_obj->write_seq($seq_obj);

Script2:
#!/bin/perl -w
use strict;
use Bio::DB::EntrezGene;

my $id = "Penk1";                                     #name of the gene

my $db = new Bio::DB::EntrezGene;

my $seq = $db->get_Seq_by_id($id);

my $ac = $seq->annotation;

for my $ann ($ac->get_Annotations('dblink')) {
    if ($ann->database eq "Evidence Viewer") {
                # get the sequence identifier, the start, and the stop
        my ($contig,$from,$to) = $ann->url =~
          /contig=([^&]+).+from=(\d+)&to=(\d+)/;
        print "$contig\t$from\t$to\n";
    }
}


Thank you
Hermann Norpois


More information about the Bioperl-l mailing list