<p>use the NCBI taxon dump under <a href="ftp://ftp.ncbi.nih.gov/pub/taxonomy" rel="noreferrer">ftp://ftp.ncbi.nih.gov/pub/taxonomy</a></p>

<p>in taxdmp.zip you'll find all the names for a given NCBI taxon</p>

<pre><code>$ grep -w ^9606 names.dmp 
9606    |   Homo sapiens    |       |   scientific name |
9606    |   Homo sapiens Linnaeus, 1758 |       |   authority   |
9606    |   human   |       |   genbank common name |
9606    |   man |       |   common name |
</code></pre>

CC BY-SA 3.0
2017-06-08T10:44:47.550Z
2017-06-08T10:44:47.550Z
Pierre
<p>Getting back to the original question about using <code>taxize</code> to search specifically in EOL, it looks like the most recent version of the package does not produce this error.</p>

<p>The current version of R I'm using (3.4.2) produces the following output:</p>

<blockquote>
  <p>sci2comm( c("Cancer", "Lophopanopeus"), db="eol" )</p>
  
  <p>$Cancer
   [1] "En art taskekrabbe"              "Felsenkrabbe"                    "Atlantic rock crab"<br>
   [4] "Jaiba de roca amarilla"          "Tourteau poïnclos"               "Granciporro atlantico giallo"<br>
   [7] "Atlantische rotskrab"            "Sapateira de rocha do Atlântico" "Bogenkrabbe"<br>
  [10] "red rock crab"                   "Pacific rock crab"               "Jaiba del Pacífico"<br>
  [13] "Tourteau du Pacifique"           "Granciporro del Pacifico"        "Pacifische rotskrab"<br>
  [16] "Sapateira de rocha do Pacífico"  "Jonahkrabbe"                     "Jonah crab"<br>
  [19] "Jaiba de roca Jonás"             "Tourteau jona"                   "Grancipporo atlantico rosso"<br>
  [22] "Jonakrab"                        "Sapateira boreal"                "Bou"<br>
  [25] "Almindelig taskekrabbe"          "Taskekrabbe"                     "Taschenkrebs"<br>
  [28] "Edible crab"                     "rock crab"                       "Buey"<br>
  [31] "Buey de mar"                     "Jaiba de roca masera"            "Masera"<br>
  [34] "Paguro"                          "Pato"                            "Sabago"<br>
  [37] "Isotaskurapu"                    "Crabe dormeur"                   "Dormeur"<br>
  [40] "Tourteau"                        "crabe-dormeur"                   "Granchio di mare"<br>
  [43] "Granciporro"                     "Noordzeekrab"                    "grote krab"<br>
  [46] "grote noordzeekrab"              "hoofdkrab"                       "slagkrab"<br>
  [49] "steenkrab"                       "toogkrab"                        "zeekrab"<br>
  [52] "Sapateira"                      </p>
  
  <p>$Lophopanopeus
  [1] "blackclaw crestleg crab" "knobkneed crestleg crab" "knobknee crestleg crab"  "molarless crestleg crab"</p>
  
  <p>$'Pugettia foliata'
  character(0)</p>
</blockquote>

<p>A slightly older version of R (3.3.2) produces an error when one of the taxa was not found:</p>

<blockquote>
  <p>sci2comm( c("Cancer", "Lophopanopeus", "Pugettia foliata"), db="eol" )</p>
  
  <p>Error in eol_pages(taxonconceptID = x, common_names = TRUE, ...) : 
    Not Found (HTTP 404).</p>
</blockquote>

<p>I am very thankful for the package updates!</p>

CC BY-SA 3.0
2017-10-03T23:20:00.667Z
2017-10-03T23:25:01.600Z
2017-10-03T23:25:01.600Z
M.Whalen
<p>As Pierre <a href="https://bioinformatics.stackexchange.com/a/579/298">suggested</a>, you can get a dump of such names from <a href="ftp://ftp.ncbi.nih.gov/pub/taxonomy" rel="nofollow noreferrer">NCBI</a>. Then, to query it for the common name for a species using its Latin name, you can do:</p>

