[Bioperl-l] problem with Bio::SeqIo KEGG - need help urgently

Chris Fields cjfields at uiuc.edu
Mon Nov 19 14:33:46 UTC 2007


It makes sense in the light that you're (erroneously) using a hash:

    my %values = $ac->get_Annotations($key);

This assigns key-value pairs of DBLink => DBLink; you don't see an  
error b/c the number of links happens to be even (I get 8) but you  
would if the number of links returned is odd (missing value for key  
error or something along those lines).  So when you call:

    foreach my $value (keys(%values)) {....}

you only get half of the DBLinks.  You should use an array:

    my @values = $ac->get_Annotations($key);
    foreach my $value (@values) {
       print $value->as_text,"\n";
    }

Note the loop change; Bio::Annotation are no longer operator  
overloaded so your print statement wouldn't work in a bioperl 1.6 world.

chris

On Nov 19, 2007, at 12:11 AM, neeti somaiya wrote:

> Hi,
>
> I am using Bio::SeqIO for parsing KEGG gene ent files.
>
> A part of my code is
>
> foreach my $key ( $ac->get_all_annotation_keys() )
>                                 {
>                                         if($key eq "dblink")
>                                         {
>                                                 my %values =
> $ac->get_Annotations($key);
>                                                 foreach my $value (
> keys(%values ))
>                                                 {
>                                                         print  
> "\n*****VALUE
> $value*****\n";
>                                                 }
>                                         }
>                                  }
>
> Here not all dblinks present in the actual file get parsed. For eg,  
> in the
> data below,
> ENTRY       116064            CDS       H.sapiens
> NAME        LRRC58
> DEFINITION  leucine rich repeat containing 58
> POSITION    3q13.33
> MOTIF       Pfam: SdiA-regulated LRR_1
>             PROSITE: LEU_RICH
> DBLINKS     NCBI-GI: 153792305
>             NCBI-GeneID: 116064
>             HGNC: 26968
>             Ensembl: ENSG00000163428
>             UniProt: Q96CX6
>
> Here, the dblink parsing gives me NCBI-GeneID, Ensembl, Pfam and  
> PROSITE,
> but doesnt give me HGNC and UniProt. For other entries it gives me  
> other
> combinations of dbs.
>
> Can anyone help me with this. Why is this happenning? I have no clue.
>
> Thanks and Regards,
> Neeti.
> -- 
> -Neeti
> Even my blood says, B positive
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list