# How to read in Primary Motor Cortex 10X-v3/v2 data into R/Seurat

**URL:** <https://community.brain-map.org/t/how-to-read-in-primary-motor-cortex-10x-v3-v2-data-into-r-seurat/1946>\
**Category:** Technical\
**Created:** [November 13, 2022, 2:47am UTC](https://community.brain-map.org/t/how-to-read-in-primary-motor-cortex-10x-v3-v2-data-into-r-seurat/1946 "2022-11-13T02:47:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gchatt](https://avatars.discourse-cdn.com/v4/letter/g/e19b73/32.png) [@gchatt](https://community.brain-map.org/u/gchatt)\
**Post date:** [November 13, 2022, 2:48am UTC](https://community.brain-map.org/t/how-to-read-in-primary-motor-cortex-10x-v3-v2-data-into-r-seurat/1946/1 "2022-11-13T02:48:00Z")

</div>

Hi thank you so much for the incredible resource ‘Cell Type Knowledge Explorer’ with links to download the 10x v3/v2 data.

I was wondering if there were any guides to reading this data into R so it can be used with Seurat?

I have tried the following:  
-Download the matrix.tsv.gz, features.tsv.gz and barcode.tsv  
-Rename barcode.tsv to barcodes.tsv.gz  
-Run Read10X command in R  
(This strategy has worked for me on some of the human 10x transcriptomic data shared on NeMO)

However, with the motor cortex data, when I try the ‘Read10X’ command in R/Seurat, I get the following error:

\*Error in dimnamesGets(x, value) : \*

- length of Dimnames[[2]] (91072) is not equal to Dim[2] (91071)\*

I tried various motor cortex 10x files and **Dimnames[[2]]** is always greater than **Dim[2]** by just 1

* * *

If this data is not readable with Seurat, would someone kindly point me towards how I can best read in this data with Python?

At the end of the day, I’m basically just trying to recreate [Gene Expression by Cluster, median](https://idk-etl-prod-download-bucket.s3.amazonaws.com/aibs_mouse_ctx-hpf_10x/medians.csv) and [Gene Expression by Cluster, trimmed means](https://idk-etl-prod-download-bucket.s3.amazonaws.com/aibs_mouse_ctx-hpf_10x/trimmed_means.csv) as is shared for the Mouse Whole Cortex / Hippocampus, except I would love such files for the Mouse Primary Motor Cortex only

Thank you!  
Gaurav

---

<div class="post-metadata">

**Author:** ![ray.sanchez](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/ray.sanchez/32/679_2.png) [@ray.sanchez](https://community.brain-map.org/u/ray.sanchez)\
**Post date:** [November 15, 2022, 11:55pm UTC](https://community.brain-map.org/t/how-to-read-in-primary-motor-cortex-10x-v3-v2-data-into-r-seurat/1946/2 "2022-11-15T23:55:53Z")

</div>

Hi Gaurav,

Thanks for your question, and glad to hear you are finding the Cell Type Knowledge Explorer and NeMO useful! These data should be readable using Seurat, and I think the error might be because the “barcode.tsv” file has a header row - if you remove that row, does the Read10X function work for you?

Thanks!  
Ray

---

<div class="post-metadata">

**Author:** ![gchatt](https://avatars.discourse-cdn.com/v4/letter/g/e19b73/32.png) [@gchatt](https://community.brain-map.org/u/gchatt)\
**Post date:** [November 18, 2022, 2:10am UTC](https://community.brain-map.org/t/how-to-read-in-primary-motor-cortex-10x-v3-v2-data-into-r-seurat/1946/3 "2022-11-18T02:10:45Z")

</div>

Yes that worked thank you!
