Answers.Body: <p>Ensembl discontinued our calculation of dN/dS scores for orthologue pairs in release 100 (<a href="https://apr2020.archive.ensembl.org/index.html" rel="nofollow noreferrer">https://apr2020.archive.ensembl.org/index.html</a>). However, even when we did perform these calculations in Ensembl 99 and earlier, we only did this for pairs of orthologues that diverged within the last ∼100 million years, namely between pairs of mammalian, avian or tetraodontiforme genomes. More information can be found here:</p>
  <p><a href="https://academic.oup.com/database/article/doi/10.1093/database/bav096/2630091" rel="nofollow noreferrer">https://academic.oup.com/database/article/doi/10.1093/database/bav096/2630091</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-08T14:07:23.167Z
Answers.Text: Thank you so much
Answers.UserDisplayName: Tom Morgan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-07T11:54:08.340Z
Answers.LastActivityDate: 2021-12-07T11:54:08.340Z
Answers.UserDisplayName: Ben_Moore
Body: <p>I am trying to calculate the dn/ds ratio between the human genes and c.elegans. However, I am getting NA values in the output file</p>
  <p>I used the following script</p>
  <pre><code>library(biomaRt)
  
  ## This gives the full list of all marts, including archives
  archives &lt;- listEnsemblArchives()
  
  ## For the c.elegans data
  ensemblcelegans=useMart(host = 'jan2020.archive.ensembl.org', biomart = 
  'ENSEMBL_MART_ENSEMBL', 
                   dataset = &quot;celegans_gene_ensembl&quot;)
  
  filters = listFilters(ensemblcelegans)
  attributes = listAttributes(ensemblcelegans)
  
  Celegans_GFList &lt;- scan(&quot;c.elegans.tsv&quot;, what = character())
  Celegans_GFListValues&lt;-getBM(attributes = c('ensembl_gene_id', 
  'hsapiens_homolog_ensembl_gene',  'hsapiens_homolog_dn', 
                                      'hsapiens_homolog_ds', 'hsapiens_homolog_orthology_type'), 
                       filters = 'ensembl_gene_id', 
                       values = Celegans_GFList, 
                       mart = ensemblcelegans)
  
  Celegans_GFListValues1 &lt;- subset(Celegans_GFListValues, 
  Celegans_GFListValues<span class="math-container">$hsapiens_homolog_orthology_type == 'ortholog_one2one')
  Celegans_GFListValues1$</span>dnds_ratios &lt;- 
  Celegans_GFListValues1<span class="math-container">$hsapiens_homolog_dn/Celegans_GFListValues1$</span>hsapiens_homolog_ds
  write.csv(Celegans_GFListValues1, file = &quot;Celegans_GFListValues.csv&quot;)
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-02T15:21:58.867Z
Comments.Text: Hi @Tom, what did you do to debug the problem? Did you check what is the result of Celegans_GFListValues1$hsapiens_homolog_dn/Celegans_GFListValues1$hsapiens_homolog_ds or what is returned by getBM?
Comments.UserDisplayName: llrs
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-02T22:02:11.060Z
Comments.Text: @IIrs I am getting NA values
Comments.UserDisplayName: Tom Morgan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-03T16:37:54.310Z
Comments.Text: So, is the data available on Celegans_GFListValues1 ?
Comments.UserDisplayName: llrs
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-05T18:22:08.793Z
Comments.Text: The one to one ortholog data is present but dn and ds values are coming as NA for entire input list
Comments.UserDisplayName: Tom Morgan
Tags: <r><biomart>
Title: Calculating dn/ds ratio between two model organisms
ThreadText: # Calculating dn/ds ratio between two model organisms
  
  (Asked by: username_0 on 2021-12-02)
  
  I am trying to calculate the dn/ds ratio between the human genes and c.elegans. However, I am getting NA values in the output file
  
  I used the following script
  
  ```
  library(biomaRt)
  
  ## This gives the full list of all marts, including archives
  archives <- listEnsemblArchives()
  
  ## For the c.elegans data
  ensemblcelegans=useMart(host = 'jan2020.archive.ensembl.org', biomart = 
  'ENSEMBL_MART_ENSEMBL', 
                   dataset = "celegans_gene_ensembl")
  
  filters = listFilters(ensemblcelegans)
  attributes = listAttributes(ensemblcelegans)
  
  Celegans_GFList <- scan("c.elegans.tsv", what = character())
  Celegans_GFListValues<-getBM(attributes = c('ensembl_gene_id', 
  'hsapiens_homolog_ensembl_gene',  'hsapiens_homolog_dn', 
                                      'hsapiens_homolog_ds', 'hsapiens_homolog_orthology_type'), 
                       filters = 'ensembl_gene_id', 
                       values = Celegans_GFList, 
                       mart = ensemblcelegans)
  
  Celegans_GFListValues1 <- subset(Celegans_GFListValues, 
  Celegans_GFListValues$hsapiens_homolog_orthology_type == 'ortholog_one2one')
  Celegans_GFListValues1$dnds_ratios <- 
  Celegans_GFListValues1$hsapiens_homolog_dn/Celegans_GFListValues1$hsapiens_homolog_ds
  write.csv(Celegans_GFListValues1, file = "Celegans_GFListValues.csv")
  
  ```
  
  **Tags:** r, biomart
  
  > **Comments:**
  > **username_1**: Hi @Tom, what did you do to debug the problem? Did you check what is the result of Celegans_GFListValues1$hsapiens_homolog_dn/Celegans_GFListValues1$hsapiens_homolog_ds or what is returned by getBM?  
  > **username_0**: @IIrs I am getting NA values  
  > **username_1**: So, is the data available on Celegans_GFListValues1 ?  
  > **username_0**: The one to one ortholog data is present but dn and ds values are coming as NA for entire input list  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-12-07. Score: 0 | Accepted answer
  
  Ensembl discontinued our calculation of dN/dS scores for orthologue pairs in release 100 (<https://apr2020.archive.ensembl.org/index.html>). However, even when we did perform these calculations in Ensembl 99 and earlier, we only did this for pairs of orthologues that diverged within the last ∼100 million years, namely between pairs of mammalian, avian or tetraodontiforme genomes. More information can be found here:
  
  <https://academic.oup.com/database/article/doi/10.1093/database/bav096/2630091>
  
  > **Comments:**
  > **username_0**: Thank you so much  
  
  ---
  
  