Answers.Body: <p>Try this:</p>
  
  <pre class="lang-r prettyprint-override"><code>library(Seurat)
  pbmc_small &lt;- RunUMAP(pbmc_small, dims = 1:10, reduction = "pca", n.components = 5)
  
  names(pbmc_small[["umap"]])
  #&gt; [1] "UMAP_1" "UMAP_2" "UMAP_3" "UMAP_4" "UMAP_5"
  
  # plot
  DimPlot(pbmc_small, reduction = "umap", dims = c(4, 5))
  </code></pre>
  
  <p><a href="https://i.sstatic.net/z3Vfd.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/z3Vfd.png" alt="enter image description here"></a></p>
  
  <p>This should work with Seurat version 3.1.5</p>
  
  <pre class="lang-r prettyprint-override"><code>packageVersion("Seurat")
  #&gt; [1] '3.1.5'
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-14T12:34:17.913Z
Answers.LastActivityDate: 2020-05-14T12:34:17.913Z
Answers.UserDisplayName: milanmlft
Answers.Body: <p>Change <code>n.components</code> / <code>max.dims</code> (depending on your seurat version) to 5 when you call <code>runUMAP</code> and you should have dim 4 and 5 available.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-24T15:48:41.070Z
Answers.Text: Hi Pallie, i have tried to use "SAN <- RunUMAP(SAN, dims = 1:10, max.dim = 5L, dims.keep = 5L)"  and there still are no UMAP-4 and UMAP-5.
Answers.UserDisplayName: hua
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-24T09:04:21.300Z
Answers.LastActivityDate: 2019-12-24T09:04:21.300Z
Answers.UserDisplayName: Pallie
Body: <p>I would like to know how to change the UMAP used in <code>Dimplot</code> and <code>FeaturePlot</code> from Seurat: how we can get the x-axis and the y-axis like UMAP-1 and UMAP-2 if I want to use UMAP-4 and UMAP-5. How to modify the code? It is easy to change the PC by using <code>DimPlot(object = pbmc_small, dims = c(4, 5), reduction = "PCA")</code> but if I changed to <code>reduction = "UMAP"</code>, I got the error </p>
  
  <pre><code>"Error in Embeddings(object = object[[reduction]])[cells, dims] : subscript out of bounds Calls: DimPlot Execution halted". 
  </code></pre>
  
  <p>Does anyone have any idea how to solve this problem? </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-23T23:37:10.133Z
Comments.Text: that is because UMAP-4 and UMAP-5 are not present in your object...head(object[['umap']]@cell.embeddings), or str(object[['umap']]@cell.embeddings)
Comments.UserDisplayName: Mack123456
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-24T02:41:25.627Z
Comments.Text: Yes, the UMAP-4 and UMAP-5 are not present in my project. So what should I do now?
Comments.UserDisplayName: hua
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-14T13:42:23.090Z
Comments.Text: What is the rationale for using UMAP-4 and UMAP-5? UMAP is different from PCA because you specify a dimension (usually) and it tries to put all information in those two dimensions.
Comments.UserDisplayName: Phoenix Mu
Tags: <seurat><single-cell>
Title: how to change the UMAP use in the dimplot and feature plot
ThreadText: # how to change the UMAP use in the dimplot and feature plot
  
  (Asked by: username_0 on 2019-12-23)
  
  I would like to know how to change the UMAP used in `Dimplot` and `FeaturePlot` from Seurat: how we can get the x-axis and the y-axis like UMAP-1 and UMAP-2 if I want to use UMAP-4 and UMAP-5. How to modify the code? It is easy to change the PC by using `DimPlot(object = pbmc_small, dims = c(4, 5), reduction = "PCA")` but if I changed to `reduction = "UMAP"`, I got the error
  
  ```
  "Error in Embeddings(object = object[[reduction]])[cells, dims] : subscript out of bounds Calls: DimPlot Execution halted". 
  
  ```
  
  Does anyone have any idea how to solve this problem?
  
  **Tags:** seurat, single-cell
  
  > **Comments:**
  > **username_1**: that is because UMAP-4 and UMAP-5 are not present in your object...head(object[['umap']]@cell.embeddings), or str(object[['umap']]@cell.embeddings)  
  > **username_0**: Yes, the UMAP-4 and UMAP-5 are not present in my project. So what should I do now?  
  > **username_2**: What is the rationale for using UMAP-4 and UMAP-5? UMAP is different from PCA because you specify a dimension (usually) and it tries to put all information in those two dimensions.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2020-05-14. Score: 1
  
  Try this:
  
  ```r
  library(Seurat)
  pbmc_small <- RunUMAP(pbmc_small, dims = 1:10, reduction = "pca", n.components = 5)
  
  names(pbmc_small[["umap"]])
  #> [1] "UMAP_1" "UMAP_2" "UMAP_3" "UMAP_4" "UMAP_5"
  
  # plot
  DimPlot(pbmc_small, reduction = "umap", dims = c(4, 5))
  
  ```
  
  [![enter image description here](https://i.sstatic.net/z3Vfd.png)](https://i.sstatic.net/z3Vfd.png)
  
  This should work with Seurat version 3.1.5
  
  ```r
  packageVersion("Seurat")
  #> [1] '3.1.5'
  
  ```
  
  
  ---
  
  ### Answer by username_4 on 2019-12-24. Score: 0
  
  Change `n.components` / `max.dims` (depending on your seurat version) to 5 when you call `runUMAP` and you should have dim 4 and 5 available.
  
  > **Comments:**
  > **username_0**: Hi username_4, i have tried to use "SAN <- RunUMAP(SAN, dims = 1:10, max.dim = 5L, dims.keep = 5L)"  and there still are no UMAP-4 and UMAP-5.  
  
  ---
  
  