text: user6827: I'm trying to convert mouse genes from PTX data to human genes in order to do a comparison with patient data to see what genes are being conserved. I'm using this file for the orthologs.
  http://www.informatics.jax.org/downloads/reports/HOM_MouseHumanSequence.rpt
  I read the table with:
  gene_conversion <- read.table("HOM_MouseHumanSequence.rpt.txt", sep="\t", header=T, fill=T)
  
  I have subsetted the mouse genes from the PTX seurat object to only include the mouse genes with:
  mouse_only <- subset(scData, features = mouse_1)
  head(rownames(mouse_only))
  [1] "Xkr4"    "Gm37180" "Gm37363" "Gm19938" "Sox17"   "Gm6085" 
  
  Now I'm not sure how to convert the mouse genes in my mouse-only seurat object to match the human genes in the file.
  Any help would be greatly appreciated.
  
  user3631: Mice genes are usually the same as the human ones, but lower case with only the first character as upper (Sox17 -> SOX17).
  toupper(rownames(mouse_only)) will do the trick.
  Unfortunately, there are exceptions, and it is always better to relay on information from databases. The function bellow takes a vector of human genes, and uses biomaRt to return the corresponding genes in mouse.
  # from Human to Mouse
  convertHumanGeneList <- function(x){
  
     library("biomaRt")
     human <- useMart("ensembl", dataset = "hsapiens_gene_ensembl")
     mouse <- useMart("ensembl", dataset = "mmusculus_gene_ensembl")
  
     genesV2 <- getLDS(attributes = c("hgnc_symbol"), filters = "hgnc_symbol", 
                   values = x , mart = human, attributesL = c("mgi_symbol"), martL = mouse, uniqueRows=T)
  
     humanx <- unique(genesV2[, 2])
  
     return(humanx)
  }
  
  You simply need to invert the 2 and you should be able to convert your vector rownames(mouse_only)
  #---- Update using SOX17 as example
  
  
original_text: 6827: <p>I'm trying to convert mouse genes from PTX data to human genes in order to do a comparison with patient data to see what genes are being conserved. I'm using this file for the orthologs.
  <strong><a href="http://www.informatics.jax.org/downloads/reports/HOM_MouseHumanSequence.rpt" rel="nofollow noreferrer">http://www.informatics.jax.org/downloads/reports/HOM_MouseHumanSequence.rpt</a></strong></p>
  <p>I read the table with:</p>
  <pre><code>gene_conversion &lt;- read.table(&quot;HOM_MouseHumanSequence.rpt.txt&quot;, sep=&quot;\t&quot;, header=T, fill=T)
  </code></pre>
  <p>I have subsetted the mouse genes from the PTX seurat object to only include the mouse genes with:</p>
  <pre><code>mouse_only &lt;- subset(scData, features = mouse_1)
  head(rownames(mouse_only))
  [1] &quot;Xkr4&quot;    &quot;Gm37180&quot; &quot;Gm37363&quot; &quot;Gm19938&quot; &quot;Sox17&quot;   &quot;Gm6085&quot; 
  </code></pre>
  <p>Now I'm not sure how to convert the mouse genes in my mouse-only seurat object to match the human genes in the file.</p>
  <p>Any help would be greatly appreciated.</p>
   3631: <p>Mice genes are usually the same as the human ones, but lower case with only the first character as upper (<code>Sox17</code> -&gt; <code>SOX17</code>).
  <code>toupper(rownames(mouse_only))</code> will do the trick.</p>
  <p>Unfortunately, there are exceptions, and it is always better to relay on information from databases. The function bellow takes a vector of human genes, and uses <code>biomaRt</code> to return the corresponding genes in mouse.</p>
  <pre><code># from Human to Mouse
  convertHumanGeneList &lt;- function(x){
  
     library(&quot;biomaRt&quot;)
     human &lt;- useMart(&quot;ensembl&quot;, dataset = &quot;hsapiens_gene_ensembl&quot;)
     mouse &lt;- useMart(&quot;ensembl&quot;, dataset = &quot;mmusculus_gene_ensembl&quot;)
  
     genesV2 &lt;- getLDS(attributes = c(&quot;hgnc_symbol&quot;), filters = &quot;hgnc_symbol&quot;, 
                   values = x , mart = human, attributesL = c(&quot;mgi_symbol&quot;), martL = mouse, uniqueRows=T)
  
     humanx &lt;- unique(genesV2[, 2])
  
     return(humanx)
  }
  </code></pre>
  <p>You simply need to invert the 2 and you should be able to convert your vector <code>rownames(mouse_only)</code></p>
  <p>#---- Update using SOX17 as example
  <a href="https://i.stack.imgur.com/adHUN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/adHUN.png" alt="enter image description here" /></a></p>
  