I didn't notice it was just a warning. It is also good to know that it
will only happen on GIs greater than the last entry in the map file.
I'm however surprised you feel this is not a valid bug in need of a
fix. I think a fix should be fairly simple to implement. I don't like
they idea of masking warnings, I think you agree it is not a safe
thing to do. These particularly warnings are creating a lot of
unnecessary noise in the output of my tool. If you feel ok with just
returning 0 for missing GIs in the right range why not treat this case
the same way?
By the way, this happens in my case after updating genbank but failing
to update the map file. While I'm taking the necessary precautions to
avoid this corner case, again I feel is a valid case that should be
taken care of properly.
Thanks for you code, it's helping me a lot,
Carlos
On Tue, Aug 27, 2013 at 10:15 AM, Miguel Pignatelli via RT
<bug-Bio-LITE-Taxonomy-NCBI-Gi2taxid@rt.cpan.org> wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=87485 >
>
> This is not accurate.
> If the GI is not present, you always get a taxid of 0.
> If you use a GI that is greater than the last GI in the map file you get the warning (not error) you are reporting (only in save_mem is off). Even with the warning, you get the taxid value of 0, so no damage here.
>
> If you expect wrong GIs and you don't like the extra warnings you can disable them by locally clobbering the warning handler. Something like this should work:
>
> my $taxid;
> {
> local $SIG{__WARN__} = sub {};
> $taxid = $dict->get_taxid(5253387210000);
> }
>
> Hope this helps,
>
> M;
>
> On Wed Jul 31 10:18:17 2013,
https://www.google.com/accounts/o8/id?id=AItOawkaiBTa6wo1zS2PwQSxUYeDKEQ9nakwy5E wrote:
>> Hi,
>>
>> When querying for a GI not present in the taxonomy map file I get this
>> error:
>> $ ./gi2taxid.pl 525338721
>> substr outside of string at
>> /usr/lib/perl5/site_perl/5.8.8/Bio/LITE/Taxonomy/NCBI/Gi2taxid.pm line
>> 160.
>> Use of uninitialized value in unpack at
>> /usr/lib/perl5/site_perl/5.8.8/Bio/LITE/Taxonomy/NCBI/Gi2taxid.pm line
>> 160.
>> Use of uninitialized value in left bitshift (<<) at
>> /usr/lib/perl5/site_perl/5.8.8/Bio/LITE/Taxonomy/NCBI/Gi2taxid.pm line
>> 161.
>> Use of uninitialized value in bitwise or (|) at
>> /usr/lib/perl5/site_perl/5.8.8/Bio/LITE/Taxonomy/NCBI/Gi2taxid.pm line
>> 161.
>> Use of uninitialized value in left bitshift (<<) at
>> /usr/lib/perl5/site_perl/5.8.8/Bio/LITE/Taxonomy/NCBI/Gi2taxid.pm line
>> 161.
>> cborroto@rckblast02:~$ vim
>> /usr/lib/perl5/site_perl/5.8.8/Bio/LITE/Taxonomy/NCBI/Gi2taxid.pm
>>
>> I would expect to get 'undef' or an empty string.
>>
>> Thanks,
>> Carlos
>
>