Failed to link 10x file in Rstudio
0
0
Entering edit mode
2.9 years ago
KOUSTAV • 0

Can anyone help to understand the problem why 10x folder is not link in Seurat? Although this folder is in my working directory. Or any problem in my installation of seurat? I really don't understand.

> install.packages("Seurat")
Installing package into ‘C:/Users/tosh/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/Seurat_4.0.2.zip'
Content type 'application/zip' length 2760190 bytes (2.6 MB)
downloaded 2.6 MB

package ‘Seurat’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\tosh\AppData\Local\Temp\Rtmp2dN6I4\downloaded_packages
> library(Seurat)
Attaching SeuratObject
> getwd()
[1] "C:/Users/tosh/Documents"
> setwd("~/")
> "c:/60-502323136"
[1] "c:/60-502323136"
> setwd("~/")
> "c:/60-502323136"
[1] "c:/60-502323136"
> getwd()
[1] "C:/Users/tosh/Documents"
> ctrl_counts <- Read10X(data.dir = "data/ctrl_raw_feature_bc_matrix")
Error in Read10X(data.dir = "data/ctrl_raw_feature_bc_matrix") : 
  Directory provided does not exist
> getwd()
[1] "C:/Users/tosh/Documents"
> setwd("~/")
> 
> getwd()
[1] "C:/Users/tosh/Documents"
> setwd("~/60-502323136/01_Analysis/nacZT0_31032021/raw_feature_bc_matrix")
> dir()
[1] "barcodes.tsv.gz" "features.tsv.gz" "matrix.mtx.gz"  
> ctrl_counts <- Read10X(data.dir = "data/ctrl_raw_feature_bc_matrix")
Error in Read10X(data.dir = "data/ctrl_raw_feature_bc_matrix") : 
  Directory provided does not exist
> setwd("~/60-502323136/01_Analysis/nacZT0_31032021")
> dir()
 [1] "analysis"                      "cloupe.cloupe"                
 [3] "filtered_feature_bc_matrix"    "filtered_feature_bc_matrix.h5"
 [5] "metrics_summary.csv"           "molecule_info.h5"             
 [7] "possorted_genome_bam.bam"      "possorted_genome_bam.bam.bai" 
 [9] "raw_feature_bc_matrix"         "raw_feature_bc_matrix.h5"     
[11] "web_summary.html"             
> ctrl_counts <- Read10X(data.dir ="~/60-502323136/01_Analysis/nacZT0_31032021")
Error in Read10X(data.dir = "~/60-502323136/01_Analysis/nacZT0_31032021") : 
  Barcode file missing. Expecting barcodes.tsv.gz
> setwd("~/60-502323136")
> setwd()
Error in setwd() : argument "dir" is missing, with no default
> dir()
[1] "00_Rawdata"                            "01_Analysis"                          
[3] "60-502323136.md5"                      "60-502323136_GENEWIZ_Data_Report.html"
> getwd()
[1] "C:/Users/tosh/Documents/60-502323136"
> ctrl_counts <- Read10X("C:/Users/tosh/Documents/60-502323136")
Error in Read10X("C:/Users/tosh/Documents/60-502323136") : 
  Barcode file missing. Expecting barcodes.tsv.gz
> setwd("~/60-502323136/01_Analysis/nacZT0_31032021")
> dir()
 [1] "analysis"                      "cloupe.cloupe"                
 [3] "filtered_feature_bc_matrix"    "filtered_feature_bc_matrix.h5"
 [5] "metrics_summary.csv"           "molecule_info.h5"             
 [7] "possorted_genome_bam.bam"      "possorted_genome_bam.bam.bai" 
 [9] "raw_feature_bc_matrix"         "raw_feature_bc_matrix.h5"     
[11] "web_summary.html"             
> getwd()
[1] "C:/Users/tosh/Documents/60-502323136/01_Analysis/nacZT0_31032021"
> ctrl_counts <- Read10X(data.dir ="C:/Users/tosh/Documents/60-502323136/01_Analysis/nacZT0_31032021")
Error in Read10X(data.dir = "C:/Users/tosh/Documents/60-502323136/01_Analysis/nacZT0_31032021") : 
  Barcode file missing. Expecting barcodes.tsv.gz
> setwd("~/60-502323136")
> setwd("~/60-502323136")
> dir()
[1] "00_Rawdata"                            "01_Analysis"                          
[3] "60-502323136.md5"                      "60-502323136_GENEWIZ_Data_Report.html"
> setwd("~/60-502323136/01_Analysis")
> dir()
[1] "nacZT0_31032021"
> setwd("~/60-502323136/01_Analysis/nacZT0_31032021")
> dir()
 [1] "analysis"                      "barcodes.tsv.gz"              
 [3] "cloupe.cloupe"                 "features.tsv.gz"              
 [5] "filtered_feature_bc_matrix"    "filtered_feature_bc_matrix.h5"
 [7] "metrics_summary.csv"           "molecule_info.h5"             
 [9] "possorted_genome_bam.bam"      "possorted_genome_bam.bam.bai" 
