Error in Read10X(data.dir
1
0
Entering edit mode
3.0 years ago

Hi, I am new to R and recently want to replicate a R demo with Seurat. The dataset is downloaded into my PC hard driver with the file name of "pbmc3k_filtered_gene_bc_matrices.tar.gz". I successfully loaded packages of dplyr, Seurat, patchwork which are required to run the code. Then, I tried to load dataset using code: pbmc.data<-Read10X(data.dir="~/R/10x/pbmc3k_filtered_gene_bc_matrices.tar.gz/") and get message "Error in Read10X(data.dir = "~/R/10x/pbmc3k_filtered_gene_bc_matrices.tar.gz/") : Directory provided does not exist. I have changed directory path and get the same error message. Please help. Thanks so much.

Seurat • 9.2k views
ADD COMMENT
2
Entering edit mode
3.0 years ago

Hi,

The files that you downloaded are tar.gz compressed (this can be decompressed in the command-line or using GUI programs - some OS like ubuntu can decompress it without any problem). Please decompress the files first and only then provide the path to the folder filtered_gene_bc_matrices/hg19/ like the tutorial mentions:

pbmc.data <- Read10X(data.dir = "../data/pbmc3k/filtered_gene_bc_matrices/hg19/")

Right now you're saying to import the files under the compressed folder:

"~/R/10x/pbmc3k_filtered_gene_bc_matrices.tar.gz/"

Which of course do not exist (Directory provided does not exist) because the software can not read anything under the compressed folder.

I hope this helps,

António

ADD COMMENT
0
Entering edit mode

You are absolutely right. Thanks so much.

ADD REPLY
0
Entering edit mode

I also have the same problem. I have tried to load the dataset using code: data <- Read10X(data.dir = "GSE162454_RAW"). I received an message error Directory provided does not exist Do you know where I've gone wrong? In the folder is 3 files: features, matrix and barcodes.

Thankyou

ADD REPLY
0
Entering edit mode

Perhaps you are not giving the full path to the folder. I'm not sure, but your problem seems to be different since your GSE162454_RAW folder is decompressed. Type the command in R list.files("GSE162454_RAW") to see if you can list the files from the directory where you are trying to import this. If you can list, I cannot figure out the problem. If you can't, it means that the path that you're giving is wrong.

António

ADD REPLY
0
Entering edit mode

I'm getting the same error code. What commands do you use to decompress the tar.gz file? Thank you

ADD REPLY
0
Entering edit mode

It depends on the operating system (OS) that you're running.

If you want to decompress a .tar.gz folder outside R, see the following guide depending on your OS: https://kinsta.com/knowledgebase/unzip-tar-gz/. If you're using Linux, you can do the following in your terminal: tar -xvzf folder.tar.gz (where folder.tar.gz represents the folder that you want to decompress)

If you want to do it from R directly for convenience, you can attempt the following - see the youtube video (I never try it myself but it seems straightforward): https://www.youtube.com/watch?v=-7s03AzEvag. The solution relies on the function untar(). It seems that you only need to provide the .tar.gz folder as input like this: untar("folder.tar.gz").

I hope this helps.

António

ADD REPLY

Login before adding your answer.

Traffic: 1932 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6