User Password
Login / Create Account
<< Back to the Blog

A simple PERL script to retrieve a sequence from the ncbi website

Tags retrieve sequence fasta perl ncbi
By: matthieu chartier  
January 7 2012

Here's a sample PERL script to quickly retrieve a protein sequence in the fasta format from the NCBI database using the E-utilities URL syntax. The E-utilities provide simple ways to retrieve a wide variety of information using a simple URL. For more information. In this example we use the gi (Gene ID) 632964 but it also works with a gene accession id (i.e.: AAA61480.1).


use LWP::Simple;

my $id="632964";
my $url = "$id&rettype=fasta&retmode=text";

@result = get($url);

print $_;

Comments (0)
Login to leave a comment.