<pre class="lang-c prettyprint-override"><code>$ awk -F'\t' -vname="Mus musculus" '($7=="scientific name" &amp;&amp; $3==name){
                                      a[$1]=$3
                                    } 
                                    ($1 in a &amp;&amp; /genbank common name/){  
                                      print $3
                                    }' names.dmp
house mouse
</code></pre>

CC BY-SA 3.0
2017-06-08T11:00:44.797Z
please note : the tabulation is not the delimiter, it's a mix of spaces and pipes
Pierre
CC BY-SA 3.0
2017-06-08T11:02:27.213Z
@Pierre is it? I admit I've never worked with this file before but I downloaded it and saw that it is tab-separated. The `|` are their own fields and are actually `\t|\t` in the file, so using tab as the separator seems the best approach. Am I wrong?
terdon
CC BY-SA 3.0
2017-06-08T11:03:44.973Z
By the way, @Pierre, this is only making your answer a bit more specific. It might be better to just add it into your answer instead of cluttering up the page with multiple answers. I would have done so but I don't have enough rep to do so directly yet. So feel free to just copy this (or your improved version of it) into your answer. If you do, let me know and I'll delete this one.
terdon
CC BY-SA 3.0
2017-06-08T11:04:29.773Z
ah yes, with your awk indexes, it should be ok. And no, leave your answer here please.
Pierre
CC BY-SA 3.0
2017-06-08T10:57:53.833Z
2017-06-08T21:12:29.263Z
2017-06-08T21:12:29.263Z
terdon
<p>Here is a code on github that can generate a csv file as well as a python dictionary.
<a href="https://github.com/rahulnutron/scientific_name_to_common-name_converter" rel="nofollow noreferrer">https://github.com/rahulnutron/scientific_name_to_common-name_converter</a></p>

CC BY-SA 4.0
2021-10-18T19:18:05.657Z
2021-10-18T19:18:05.657Z
Rahul Shaw
<p>As <a href="https://bioinformatics.stackexchange.com/a/579/191">Pierre mentioned</a>, NCBI is a good resource for this kind of transformation.</p>

<p>You can still use <code>taxize</code> to perform the conversion:</p>

<pre class="lang-r prettyprint-override"><code>library("taxize")

species &lt;- c('Helianthus annuus', 'Mycobacterium bovis', 'Rattus rattus', 'XX', 'Mus musculus')

uids &lt;- get_uid(species)

# keep only uids which you have in the database
uids.found &lt;- as.uid(uids[!is.na(uids)])
# keep only species names  corresponding to your ids
species.found &lt;- species[!is.na(uids)]

common.names &lt;- sci2comm(uids.found, db = 'ncbi')
names(common.names) &lt;- species.found

common.names

## output:
## $`Helianthus annuus`
## [1] "common sunflower"
## 
## $`Mycobacterium bovis`
## character(0)
## 
## $`Rattus rattus`
## [1] "black rat"
## 
## $`Mus musculus`
## [1] "house mouse"
</code></pre>

<p>This works correctly if no common name is available, or if there is no species in the database. You can also try a different database, e.g. <code>db='itis'</code>.</p>

<p>The advantage of this approach is that you do not have to parse a file yourself. The downside is that it can be slow for large list, since for every species a database request is performed.</p>

CC BY-SA 3.0
2017-06-09T13:48:50.873Z
great stuff, thanks folks- this works perfectly for the ncbi data. one small addition is that due to the complexities of the eol database being searchable in a different way you can't use that option without some other wizzy functions (i have a chap working on this but no joy so far)
Daniel Mead
CC BY-SA 3.0
2017-06-08T11:03:51.673Z
2017-06-08T21:44:35.360Z
2017-06-08T21:44:35.360Z
Iakov Davydov
<p>I’m trying to find common names from a list of scientific names (not all will have them though).</p>

