I have the following code that prints an accession number to a file based on the Gene ID the user entered:
use LWP::Simple; #assemble the URL $base = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/'; $url = $base . "efetch.fcgi?db=nucleotide&id=$ARGV&rettype=acc"; #post the URL $output = get($url); my $filename = 'acc_num.txt'; open(FH, '>', $filename) or die $!; print FH $output; close(FH);
The accession number of the GID 3773153 written to the output file is: AI211211.1
I want the printed accession number to be: NC_007596.2
What am I supposed to change in my code?
Thanks in advance!!