[Bioperl-l] Re: RefSeq

Siddhartha Basu sidd.basu at gmail.com
Sat Mar 13 20:29:52 UTC 2010


The following code works with 1.6.1 of bioperl. It uses eutils and the
workflow efetch -> elink -> esummary.

#!/usr/bin/perl -w

use strict;
use Bio::DB::EUtilities;

my $id = $ARGV[0] || 'NM_001618';

my $eutils = Bio::DB::EUtilities->new(
    -eutil      => 'esearch', 
    -db         => 'nucleotide', 
    -term       => $id, 
    -usehistory => 'y'
);

my $hist = $eutils->next_History || die "no history\n";

$eutils->reset_parameters(
    -eutil          => 'elink', 
    -db             => 'gene', 
    -dbfrom         => 'nuccore', 
    -history        => $hist
);

my ($gene_id) = $eutils->next_LinkSet->get_ids;

$eutils->reset_parameters(
    -eutil => 'esummary', 
    -db    => 'gene', 
    -id    => $gene_id, 
);

my ($item) = $eutils->next_DocSum->get_Items_by_name('GenomicInfoType');
print $item->get_contents_by_name('ChrAccVer'),  "\n";

-siddhartha

On Fri, 12 Mar 2010, Jessica Sun wrote:

> I have a question: I have a refseq with NM_ number(mRNA), how can I get
> the genomic sequences(NT_number) with Bioperl, if it can be done?
> 
> Thanks
> 
> 
> -- 
> Jessica Jingping Sun
> _______________________________________________
> 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