Read spatial data from GSM8557976 using Seurat
0
1
Entering edit mode
5 days ago
tujuchuanli ▴ 140

Hi,

I am trying to load the spatial data from GSM8557976 using Seurat. The dataset includes seven files: "barcodes.tsv.gz", "features.tsv.gz", "matrix.mtx.gz", "scalefactors_json.json.gz", "tissue_hires_image.png.gz", "tissue_lowres_image.png.gz", and "tissue_positions_list.csv.gz".

I`ve attempted several approaches but haven’t been able to read them successfully. Could you please help me import this data using Seurat?

Thanks in advance!

spatial data Seurat • 567 views
ADD COMMENT
0
Entering edit mode

Without knowing exactly what you tried, someone will suggest a solution and you will say that you already tried it. Then someone else will suggest a different solution, and you will again say that you already tried it. Hopefully, it is clear what you are supposed to do before we start guessing.

ADD REPLY
0
Entering edit mode

Hi Mensur Dlakic , Thank you for your reply and suggestions.

After several rounds of attempts, I have finally resolved the issue. Below is the code I used, and I hope it will be helpful to others who encounter the same problem.

As mentioned in my previous post, the dataset consists of seven files:

barcodes.tsv.gz
features.tsv.gz
matrix.mtx.gz
scalefactors_json.json.gz
tissue_hires_image.png.gz
tissue_lowres_image.png.gz
tissue_positions_list.csv.gz.

To proceed, we need to create two folders:

filtered_feature_bc_matrix
spatial

Place the first three files into the filtered_feature_bc_matrix folder, and the remaining four files into the spatial folder.

Then, run the following code. It will generate an object identical to the one produced by the Load10X_Spatial() function.

dir <- "./GSM8557976_BPH_1/"
counts <- Read10X(paste0(dir, "filtered_feature_bc_matrix/"))
BPH_1 <- CreateSeuratObject(counts = counts, project = "GSM8557976_BPH_1", assay = "Spatial")
image <- Read10X_Image(image.dir = paste0(dir, "spatial/"))
image <- image[Cells(x = BPH_1)]
DefaultAssay(image) <- "Spatial"
BPH_1[["slice1"]] <- image

Since this solution has not been fully validated, I warmly welcome any feedback or suggestions for improvement.

ADD REPLY
0
Entering edit mode

If you have recreated the spaceranger folder structure (spatial + fitlered), then Load10X_Spatial(dir) should work just fine. If it doesn't it might simply be that the files are compressed (.gz) probabily to save space. For more details, you should look at the function on seurat repo.

ADD REPLY

Login before adding your answer.

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