<p>I was attempting to use <code>taxize</code> in R but it aborts if it doesn’t find an entry in EOL and I don’t know a way around this other than manually editing the list - in which case I might as well check all this way.</p>

<p>Does anyone have a better way of doing this?</p>

CC BY-SA 3.0
2017-06-08T10:45:25.933Z
The answer to your question might be taxon-specific. For instance, if you deal with fish, the fishbase database has quite important common-name information. Are you dealing with a particular kind of organism?
bli
CC BY-SA 3.0
2017-06-09T03:03:51.963Z
Commons names in any language? Or specifically in English? Or another specific language?
Nicolas Raoul
CC BY-SA 3.0
2017-06-12T15:15:12.917Z
to answer the above two, it's a mix of all types of prokaryotes. The returns would need to be in English, it seems EOL gives other languages as well (but returns nested lists of diff lengths- i gave up trying to use those).
Daniel Mead
<r><database><taxonomy>
How to convert species names into common names?
# How to convert species names into common names?

(Asked by: username_0 on 2017-06-08)

I’m trying to find common names from a list of scientific names (not all will have them though).

I was attempting to use `taxize` in R but it aborts if it doesn’t find an entry in EOL and I don’t know a way around this other than manually editing the list - in which case I might as well check all this way.

Does anyone have a better way of doing this?

**Tags:** r, database, taxonomy
> **Comments:**
> **username_1**: The answer to your question might be taxon-specific. For instance, if you deal with fish, the fishbase database has quite important common-name information. Are you dealing with a particular kind of organism?  
> **username_2**: Commons names in any language? Or specifically in English? Or another specific language?  
> **username_0**: to answer the above two, it's a mix of all types of prokaryotes. The returns would need to be in English, it seems EOL gives other languages as well (but returns nested lists of diff lengths- i gave up trying to use those).  

---

## 5 answers

### Answer by username_7 on 2017-06-08. Score: 15 | Accepted answer

As Pierre mentioned, NCBI is a good resource for this kind of transformation.
You can still use taxize to perform the conversion:
library("taxize")

species <- c('Helianthus annuus', 'Mycobacterium bovis', 'Rattus rattus', 'XX', 'Mus musculus')

uids <- get_uid(species)

# keep only uids which you have in the database
uids.found <- as.uid(uids[!is.na(uids)])
# keep only species names  corresponding to your ids
species.found <- species[!is.na(uids)]

common.names <- sci2comm(uids.found, db = 'ncbi')
names(common.names) <- species.found

common.names

## output:
## $`Helianthus annuus`
## [1] "common sunflower"
## 
## $`Mycobacterium bovis`
## character(0)
## 
## $`Rattus rattus`
## [1] "black rat"
## 
## $`Mus musculus`
## [1] "house mouse"

This works correctly if no common name is available, or if there is no species in the database. You can also try a different database, e.g. db='itis'.
The advantage of this approach is that you do not have to parse a file yourself. The downside is that it can be slow for large list, since for every species a database request is performed.

> **Comments:**
> **username_0**: great stuff, thanks folks- this works perfectly for the ncbi data. one small addition is that due to the complexities of the eol database being searchable in a different way you can't use that option without some other wizzy functions (i have a chap working on this but no joy so far)  

---

### Answer by username_3 on 2017-06-08. Score: 14

use the NCBI taxon dump under ftp://ftp.ncbi.nih.gov/pub/taxonomy
in taxdmp.zip you'll find all the names for a given NCBI taxon
$ grep -w ^9606 names.dmp 
9606    |   Homo sapiens    |       |   scientific name |
9606    |   Homo sapiens Linnaeus, 1758 |       |   authority   |
9606    |   human   |       |   genbank common name |
9606    |   man |       |   common name |


