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

Chris Fields cjfields at illinois.edu
Tue Jul 5 22:22:25 UTC 2011


On Jul 5, 2011, at 5:16 PM, Carnë Draug wrote:

> 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.

Not that; in general the data should go into the Bio::Seq, but in this case it's being missed.

> 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ë

My guess is lack of implementation from the bioperl end on grabbing this specific data.  

chris





More information about the Bioperl-l mailing list