I want to retrieve a sequence for many species from the Nucleotide database in NCBI.

I'm using a command line approach and I have to figure out what is the best query that will return exclusively the region of DNA I am interested in and filter out unwanted noisy sequences.

I am using a wide range of species (that I have stored as a list of TaxIDs of about 2000 species): it includes small crustaceans, invertebrates, some algae and small vertebrates (reptiles, amphibians and few mammals).

My final goal is to obtain a phylogenetic tree for all or most of the species.

I have been suggested to use these genes to create such phylogeny

  • CO1 mithocondrial DNA
  • 16S rRNA
  • 18S rRNA

I want to formulate a specific query that will return exclusively those sequences.

I'm using the GenBank query builder to visually check for the accuracy of my search and when I find a good query I will use it in the API.

So far I came up with the following queries:

  • (COX1[Title] OR CO1[Title]) AND complete[Title] --> 63/2000 Species
  • 16S[title] AND complete[title] AND rRNA[title] NOT partial[title] --> 9/2000 species
  • 18S[title] AND complete[title] AND rRNA[title] NOT partial[title] --> 15/2000 species

As you can see the number of species that I get sequence for is very low compared to the initial 2000 species. I doubt that we have so little available sequences (especially for COX1 that is used for barcoding)

Can you help me understanding whether my queries are good or not? And if possible suggest a better alternative

More Info

A subset of 10 of my species of interest is

Rasbora heteromorpha
Elasmopus rapax
Gasterosteus aculeatus
Palaemonetes pugio
Catostomus commersoni
Daphnia magna
Oryzias latipes
Xenopus laevis
Tigriopus japonicus
Oncorhynchus mykiss

Out of these 10 only 2 have sequences available using the COX1 query

Name SeqID
Oncorhynchus mykiss EU186789.1
Xenopus laevis AB278691.1

But Daphnia magna is one of the most commonly used organisms in lab and I found this paper regarding the complete mitogenome of a specific strain of D. magna thus implying that the complete mitogenome of the species is already known. That means that there must be a way to retrieve all the other species that have full mitogenome but no COX1 gene mentioned in their GenBank title.

  • $\begingroup$ What database are you searching? I get 1995 hits for 16S[title] AND complete[title] AND rRNA[title] NOT partial[title], across 1430 eukaryotes, 287 bacteria and 178 archaea when using "nucleotide". $\endgroup$
    – terdon
    Commented Nov 9, 2023 at 9:52
  • $\begingroup$ Yes sorry maybe i was not very clear: the numbers on the right are the species that are both in my database and also in the results from Nucleotide. So even if you get 1400 eukariotes only 9 of these are overlapping with the species i work with. But they are mostly lab species and not rare, That is why I find it strange that i don't get many sequences from my search $\endgroup$
    – Mirko
    Commented Nov 9, 2023 at 10:53
  • $\begingroup$ You seem to be assuming gene names are shared across organisms. It's a reasonable assumption but, sadly, it is absolutely false. Gene names are not shared across species. They can be, sometimes, but not always or even often. For example, there is no CO1 or COX1 in human. "Cytochrome c oxidase assembly factor 1" has the symbol "COA1". $\endgroup$
    – terdon
    Commented Nov 11, 2023 at 13:07
  • $\begingroup$ For anyone having the same type of problem as me (batch COI download) i recommend reading this article as it has proven very useful for me DOI: 10.1111/1755-0998.13756 $\endgroup$
    – Mirko
    Commented Nov 17, 2023 at 14:23

2 Answers 2


The search term you need is [gene name] rather than [title]. For example,

(Gasterosteus aculeatus[Organism] AND cox1[Gene Name]) OR (Gasterosteus aculeatus[Organism] AND coi[Gene Name]) 

Results in 266 hits which all contain COX1 COI

Using Daphnia magna ...

(Daphnia magna[Organism] AND cox1[Gene Name]) OR (Daphnia magna[Organism] AND coi[Gene Name]) 

This results in 775 hits.

Daphina magna comprises 61 mtDNA genomes, you perform the above search and sort by sequence length and set the sequences per page to 200(easy).

Hope that resolves the issue.


There are two main problems I can see in your approach. First, gene names are not standardized across species and the "same" gene (what that means is a whole different discussion) can have different names. For example, human "Cytochrome c oxidase assembly factor 1" has the symbol "COA1".

Next, I don't quite understand why you expect the word "complete" to be in the title. That is actually why you don't find the D. magna sequence: it isn't complete, the start codon hasn't been correctly annotated as you can see on the relevant NCBI gene page:

Screenshot showing that the start codon is not determined

I would instead try something like this:

((chrM[Chromosome]) OR (chromosome M[Chromosome]) OR (MT[Chromosome]) OR (chromosome MT[Chromosome])) AND ((CO1[Gene Name]) OR (COX1[Gene Name]) OR ((cytochrome[Gene Name]) AND (oxidase[Gene Name]))


((16S[Gene/Protein Name]) and (ribosomal[Gene/Protein Name]))

All that said, trying to rely on gene annotations is rarely the best approach. There just isn't enough standardization. I would instead look at databases that provide lists of homologous genes. For instance, NCBI's Clusters of Orthologous Genes (COGs), which provides grouped homologous sequences.

  • $\begingroup$ Thanks for the tips they are very relevant. But the COG is only a viable option for archea and bacteria so it doesn't suit for me. $\endgroup$
    – Mirko
    Commented Nov 17, 2023 at 14:21
  • $\begingroup$ Ah, crud, sorry @Mirko, I didn't know it was limited to microorganisms. There is also KOG and Ortho MCL or you can use BioMart to extract orthologs etc. My main point here is that trying to use a gene name is unlikely to work well and you should look for dedicated resources instead. $\endgroup$
    – terdon
    Commented Nov 17, 2023 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.