---

### Answer by username_4 on 2017-10-03. Score: 4

Getting back to the original question about using `taxize` to search specifically in EOL, it looks like the most recent version of the package does not produce this error.

The current version of R I'm using (3.4.2) produces the following output:

> sci2comm( c("Cancer", "Lophopanopeus"), db="eol" )
>
> $Cancer
> [1] "En art taskekrabbe" "Felsenkrabbe" "Atlantic rock crab"  
> [4] "Jaiba de roca amarilla" "Tourteau poïnclos" "Granciporro atlantico giallo"  
> [7] "Atlantische rotskrab" "Sapateira de rocha do Atlântico" "Bogenkrabbe"  
> [10] "red rock crab" "Pacific rock crab" "Jaiba del Pacífico"  
> [13] "Tourteau du Pacifique" "Granciporro del Pacifico" "Pacifische rotskrab"  
> [16] "Sapateira de rocha do Pacífico" "Jonahkrabbe" "Jonah crab"  
> [19] "Jaiba de roca Jonás" "Tourteau jona" "Grancipporo atlantico rosso"  
> [22] "Jonakrab" "Sapateira boreal" "Bou"  
> [25] "Almindelig taskekrabbe" "Taskekrabbe" "Taschenkrebs"  
> [28] "Edible crab" "rock crab" "Buey"  
> [31] "Buey de mar" "Jaiba de roca masera" "Masera"  
> [34] "Paguro" "Pato" "Sabago"  
> [37] "Isotaskurapu" "Crabe dormeur" "Dormeur"  
> [40] "Tourteau" "crabe-dormeur" "Granchio di mare"  
> [43] "Granciporro" "Noordzeekrab" "grote krab"  
> [46] "grote noordzeekrab" "hoofdkrab" "slagkrab"  
> [49] "steenkrab" "toogkrab" "zeekrab"  
> [52] "Sapateira"
>
> $Lophopanopeus
> [1] "blackclaw crestleg crab" "knobkneed crestleg crab" "knobknee crestleg crab" "molarless crestleg crab"
>
> $'Pugettia foliata'
> character(0)

A slightly older version of R (3.3.2) produces an error when one of the taxa was not found:

> sci2comm( c("Cancer", "Lophopanopeus", "Pugettia foliata"), db="eol" )
>
> Error in eol\_pages(taxonconceptID = x, common\_names = TRUE, ...) :
> Not Found (HTTP 404).

I am very thankful for the package updates!


---

### Answer by username_5 on 2017-06-08. Score: 1

As Pierre suggested, you can get a dump of such names from NCBI. Then, to query it for the common name for a species using its Latin name, you can do:
$ awk -F'\t' -vname="Mus musculus" '($7=="scientific name" && $3==name){
                                      a[$1]=$3
                                    } 
                                    ($1 in a && /genbank common name/){  
                                      print $3
                                    }' names.dmp
house mouse

> **Comments:**
> **username_3**: please note : the tabulation is not the delimiter, it's a mix of spaces and pipes  
> **username_5**: @Pierre is it? I admit I've never worked with this file before but I downloaded it and saw that it is tab-separated. The `|` are their own fields and are actually `\t|\t` in the file, so using tab as the separator seems the best approach. Am I wrong?  
> **username_5**: By the way, @Pierre, this is only making your answer a bit more specific. It might be better to just add it into your answer instead of cluttering up the page with multiple answers. I would have done so but I don't have enough rep to do so directly yet. So feel free to just copy this (or your improved version of it) into your answer. If you do, let me know and I'll delete this one.  
> **username_3**: ah yes, with your awk indexes, it should be ok. And no, leave your answer here please.  

---

### Answer by username_6 on 2021-10-18. Score: 0

Here is a code on github that can generate a csv file as well as a python dictionary.
<https://github.com/rahulnutron/scientific_name_to_common-name_converter>


---

