Open wuxiangning opened 1 month ago
Hello, I am not exactly sure what you need. What is it, that you run that only returns 'histology'? getSpatSegmVarNames()
? Do you want to group your spots based on histology by interactively creating a grouping variable as with createSpatialSegmentation()
and you can't access it afterwads?
I mean, I want to create a pathology segmentation that I draw it refer to the tumor, invasion front, and normal area by createSpatialSegmentation(object), and then form a histology like the one you referred to in the tutorial, so that I can follow the tutorial and do the subsequent Spatial Trajectories Analysis. But if I run createSpatialSegmentation(object) to create spatial orientations directly, which seems to be a no-brainer,But I can't directly indicate histology here can you tell us how you implemented the creation histology at that time?
There is another problem that has been bothering me for a long time, when I want to use Bayesian for spatial clustering, this error appears. But I look in my SPATA2, the coords_df information is stored in the object@spatial@coordinates, how can I solve this problem, Thank you very much.
object <- #!c("col", "row" %in% colnames(coords_df)): 参数类型无效
- runBayesSpaceClustering(
- object = object,
- name = "bayes_space", # the name of the output grouping variable
- qs = 5
- ) 错误于!c("col", "row" %in% colnames(coords_df)): 参数类型无效
okay, so regarding the spatial segmentation. On the left, you need to create a variable first in which to store the histological labels (a column in the meta data.frame). I refer to these as spatial segmentation variables because you spatially divide the sample into multiple segments. You have not done that yet - at least in the screenshot you provide. Click on "Create New Segmentation Variable" and a pop up will appear which prompts you to enter a name, for instance 'histology' or 'histo_segmentation'. Then, on the left a surface plot appears colored by this variable which will be all grey cause you haven't added any segments so far. THEN you use the Interaction field to repeatedly encircle areas, highlight them, name them and save these labels which should immediately update the plot on the left (Overview).
regarding bayes space clustering. Which branch are you currently using? master or dev? And what is the output of getCoordsDf()
?
Hello! This is my getCoordsDf() .It looks pretty normal.Right? But I don't quite understand where my branch looks? Is that my Github branch?
I've tried your tutorial before, but I still can't create two spatial segmentation variables under the named histology to indicate the tumor or normal.Whether there is a problem with which step? Thanks!
There is a button below the segmentation plot called 'Name' as in "name this segment". Next to it is an empty text input in which you can enter the name of the segment. Then you clik on 'Name' which should save the segment and it should appear colored on the left.
You can only name one segment at a time. In this plot you have created two "outlines". The error message on the right bottom indicates that the second outline is not inside the first one. Only draw a second outline you want to use this outline to to create "holes" in the first outline.
Make sure to return the SPATA2 object by closing the app with the green button that says 'Close application'. Furthermore, make sure to reassign the results. my_object <- createSpatialSegmentation(my_object)
.
Regarding the BayesSpace: It is a bug. I'll fix it and let you know once I updated the package.
Can you install the dev branch with devtools::install_github("theMILOlab/SPATA2", "dev")
in a session that has just been started with no packages attached? Then try runBayesSpaceClustering()
again. Does it work now?
![Uploading 0bc56a63cb3ae72ccbd02bfc94b5dce.jpg…]()
R Code: remove.packages("SPATA2") detach("SPATA2") library(devtools) devtools::install_github("theMILOlab/SPATA2","dev") library(SPATA2) getGroupingOptions(object) object<- runBayesSpaceClustering( object = object, name = "bayes_space", # the name of the output grouping variable qs = 5 ) Hello: I re-uninstalled my SPATA2 with the above code, and after reinstalling, after importing my SPATA2 object, I found that there was no way to import the full spata2, it seemed that the contents were empty and could not do all the normal operations.
Wow, this is a great method! I missed the part about naming first. However, I encountered two new issues when drawing: 1、First: I can’t perfectly draw the boundaries between the tumor, peritumoral region, and normal tissue as I intended. Is there a way I could roughly outline the boundaries between the tumor and normal tissue, and then have the rest of the area automatically labeled as the peritumoral region? That way, the defined tissue regions can be perfectly segmented. 2、Additionally, I found that createSpatialSegmentation(object) doesn't work like object <- createImageAnnotations(object) where I can annotate multiple areas , and createSpatialSegmentation(object) only allows single annotations. Is there a way to annotate multiple regions at once and assign them the same name? Currently, I can only annotate one by one and assign the same name to each, which is quite tedious. Moreover, I can only see the defined areas in the overview on the left and can't directly see the defined regions in the drawing area, which is not very convenient.
object <- renameGroups(object, grouping = "histology", "new_name" = "unnamed")
. This way you only annotate the tumor regions and what is left unnamed becomes your input for 'new_name'. I still haven't solved the problem of spatial clustering, I use the following code to try to fix the bug, but it still doesn't work
R Code: remove.packages("SPATA2") detach("SPATA2") library(devtools) devtools::install_github("theMILOlab/SPATA2","dev") library(SPATA2) getGroupingOptions(object) object<- runBayesSpaceClustering( object = object, name = "bayes_space", # the name of the output grouping variable qs = 5 ) Hello: I re-uninstalled my SPATA2 with the above code, and after reinstalling, after importing my SPATA2 object, I found that there was no way to import the full spata2, it seemed that the contents were empty and could not do all the normal operations.
What do you mean with no way to import the full SPATA2? Did an error occur when calling library(SPATA2)
? If so: Whats the error?
Fruthermore, I noticed that your point size in the application is too large which makes the highlighted spots seem to transgress the outline you have drawn. This is not the case. Decreasing the point size will help!
how to get histology in SPATA2? I run it but only get NULL> getSpatSegmVarNames(object)#空值,curently only one: "histology" No segmentation variables have been added. Use 'createSpatialSegmentation()' for that matter. NULL i try to draw something:object <- createImageAnnotations(object) or object <- createSpatialSegmentation(object) but it only be defined one ids like infilitrated_ids! help!