OK, so it is not possible from a fasta file but it is possible from a GB file. Fair enough, thank you! For matter of completion, I could not produce a GB file for the taxon 10239: when i ran the command
esearch -db "nucleotide" -query "txid10239[Organism] AND refseq[filter]"|efetch -format gb > genome.gb
I got:
500 read timeout
No do_post output returned from 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=nucleotide&term=txid10239%5BOrganism%5D%20AND%20refseq%5Bfilter%5D&retmax=0&usehistory=y&edirect=7.00&tool=edirect&email=gigiux@DirtyHarry'
Result of do_post http request is
$VAR1 = bless( {
'_headers' => bless( {
'client-date' => 'Fri, 12 Jan 2018 13:48:23 GMT',
'client-warning' => 'Internal response',
'content-type' => 'text/plain',
'::std_case' => {
'client-warning' => 'Client-Warning',
'client-date' => 'Client-Date'
}
}, 'HTTP::Headers' ),
'_rc' => 500,
'_content' => 'read timeout at /home/gigiux/miniconda3/bin/aux/lib/perl5/Net/HTTP/Methods.pm line 268.
',
'_request' => bless( {
'_uri' => bless( do{\(my $o = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi')}, 'URI::https' ),
'_headers' => bless( {
'content-type' => 'application/x-www-form-urlencoded',
'::std_case' => {
'if-ssl-cert-subject' => 'If-SSL-Cert-Subject'
},
'user-agent' => 'libwww-perl/6.26'
}, 'HTTP::Headers' ),
'_method' => 'POST',
'_content' => 'db=nucleotide&term=txid10239%5BOrganism%5D%20AND%20refseq%5Bfilter%5D&retmax=0&usehistory=y&edirect=7.00&tool=edirect&email=gigiux@DirtyHarry'
}, 'HTTP::Request' ),
'_msg' => 'read timeout'
}, 'HTTP::Response' );
WebEnv value not found in search output - WebEnv1
Db value not found in fetch input
Can you post an example accession number? NCBI has annotation files available for many of the refseq genomes.
I have for instance all the viruses with
I was going to suggest the same thing as @Sej. Take a look at this page for utilities to download and convert the genbank data. Also this: Genbank To Gtf Converter