Question: How To Use The Bioperl To Parse The Flat File Of Uniprotkb Database?
0
gravatar for siyu
8.0 years ago by
siyu140
China
siyu140 wrote:

How to use the Bioperl to parse the parse flat file of UniProtKB database in order to get the function annotation of a protein ?

now, I can only fetch out the all comment of a protein, can someone help me ? I only want to fetch out the "FUNCTION".

my code :

#!/usr/bin/perl
use warnings;
use Bio::SeqIO;
use Bio::DB::SwissProt;

open (GENE, $ARGV[0]) or die "cannot open gene file:$!";
$db_obj = Bio::DB::SwissProt->new;

my  @genes;
while(<GENE>){
    chomp;
    push @genes, $_;
}

$stream_seq = $db_obj->get_Stream_by_acc(["@genes"]);

my $i=0; 
while ( my $seq_obj = $stream_seq->next_seq )
{
 my $anno_collection = $seq_obj->annotation;
for my $key ( $anno_collection->get_all_annotation_keys ) 
{
my @annotations = $anno_collection->get_Annotations($key);
                for my $value ( @annotations ) 
{
              if ($value->tagname eq "comment") {
       print  "$genes[$i]:",$value->display_text,"\n";                          
           }                                      
    }
}
$i++;
}

result:

Q8N349:-!- FUNCTION: Odorant receptor (Potential).
-!- SUBCELLULAR LOCATION: Cell membrane; Multi-pass membrane protein.
-!- SIMILARITY: Belongs to the G-protein coupled receptor 1 family.
-!- WEB RESOURCE: Name=Human Olfactory Receptor Data Exploratorium
    (HORDE);
    URL="http://bip.weizmann.ac.il/cgi-bin/HORDE/showGene.pl?key=symbol&value=OR2L13";
-----------------------------------------------------------------------
Copyrighted by the UniProt Consortium, see http://www.uniprot.org/terms
Distributed under the Creative Commons Attribution-NoDerivs License
-----------------------------------------------------------------------
database bioperl • 2.8k views
ADD COMMENTlink modified 7.9 years ago by Elisabeth Gasteiger1.9k • written 8.0 years ago by siyu140
1

please, take a few minutes to correctly format your question.

ADD REPLYlink written 8.0 years ago by Pierre Lindenbaum131k

Yes, please do. I made a start for you. You need to indent lines of code with 4 spaces and do not copy/paste tabs.

ADD REPLYlink modified 8.0 years ago • written 8.0 years ago by Neilfws49k
0
gravatar for Elisabeth Gasteiger
7.9 years ago by
Geneva
Elisabeth Gasteiger1.9k wrote:

As an alternative to BioPerl, you can also do this on the UniProt web site http://www.uniprot.org:

See also the UniProt FAQ about programmatic access: http://www.uniprot.org/faq/28

ADD COMMENTlink written 7.9 years ago by Elisabeth Gasteiger1.9k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1966 users visited in the last hour