Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

giotto data loading error #1132

Open
fengyun198503 opened this issue Mar 24, 2025 · 3 comments
Open

giotto data loading error #1132

fengyun198503 opened this issue Mar 24, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@fengyun198503
Copy link


name: error
about: giotto data loading

title: ''giotto data loading error
labels: ''
assignees: ''


Describe the Error

Hi Sir,
I analyzed CosMx data using Giotto and used the following command to save my processed data:
saveGiotto(gobject = fov_join,
foldername = 'giotto_test_fov',
dir = 'O:/Data_test/')
However, when I tried to load the saved data using:
N1 = loadGiotto(path_to_folder = file.path("O:/Data_test", 'giotto_test_fov'))
I encountered the following error:
4. read Giotto image information
Error in .image_path_checks(path) :
No filepath recorded in image object and no 'path' value provided.

@fengyun198503 fengyun198503 added the bug Something isn't working label Mar 24, 2025
@RubD
Copy link
Collaborator

RubD commented Mar 27, 2025

Can you share the Giotto version you're using and any important system or package information?

And can you reproduce this with a publicly available cosmx dataset? That way we can test ourselves.

Thanks

@fengyun198503
Copy link
Author

fengyun198503 commented Mar 27, 2025 via email

@jiajic
Copy link
Member

jiajic commented Mar 28, 2025

Hi @fengyun198503, sorry about the delay.

I can't seem to replicate the error. (see below for what I ran)

Maybe something happened during image saving and lost the file paths somehow. I'd be curious to see the contents of your save directory's images subdirectory and if it contains the expected _spatRaster and .aux.xml files.

Getting around the load error

You should be able to get around the error blocking loading by loading with reconnect_giottoImage = FALSE

N1 <- loadGiotto("path to data", reconnect_giottoImage = FALSE)

The images can then be updated by using the CosMx importer utility.

cosmx <- importCosMx("path to cosmx directory")
cosmx$version <- "legacy"
composite_imgs <- cosmx$load_images("path to cosmx directory/CellComposite/")
N1 <- setGiotto(N1, composite_imgs)

Note about saving

If you don't need to put all your image files together with the rest of the Giotto project, you can also skip re-exporting and just link to the originals from the source CosMx data directory.

saveGiotto(fov_join, dir = "save location", export_image = FALSE)

Replication attempt

f <- "../../local_items/nanostring/Lung12-Flat_files_and_images/"
library(Giotto)
# loading a legacy type dataset
g <- createGiottoCosMxObject(f, version = "legacy")
test <- tempdir()
saveGiotto(g, dir = test, method = "qs")
1. Start writing feature information
For feature: rna
For feature: negprobes
2. Start writing spatial information
For spatial information: cell
3. Start writing image information
For image information: composite_fov001
For image information: composite_fov002
For image information: composite_fov003
For image information: composite_fov004
For image information: composite_fov005
For image information: composite_fov006
For image information: composite_fov007
For image information: composite_fov008
For image information: composite_fov009
For image information: composite_fov010
For image information: composite_fov011
For image information: composite_fov012
For image information: composite_fov013
For image information: composite_fov014
For image information: composite_fov015
For image information: composite_fov016
For image information: composite_fov017
For image information: composite_fov018
For image information: composite_fov019
For image information: composite_fov020
For image information: composite_fov021
For image information: composite_fov022
For image information: composite_fov023
For image information: composite_fov024
For image information: composite_fov025
For image information: composite_fov026
For image information: composite_fov027
For image information: composite_fov028
For image information: overlay_fov001
For image information: overlay_fov002
For image information: overlay_fov003
For image information: overlay_fov004
For image information: overlay_fov005
For image information: overlay_fov006
For image information: overlay_fov007
For image information: overlay_fov008
For image information: overlay_fov009
For image information: overlay_fov010
For image information: overlay_fov011
For image information: overlay_fov012
For image information: overlay_fov013
For image information: overlay_fov014
For image information: overlay_fov015
For image information: overlay_fov016
For image information: overlay_fov017
For image information: overlay_fov018
For image information: overlay_fov019
For image information: overlay_fov020
For image information: overlay_fov021
For image information: overlay_fov022
For image information: overlay_fov023
For image information: overlay_fov024
For image information: overlay_fov025
For image information: overlay_fov026
For image information: overlay_fov027
For image information: overlay_fov028
rm(g)
gc()

N1 <- loadGiotto(file.path("/var/folders/1q/p0kr6d017wv4d6_39pcpt18w0000gn/T//RtmpYagEk6/saveGiottoDir/"))
spatPlot2D(N1, point_size = 0.5, show_image = T, image_name = sprintf("composite_fov%03d", 1:28))

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants