ludvigla / semla

Other
62 stars 5 forks source link

'Staffli' object missing #3

Closed YangXuuu closed 1 year ago

YangXuuu commented 1 year ago

Hi

I am using self-generated Seurat object (based on feature, matrix, barcode) rather than Visium, how could I add the 'Staffli' object to my Seurat object to avoid the following error? Thanks!

Error in .check_seurat_object(): ! This Seurat object does not appear to have been processed with semla. ✖ 'Staffli' object is missing from tools slot. Run rlang::last_trace() to see where the error occurred.

ludvigla commented 1 year ago

Hi!

You should be able to load the feature, matrix, barcode files with ReadVisiumData.

I'm planning to include a short tutorial on our website soon. But meanwhile you can have a look at the documentation for CreateStaffliObject: https://ludvigla.github.io/semla/reference/CreateStaffliObject.html

You will need to make sure that the Staffli object matches the Seurat object. Most importantly, the barcode IDs in the Staffli object meta_data slot should be identical to the IDs in the Seurat object. The Staffli object is then placed in the tools slot of the Seurat object. I'll post a link to the tutorial when it's available.

/Ludvig

YangXuuu commented 1 year ago

Thanks for your reply!

ludvigla commented 1 year ago

In case you are still looking for more information about how to create a Staffli object: https://ludvigla.github.io/semla/articles/create_object.html

/Ludvig

YangXuuu commented 1 year ago

Thanks for this, really helpful!

rijangrg commented 1 year ago

Hi,

Thanks for the link to creating a Staffli object and a Seurat object compatible with Semla. I've tried to create it using both methods described in the two webpages:

https://ludvigla.github.io/semla/reference/CreateStaffliObject.html and https://ludvigla.github.io/semla/articles/create_object.html

However, I keep getting stuck at the end step which is the final #Create Staffli object I always seem to get an error at the end.

staffli_object <- CreateStaffliObject(imgs = he_imgs, meta_data = coordinates, image_info = image_info, scalefactors = scalefactors) Error in CreateStaffliObject(imgs = he_imgs, meta_data = coordinates, : unused arguments (meta_data = coordinates, image_info = image_info, scalefactors = scalefactors)

Any help would be much appreciated!

rijangrg commented 1 year ago

I think I just had to update my R studio for Semla to work... many thanks!