Two nuances --
- When you know that the query string is a gene symbol, it's better to search nuccore database as
-query 'LOC121999999[GENE]'so that you look for the string in the gene symbol field. This is not an issue here because LOC121999999 string would not be present anywhere else other than the gene symbol field. But if it were something like 'HexA' then the search would look for this string in every possible field. - When you run the search against nuccore with a gene symbol as the query, it will return both genomic and transcript accessions. In this case, the NC_055998.1 is the chromosome on which the gene is annotated and XR_006116882.1 is the transcript that represents this gene. If you want only the transcript accessions, you can add
biomol_rna[PROPERTIES]to the query.
You still need to be careful with this. Because the$ esearch -db nuccore -query 'LOC121999999[GENE]' | efetch -format acc XR_006116882.1 NC_055998.1 $ esearch -db nuccore -query 'LOC121999999[GENE] biomol_rna[PROPERTIES]' | efetch -format acc XR_006116882.1esearch -db nuccorecommand will return both RefSeq and GenBank accessions. If you want only RefSeq data, you will want to either use a RefSeq filter orelinkas suggested by ChatGPT.