satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.24k stars 902 forks source link

Error in if (tools::file_ext(filename) == "parquet") { : the condition has length > 1 #9216

Closed JhannelleF closed 1 day ago

JhannelleF commented 1 month ago

I am trying to load my spatial transcriptomics data using the code: seurat_obj <- Load10X_Spatial(data.dir = data_dir.B2)

data_dir.B2 refers to the pathway to my Directory containing the H5 file specified.

The version of seruat is 5.0.1

When I run the code I keep getting the error: Error in if (tools::file_ext(filename) == "parquet") { : the condition has length > 1

How do I fix this?

alosdiallo commented 1 month ago

I can confirm that I am having the same issue with version 5.1.0

Read10X_Image(

  • image_dir,
  • image.name = "tissue_lowres_image.png",
  • assay = "Spatial",
  • slice = "slice1",
  • filter.matrix = TRUE
  • ) Error in if (tools::file_ext(filename) == "parquet") { : the condition has length > 1 Load10X_Spatial(data.dir = data_dir) Error in if (tools::file_ext(filename) == "parquet") { : the condition has length > 1
zezhuo commented 3 weeks ago

Removing the "Spatial/tissue_positions.csv" file works in Seurat v5.1.0 for me.

mhkowalski commented 1 day ago

Hi,

It seems like this error might be coming from having both a tissue_positions.csv and a tissue_positions.parquet file in your directory. I agree with @zezhuo that removing the csv file should fix the problem. Please let us know if you're continuing to have issues.