[Bioperl-l] parsing entrezgene file (lost data)

Carnë Draug carandraug+dev at gmail.com
Tue Jul 5 22:16:07 UTC 2011


On 5 July 2011 22:55, Smithies, Russell
<Russell.Smithies at agresearch.co.nz> wrote:
> It is in there, just takes a bit of getting at.
> Frequent use of Data::Dumper to work out where you are helps.
>
>
>
> use warnings;
> use strict;
> use Bio::ASN1::EntrezGene;
> use Data::Dumper;
>
> my $parser = Bio::ASN1::EntrezGene->new('file' => "entrezgene.asn");
> while(my $result = $parser->next_seq){
>    $result = $result->[0] if(ref($result) eq 'ARRAY');
>    foreach my $l (@{$result->{locus}}){
>        foreach my $p (@{$l->{products}}){
>
>          my $nuc_gi = $p->{seqs}->[0]->{whole}->[0]->{gi};
>          my $nuc_acc = $p->{accession};
>
>          my $prot_gi = $p->{products}->[0]->{seqs}->[0]->{whole}->[0]->{gi};
>          my $prot_acc = $p->{products}->[0]->{accession};
>
>          print "$nuc_gi, $nuc_acc\t$prot_gi, $prot_acc \n";
>        }
>    }
> }
>

Hmm.. I see it now but it's still not there when using the Bio::SeqIO
module (I just tried with Bio::ASN1::EntrezGene as in your example and
I can see it now). I thought that using the specific module was not
recommended.

I just cloned the bioperl repo but the modules code is too much for
me. It seems that Bio::SeqIO uses the Bio::SeqIO::entrezgene module
instead of Bio::ASN1::EntrezGene . But then Bio::SeqIO::entrezgene
does use Bio::ASN1::EntrezGene on the initializing method (this is the
line from the module code)

    $self->{_parser} = Bio::ASN1::EntrezGene->new( file => $param{-file} );

So I have no idea what's wrong. Still, it's nice to have a workaround
for now. Thank you,

Carnë




More information about the Bioperl-l mailing list