[Bioperl-l] bioperl genbank output is different than web?

James Wasmuth james.wasmuth at ed.ac.uk
Sun Oct 16 06:47:32 EDT 2005


Hi Sam,

your code works fine for me.

>
>  /mol_type="mRNA"
>                      /db_xref="taxon:10090"
>                      /strain="FVB/N"
>                      /chromosome="3"
>                      /organism="Mus musculus"



What version are you running? If you just want the chromosome number 
then have a look at the Feature Annotation HOWTOs: 
http://bioperl.org/HOWTOs/html/Feature-Annotation.html
The code below is adopted from that.


#!/usr/bin/perl -w

use strict;

use Bio::DB::RefSeq;
use Bio::SeqIO;
use Bio::Seq;

my $db_obj = Bio::DB::RefSeq->new;
my $seq_obj = $db_obj->get_Seq_by_acc("NM_011674");

for my $feat_object ($seq_obj->get_SeqFeatures) {
    next unless $feat_object->primary_tag eq 'source';
    for my $tag ($feat_object->get_all_tags) {
        if ($tag eq 'chromosome')    {
            for my $value ($feat_object->get_tag_values($tag)) {
                print "chromosome =", $value, "\n";
            }
        }
    }
}


-james


Sam Al-Droubi wrote:

>All,
>
>I am new to this so please forgive me for any dump
>quetsions. 
>
>The problem: I am getting the genbank data for a gene
>using the simple code below and writing it to a file.
>The problem is that output is not the same as when I
>do a web search via ncbi entrez.  I want to parse out
>on which chromosome gene is on.  The web output gives
>me a correct chromosome number (i.e. chromosome="3")
>while the output from this code gives me (i.e.
>/chromosome="Bio::Annotation::SimpleValue=HASH(0x88be668)")
>
>Can someone help me figure out what is wrong please?
>
>The Code:
>--------------------
>use Bio::DB::GenBank;
>use Bio::SeqIO;
>use Bio::Seq;
>
>$db_obj = Bio::DB::GenBank->new;
>$seq_obj = $db_obj->get_Seq_by_acc("NM_011674");
>$seqio_obj = Bio::SeqIO->new(-file
>=>">data/genes/NM_011674.fa", -format=>"fasta");
>$seqio_obj = Bio::SeqIO->new(-file
>=>">data/genes/NM_011674.gb", -format=>"genbank");
>$seqio_obj->write_seq($seq_obj);
>---------------------
>
>
>
>
>
>
>Sincerely, 
>Sam Al-Droubi, M.S.
>saldroubi at yahoo.com
>_______________________________________________
>Bioperl-l mailing list
>Bioperl-l at portal.open-bio.org
>http://portal.open-bio.org/mailman/listinfo/bioperl-l
>  
>

-- 
"The best model of a cat is another cat or,
	 better, the cat itself"
		-Norbert Wiener

Blaxter Nematode Genomics Group   |
Institute of Evolutionary Biology |
Ashworth Laboratories, KB         | tel: +44 131 650 7403
University of Edinburgh           | web: www.nematodes.org/~james
Edinburgh                         |
EH9 3JT                           |
UK                                |



More information about the Bioperl-l mailing list