Answers.Body: <p>Given the fact that you have RNA and ADT data (probably on the same set of cells), some colnames (which represent individual cells) would be duplicated. Normally duplicated colnames are tolerated with matrices and sparse matrices, however, Seurat apparently does not do so, below is from the <code>?CreateAssayObject</code>:</p>
  
  <pre><code>Details
  Non-unique cell or feature names are not allowed. Please make unique before calling this function.
  </code></pre>
  
  <p>Possible solution to your problem: Seuart has a dedicated vignette for <a href="https://satijalab.org/seurat/v3.0/multimodal_vignette.html" rel="nofollow noreferrer">working with multimodal data</a> and as you would see you will need to initiate your Seurat object with one matrix per assay: RNA and ADT. All you need to do is split your matrix into RNA and ADT, create your Seurat object with RNA data and then add the ADT data with:</p>
  
  <p><code>seurat_obj_with_rna_only[["ADT"]] &lt;- CreateAssayObject(counts = your_adt_matrix)</code></p>
  
  <p>For efficiency, Seurat uses sparse matrices so don't forget to convert your data matrices to sparse.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-27T07:25:27.870Z
Answers.LastActivityDate: 2019-08-27T07:55:54.483Z
Answers.LastEditDate: 2019-08-27T07:55:54.483Z
Answers.UserDisplayName: haci
Answers.Body: <p>I don't know if you solved the problem. Howerver,I think it's caused by multiple data types.</p>
  
  <p>For output from CellRanger >= 3.0 with multiple data types</p>
  
  <pre><code>data &lt;- Read10X(data.dir = data_dir)
  </code></pre>
  
  <p>This step creates multiple matrices, depending on how many types of data there are.</p>
  
  <pre><code>seurat_object = CreateSeuratObject(counts = data$`Gene Expression`)
  </code></pre>
  
  <p>So (counts = data$<code>Gene Expression</code>),You should also be able to choose the type of research you want to do.</p>
  
  <p>I hope my answer will help some people.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-27T02:35:55.860Z
Answers.LastActivityDate: 2019-08-27T04:47:17.333Z
Answers.LastEditDate: 2019-08-27T04:47:17.333Z
Answers.UserDisplayName: wade king
Body: <p>I got an input matrix which RNA expression and ADT capture are combined into one file. I loaded the file into Seurat successfully, however, when I tried to create Seurat object, it threw out an error saying </p>
  
  <pre><code>Error in CreateAssayObject(counts = counts, min.cells = min.cells, min.features = min.features) : 
    No cell names (colnames) names present in the input matrix
  </code></pre>
  
  <p>How can I create Seurat object when RNA expression and ADT data are combine together?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-05T06:51:26.930Z
Comments.Text: It shouldn't be a problem to have both types of data into a matrix as long as they are identified (i.e different naming of the columns). From the error that you say it seems that there are no column names in your matrix? Did you try to add colnames and see if it works?
Comments.UserDisplayName: jxx_fa
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-05T15:58:16.343Z
Comments.Text: @plat I checked the data and the columns(cell)  name is there. I don't know why it keep saying no cell names presents.
Comments.UserDisplayName: SherlockLTS
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-08T07:26:20.370Z
Comments.Text: Then I don't know what is going on. Could you please edit your question with a minimal reproducible example (https://stackoverflow.com/help/minimal-reproducible-example) of your problem?
Comments.UserDisplayName: jxx_fa
Tags: <seurat><single-cell>
Title: How to create Seurat object while RNA expression and ADT combined into one matrix
ThreadText: # How to create Seurat object while RNA expression and ADT combined into one matrix
  
  (Asked by: username_0 on 2019-07-04)
  
  I got an input matrix which RNA expression and ADT capture are combined into one file. I loaded the file into Seurat successfully, however, when I tried to create Seurat object, it threw out an error saying
  
  ```
  Error in CreateAssayObject(counts = counts, min.cells = min.cells, min.features = min.features) : 
    No cell names (colnames) names present in the input matrix
  
  ```
  
  How can I create Seurat object when RNA expression and ADT data are combine together?
  
  **Tags:** seurat, single-cell
  
  > **Comments:**
  > **username_1**: It shouldn't be a problem to have both types of data into a matrix as long as they are identified (i.e different naming of the columns). From the error that you say it seems that there are no column names in your matrix? Did you try to add colnames and see if it works?  
  > **username_0**: @plat I checked the data and the columns(cell)  name is there. I don't know why it keep saying no cell names presents.  
  > **username_1**: Then I don't know what is going on. Could you please edit your question with a minimal reproducible example (https://stackoverflow.com/help/minimal-reproducible-example) of your problem?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-08-27. Score: 1
  
  Given the fact that you have RNA and ADT data (probably on the same set of cells), some colnames (which represent individual cells) would be duplicated. Normally duplicated colnames are tolerated with matrices and sparse matrices, however, Seurat apparently does not do so, below is from the `?CreateAssayObject`:
  
  ```
  Details
  Non-unique cell or feature names are not allowed. Please make unique before calling this function.
  
  ```
  
  Possible solution to your problem: Seuart has a dedicated vignette for [working with multimodal data](https://satijalab.org/seurat/v3.0/multimodal_vignette.html) and as you would see you will need to initiate your Seurat object with one matrix per assay: RNA and ADT. All you need to do is split your matrix into RNA and ADT, create your Seurat object with RNA data and then add the ADT data with:
  
  `seurat_obj_with_rna_only[["ADT"]] <- CreateAssayObject(counts = your_adt_matrix)`
  
  For efficiency, Seurat uses sparse matrices so don't forget to convert your data matrices to sparse.
  
  
  ---
  
  ### Answer by username_3 on 2019-08-27. Score: 0
  
  I don't know if you solved the problem. Howerver,I think it's caused by multiple data types.
  
  For output from CellRanger >= 3.0 with multiple data types
  
  ```
  data <- Read10X(data.dir = data_dir)
  
  ```
  
  This step creates multiple matrices, depending on how many types of data there are.
  
  ```
  seurat_object = CreateSeuratObject(counts = data$`Gene Expression`)
  
  ```
  
  So (counts = data$`Gene Expression`),You should also be able to choose the type of research you want to do.
  
  I hope my answer will help some people.
  
  
  ---
  
  