[11] "raw_feature_bc_matrix"         "raw_feature_bc_matrix.h5"     
[13] "web_summary.html"             
> getwd()
[1] "C:/Users/tosh/Documents/60-502323136/01_Analysis/nacZT0_31032021"
> ctrl_counts <- Read10X_h5(C:/Users/tosh/Documents/60-502323136/01_Analysis/nacZT0_31032021)
Error: unexpected '/' in "ctrl_counts <- Read10X_h5(C:/"
> ctrl_counts <- Read10X_h5("data/ctrl_raw_feature_bc_matrix")
Error in Read10X_h5("data/ctrl_raw_feature_bc_matrix") : 
  Please install hdf5r to read HDF5 files
> install.packages("hdf5r")
Installing package into ‘C:/Users/tosh/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘bit’, ‘bit64’

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/bit_4.0.4.zip'
Content type 'application/zip' length 632870 bytes (618 KB)
downloaded 618 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/bit64_4.0.5.zip'
Content type 'application/zip' length 564577 bytes (551 KB)
downloaded 551 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/hdf5r_1.3.3.zip'
Content type 'application/zip' length 5123942 bytes (4.9 MB)
downloaded 4.9 MB

package ‘bit’ successfully unpacked and MD5 sums checked
package ‘bit64’ successfully unpacked and MD5 sums checked
package ‘hdf5r’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\tosh\AppData\Local\Temp\Rtmp2dN6I4\downloaded_packages
> ctrl_counts <- Read10X_h5("data/ctrl_raw_feature_bc_matrix")
Error in Read10X_h5("data/ctrl_raw_feature_bc_matrix") : File not found
> ctrl_counts <- Read10X("data/ctrl_raw_feature_bc_matrix")
Error in Read10X("data/ctrl_raw_feature_bc_matrix") : 
  Directory provided does not exist

Thank you in advance. Please help to resolve this problem.

Seurat RStudio • 4.1k views
ADD COMMENT
1
Entering edit mode

You seem to be running commands without understanding what they do or reading the error messages properly. From all the chaos above, a few things are clear:

  1. data.dir seems to require a barcodes file
  2. You have a barcode file under ~/60-502323136/01_Analysis/nacZT0_31032021/raw_feature_bc_matrix
  3. You're not trying to set the data.dir to the directory with the barcodes file

Try:

Read10X(data.dir ="~/60-502323136/01_Analysis/nacZT0_31032021/raw_feature_bc_matrix")
ADD REPLY
0
Entering edit mode

Thank you for your guide. You are correct that I have not any knowledge in programming, command etc. But due to new experiment I have to analyze my data. I have try to run your given command but no output found.

ctrl_counts <-Read10X(data.dir ="~/60-502323136/01_Analysis/nacZT0_31032021/raw_feature_bc_matrix")
ADD REPLY
0
Entering edit mode

Hi Ram, I have successfully run your given command now. The output is looks good. Now need to create a seurat object. Could you please check my command or correct it please.

> library (Seurat)
Attaching SeuratObject
> Read10X(data.dir ="~/60-502323136/01_Analysis/nacZT0_31032021/raw_feature_bc_matrix")
31053 x 6794880 sparse Matrix of class "dgCMatrix"
   [[ suppressing 34 column names ‘AAACCCAAGAAACACT-1’, ‘AAACCCAAGAAACCAT-1’, ‘AAACCCAAGAAACCCA-1’ ... ]]
   [[ suppressing 34 column names ‘AAACCCAAGAAACACT-1’, ‘AAACCCAAGAAACCAT-1’, ‘AAACCCAAGAAACCCA-1’ ... ]]

*****I have deleted some gene names
 ..............................
 ........suppressing 6794846 columns and 31024 rows in show(); maybe adjust 'options(max.print= *, width = *)'
 ..............................
   [[ suppressing 34 column names ‘AAACCCAAGAAACACT-1’, ‘AAACCCAAGAAACCAT-1’, ‘AAACCCAAGAAACCCA-1’ ... ]]

Vmn1r186       . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC102264.1     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC125149.3     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC125149.5     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC125149.1     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC125149.2     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC125149.4     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC234645.1     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC168977.2     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC168977.1     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
AC149090.1     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
CAAA01118383.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
Vmn2r122       . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
CAAA01147332.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ......
> 
> 
> ctrl_counts <-Read10X(data.dir ="~/60-502323136/01_Analysis/nacZT0_31032021/raw_feature_bc_matrix")
> ctrl <- CreateSeuratObject(counts =  ctrl_counts,min.cells = 3, min.features = 200)
ADD REPLY
0
Entering edit mode

I am not familiar with Seurat. Someone else on the site should be able to help you out better. One thing I've heard about Seurat is that following their user manual works very well. Try doing that and then making small changes as you need to.

ADD REPLY
0
Entering edit mode

Frankly, if you have no programming or single cell analysis experience whatsoever, I would strongly encourage you read up on both the general use of R and single cell analysis as a whole. Doing so will save you a whole lot of headache and frustration. Single cell analysis can be rather difficult and has a lot of subtleties and nuance that aren't immediately clear when following basic vignettes. You should not expect to complete a thorough analysis very quickly your first time working with single cell data.

On that front, I would recommend at least the first 10 or so chapters of the excellent R for Data Science book as a general R primer, and the extremely thorough Orchestrating Single Cell Analysis with Bioconductor (OSCA) book. While it does not use Seurat, it explains the steps necessary in single cell analysis along with the rationale behind them very well. It is a great resource to further your conceptual understanding of single cell RNAseq analysis.

ADD REPLY

Login before adding your answer.

Traffic: 2662 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