2
$\begingroup$

I am loading cellranger data into seuratobject as following, but it keeps showing Error in

Barcode file missing. Expecting barcodes.tsv.gz

the running code and result:

#clean up your environment
rm(list=ls())

# Load required libraries
library(Seurat)
library(dplyr)

# Load required library for reading Matrix Market files
library(Matrix)

# For output from CellRanger >= 3.0 with multiple data types
data_dir <- 'C:/Users/Administrator/Desktop/10x_raw'

list.files(data_dir) # Should show barcodes.tsv.gz, features.tsv.gz, and matrix.mtx.gz
[1] "GSM7494257_AML16_DX_raw_barcodes.tsv.gz" "GSM7494257_AML16_DX_raw_genes.tsv.gz"   
[3] "GSM7494257_AML16_DX_raw_matrix.mtx.gz"  

data <- Read10X(data.dir = data_dir)
Error in Read10X(data.dir = data_dir) : 
  Barcode file missing. Expecting barcodes.tsv.gz

seurat_object = CreateSeuratObject(counts = data$`Gene Expression`)
Error in data$`Gene Expression` : 
  object of type 'closure' is not subsettable

I am sure this file inside the directory. Dose anyone know what's the issue?

Thanks in advance.

$\endgroup$
1
  • 1
    $\begingroup$ The list.files line demonstrates that the precise files it's looking for are not there. What do you mean by "I am sure this file inside the directory"? Can you show a listing of files in the directory that you are trying to read from? $\endgroup$
    – gringer
    Commented Apr 7 at 12:04

1 Answer 1

1
$\begingroup$

It is been a while since the last time I have done this, but the problem seems to be your filenames. For example Read10X() is expecting a file barcodes.tsv.gz but you seem to have sample prefixes in your file names GSM7494257_AML16_DX_raw_barcodes.tsv.gz.

If I remember correctly, cellranger outputs a directory sth like sample-name/outs/ and this outs dir contains barcodes.tsv.gz, genes.tsv.gz, matrix.mtx.gz that Seurat can easily read.

$\endgroup$
1
  • $\begingroup$ Thank you much, you are right! Exactly the name without prefixes. $\endgroup$
    – Kent Yang
    Commented Apr 9 at 0:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.