[Bioperl-l] ReplacedBy value in esummary

Fields, Christopher J cjfields at illinois.edu
Tue May 28 18:31:30 UTC 2013


On May 28, 2013, at 12:49 PM, Warren Gallin <wgallin at ualberta.ca> wrote:

> Hi,
> 
> 	I just encountered a glitch when I was trying to update some entries in a database by finding updated GENBANK protein entries.
> 
> 	The original record was gi 118091304 which has been replaced by gi 363734282
> 
> 	I retrieved an ESummary of the record for gi 118091304 as a Bio::Tools::EUtilities::Summary::DocSum object (called $ds).
> 
> 	When I then tried to retrieve the gi number for the replacement by using: 
> 
> my $replaced = $ds->get_contents_by_name('ReplacedBy');
> 
> the returned value was 1, and when I dumped the ESummary record the relevant pair is ReplacedBy          :XP_421022.3.
> 
> The full Esummary dump is:
> 
> UID                 :118091304
> Caption             :XP_421022
> Title               :PREDICTED: similar to Potassium voltage-gated channel, subfamily Q, member
> 		    :1 [Gallus gallus]
> Extra               :gi|118091304|ref|XP_421022.2|[118091304]
> Gi                  :118091304
> CreateDate          :2004/07/28
> UpdateDate          :2006/11/16
> Flags               :512
> TaxId               :9031
> Length              :643
> Status              :replaced
> ReplacedBy          :XP_421022.3
> Comment             : This record was replaced or removed. 
> 
> 
> 	So two questions:
> 
> 	1) Is the ReplacedBy value always supposed to be the new accession number version rather than the new gi number?

No idea, the best people to answer that would be NCBI (the idea of these modules was to simplify getting at that data instead of munging the XML, but whatever they report is mainly from NCBI, not bioperl).

> 	2) Why would I be getting a returned value of 1 instead of the accession number that is in the summary record?

The text dump above indicates the values do exist.  However, you are calling a method that returns a list (note the plural in the name) in scalar context, so you get the number of values.  If you always expect a single value, use:

    my ($replaced) = $ds->get_contents_by_name('ReplacedBy');

which forces array context.  That should fix it.

chris

> Any advice appreciated.
> 
> Warren Gallin
> _______________________________________________
> 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