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

An error from createGiottoCosMxObject() with the Giotto 3.0 #433

Closed
GCatatGC opened this issue Nov 19, 2022 · 7 comments · Fixed by #455
Closed

An error from createGiottoCosMxObject() with the Giotto 3.0 #433

GCatatGC opened this issue Nov 19, 2022 · 7 comments · Fixed by #455

Comments

@GCatatGC
Copy link

Hi.
I am excited for the saveGiotto() function in new version 3.0, so I installed it today (3pm, 11/19/2022).
And I was following the tutorial of Cosmx (https://giottosuite.readthedocs.io/en/latest/subsections/datasets/Nanostring_Lung12_jan26_21.html).
On CosMx Project loading function chapter, I got an error:

fov_join = createGiottoCosMxObject(cosmx_dir = data_path,
                                    data_to_use = 'subcellular',
                                    FOVs = c(2,3,4),
                                    instructions = instrs)

A structured CosMx directory will be used

Checking directory contents...
--| CellLabels folder found
--| CompartmentLabels folder found
--| CellComposite folder found
--| CellOverlay folder found
--| transcript locations file found
--| fov positions file found
--| expression matrix file found
--| metadata file found
Directory check done
Loading subcellular information...
Subcellular load done
Starting FOV 002
Loading image information...
Image load done
Building subcellular giotto object...

  1. Start extracting polygon information
    polygonlist is a list with names
    [ cell ] Process polygon info...
    Error in match.arg(mask_method, choices = c("guess", "single", "multiple")) :
    'arg' must be NULL or a character vector

Unfortunately, I did not save the previous version (Giotto 2.0).

Can we fix this error in Giotto3.0? Because I really want to use the saveGiotto() function.

@RubD
Copy link
Collaborator

RubD commented Nov 20, 2022

The createGiottoCosMxObject is probably not yet updated, but the step-by-step workflow might work. This would mean starting from #2 and not use the convenience function.

@GCatatGC
Copy link
Author

The createGiottoCosMxObject is probably not yet updated, but the step-by-step workflow might work. This would mean starting from #2 and not use the convenience function.

Hi RubD,
Thanks for your reply.
I ran step-by-step workflow and it resulted into similar error.

fovsubset = createGiottoObjectSubcellular(gpoints = list('rna' = tx_coord), gpolygons = list('cell' = segmentation_mask), polygon_mask_list_params = list(mask_method = 'guess', flip_vertical = TRUE, flip_horizontal = FALSE, shift_horizontal_step = FALSE), instructions = instrs)
and got:

  1. Start extracting polygon information
    polygonlist is a list with names
    [ cell ] Process polygon info...
    Error in match.arg(mask_method, choices = c("guess", "single", "multiple")) :
    'arg' must be NULL or a character vector

@RubD
Copy link
Collaborator

RubD commented Nov 20, 2022

Thanks @GCatatGC for letting us know. I've pushed a fix for this problem. It should work now.

@GCatatGC
Copy link
Author

Thanks @GCatatGC for letting us know. I've pushed a fix for this problem. It should work now.

Thanks a lot ! It works now.

@GCatatGC
Copy link
Author

GCatatGC commented Nov 22, 2022

Thanks @GCatatGC for letting us know. I've pushed a fix for this problem. It should work now.

Hi RubD,
I got a new error when I ran "Annotate Giotto object" part, in the tutorial of Nanostring_Lung1

#add cell types

clusters_cell_types_lung = c('Normal Epithelial', 'Cancer', 'Stromal', 'Plasma Cells',
                             'Cytotoxic T Cells', 'Cancer Stem Cells',
                             'Macrophage', 'Memory B Cell', 'Memory B Cell')

names(clusters_cell_types_lung) = as.character(sort(cluster_order))

fov_join = annotateGiotto(gobject = fov_join,
                          annotation_vector = clusters_cell_types_lung,
                          cluster_column = 'leiden_clus')

plotUMAP(fov_join,
         cell_color = 'cell_types',
         point_size = 1.5)

The Error is:
Error in get_cell_metadata(gobject, spat_unit = spat_unit, feat_type = feat_type, :
metadata referenced is not cellMetaObj

@jiajic jiajic linked a pull request Nov 30, 2022 that will close this issue
@jiajic
Copy link
Member

jiajic commented Dec 1, 2022

Hi RubD, I got a new error when I ran "Annotate Giotto object" part, in the tutorial of Nanostring_Lung1

#add cell types

clusters_cell_types_lung = c('Normal Epithelial', 'Cancer', 'Stromal', 'Plasma Cells',
                             'Cytotoxic T Cells', 'Cancer Stem Cells',
                             'Macrophage', 'Memory B Cell', 'Memory B Cell')

names(clusters_cell_types_lung) = as.character(sort(cluster_order))

fov_join = annotateGiotto(gobject = fov_join,
                          annotation_vector = clusters_cell_types_lung,
                          cluster_column = 'leiden_clus')

plotUMAP(fov_join,
         cell_color = 'cell_types',
         point_size = 1.5)

The Error is: Error in get_cell_metadata(gobject, spat_unit = spat_unit, feat_type = feat_type, : metadata referenced is not cellMetaObj

Hi @GCatatGC, thank you for letting us know about this error.
createGiottoCosMxObject() has been partially updated for the 'subcellular' workflow in the 3.1 update (#458). The issue with annotateGiotto() was also addressed.

The CosMx tutorial has also been updated.

@GCatatGC
Copy link
Author

GCatatGC commented Dec 2, 2022

Thanks a lot for all the remarkable work!

@jiajic jiajic closed this as completed Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants