NCBIFetch
NCBIFetch
Keywords: NCBI, esearch, efetch, list
Retrieves records in the fasta format from a list of one or more unique identifiers.
Indroduction
The Perl script use an input file with al list of genes (ncbifetchn.pl) or proteins (ncbifetchp.pl).
The Entrez Programming Utilities esearch and efetch from the NCBI web site are used.
efetch
http://eutils.ncbi.nlm.nih.gov/entrez/query/static/efetchseq_help.html#toolparam
esearch
http://www.ncbi.nlm.nih.gov/entrez/query/static/esearch_help.html
To manage a whole list the ncbi example perl script was modified.
The original script "eutils_example.pl" search only for one entry. See the original script
http://www.ncbi.nlm.nih.gov/entrez/query/static/eutils_example.pl
We and with the help of a unknown programer modified the script, and this enable a search of a whole list of genes or proteins.
Example "input.txt" - proteins
DQ267624 AJ011794 NM_001014432 |
Example "output.txt"
>gi|162460525|ref|NP_001105211.1| fructokinase 2 [Zea mays] MAPLGDGGAAAAAASNNLVVSFGEMLIDFVPDVAGLSLAESGGFVKAPGGAPANVACAIAKLGGSSAFVG KFGDDEFGHMLVNILKQNNVNAEGCLFDKHARTALAFVTLKHDGEREFMFYRNPSADMLLTEAELDLGLV RRARVFHYGSISLISEPCRSAHMAAMRAAKAAGVLCSYDPNVRLPLWPSPDAAREGILSIWKEADFIKVS DDEVAFLTRGDANDEKNVLSLWFDGLKLLVVTDGDKGCRYFTKDFKGSVPGFKVDTVDTTGAGDAFVGSL LVNVAKDDSIFHNEEKLREALKFSNACGAICTTKKGAIPALPTVATAQDLIAKAN >gi|108885236|sp|Q75KH3.2|GRDH_ORYSJ RecName: Full=Glucose and ribitol dehydrogenase homolog MASQQFPPQNQETQPGKEHAMDPRPEAIIQSYKPANKLKDKVAIVTGGDSGIGRAVCLCFALEGATVAFT YVKGQEEKDAEETLRALRDIRARTGAKDPMAIPADLGYDDNCRKVVDEVAGAYGGAIDILVNNAAEQYER PSITDITEDDLERVFRTNIFSYFFMSKHAVKRMRDRRGGAGAGGCSIINTSSINAYKGNKTLLDYTATKG AIVAFTRALALQLAEEGIRVNGVAPGPIWTPLIPASFAEEKVRQFGSQVPMGRAGQPSEVAPSFVFLASD DASYMSGQMLHVNGGVIVNG >gi|115470141|ref|NP_001058669.1| Os07g0100200 [Oryza sativa (japonica cultivar-group)] MATDGTGVVTVYGSGTNGAALLEPSNHKSATFSVKVGLAQMLRGGVIMDVVTPEQARIAEEAGACAVMAL ERVPADIRAQGGVARMSDPGLIRDIKRAVTIPVMAKARIGHFVEAQILEAIGVDYVDESEVLTLADDAHH INKHNFRVPFVCGCRDLGEALRRIREGAAMIRTKGEAGTGNVVEAVRHVRSVMGDIRALRNMDDDEVFSY AKRIAAPYDLVMQTKQLGRLPVVQFAAGGVATPADAALMMQLGCDGVFVGSGIFKSGDPARRARAIVQAV THYSDPKILAEVSSGLGEAMVGINLSDPKVERFAARSE |
Manual (Windows Version)
- Install perl
- Open Comand Prompt
- go to the folder with the perl script and input.txt.
Perl script and input.txt in the same folder -
Type the following command
perl program input > output
Nucleotide
perl ncbifetchn.pl input.txt > output.txt
Protein
perl ncbifetchp.pl input.txt > output.txt -
Open the result file output.txt
Remarks
- Close the text in the input.txt with a paragraph, otherwise the last entry will not be searched.
- The difference between ncbifetchp.pl and ncbifetchn.pl is only the script line
$db = "protein";
respectively
$db = "Nucleotide"; - The script should also work on Linux or Mac OS
- You can change the format (default "fasta") in the line
$report="fasta";
Downloads
Dieter Steinmetz (73228)