waldronlab / VisiumIO

Import spaceranger output and 10X spatial data
0 stars 0 forks source link

I am not able to open a visium image #3

Open alosdiallo opened 1 month ago

alosdiallo commented 1 month ago

Hi I am trying to load some 10x Visium data using TENxVisiumList, but am not able to load the data at all. I have verified that the data is there and in the correct form:

file.exists("/Users/adiallo/Desktop/Thesis/Data_Documents/All_Data/Visium_samples/Visium_Data/data/0_B11-10_A5/outs/filtered_feature_bc_matrix.h5") [1] TRUE file.exists("/Users/adiallo/Desktop/Thesis/Data_Documents/All_Data/Visium_samples/Visium_Data/data/0_B11-10_A5/outs/spatial/tissue_lowres_image.png") [1] TRUE file.exists("/Users/adiallo/Desktop/Thesis/Data_Documents/All_Data/Visium_samples/Visium_Data/data/0_B11-10_A5/outs/spatial/scalefactors_json.json") [1] TRUE

However I just can't seem to get the function to work:

library(SpatialExperiment) library(VisiumIO)

Define the correct path to the 'outs' directory

data_dir <- "/Users/adiallo/Desktop/Thesis/Data_Documents/All_Data/Visium_samples/Visium_Data/data/0_B11-10_A5/outs"

Check if the necessary directories and files exist

if (!dir.exists(data_dir)) {

  • stop("The specified data directory does not exist.")
  • } if (!file.exists(file.path(data_dir, "filtered_feature_bc_matrix.h5"))) {
  • stop("The filtered_feature_bc_matrix.h5 file does not exist.")
  • } if (!file.exists(file.path(data_dir, "spatial/tissue_lowres_image.png"))) {
  • stop("The tissue_lowres_image.png file does not exist.")
  • } if (!file.exists(file.path(data_dir, "spatial/scalefactors_json.json"))) {
  • stop("The scalefactors_json.json file does not exist.")
  • }

Try to load the data

spe <- TENxVisiumList(

  • sample_id = "sample01",
  • sampleFolders = data_dir,
  • spatialCoordsNames = c("x", "y"),
  • imageSources = file.path(data_dir, "spatial/tissue_lowres_image.png"),
  • scaleFactors = file.path(data_dir, "spatial/scalefactors_json.json")
  • ) Error: The 'outs' or 'filtered_feature_bc_matrix' directory was not found. Verify 'spacerangerOut' and 'processing' inputs.

Any advice or help would be greatly appreciated. Thank you!

R version 4.4.1 (2024-06-14) Version 1 of VisiumIO

LiNk-NY commented 1 month ago

Hi @alosdiallo I think you need to use the

/Users/adiallo/Desktop/Thesis/Data_Documents/All_Data/Visium_samples/Visium_Data/data/0_B11-10_A5

folder as input rather than ./outs.

alosdiallo commented 4 weeks ago

Hi @LiNk-NY I apologize for the delayed response. I will give that a shot. Thank you!