Why do you expect the output to be Homo sapiens chromosome 16 , GRCh38.p2 Primary Assembly?
When I run your script and enter 16 for the id, I get the following in the first line of the output.fasta file.
Blue Whale common cetacean component DNA.
If I execute a Nucleotide search for 16 at this Genbank page http://www.ncbi.nlm.nih.gov/nuccore/, I get output that matches that of the output.fasta file (see http://www.ncbi.nlm.nih.gov/nuccore/16).
It appears that your code is performing a Genbank nucleotide search, when you may want it to perform a gene search. If I go back to http://www.ncbi.nlm.nih.gov/nuccore and change the database in the drop-down to Gene, then I get results that match your desired output (see http://www.ncbi.nlm.nih.gov/gene/?term=16).
You may need to adjust your code to search the correct/desired Genbank database. I have never used this module before, so I don't know how to do that at the moment. Perhaps the documentation for these modules will be helpful: Bio::DB::Genbank and Bio::DB::Query::GenBank
UPDATE: Perhaps nucleotide is the correct database. See my other post in this thread Re: BioPerl sequences.
In reply to Re: BioPerl sequences
by kevbot
in thread BioPerl sequences
by wirlleyd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |