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

create a squidpy or R object using baysor output #126

Open
shrutikhare-git opened this issue Jun 20, 2024 · 3 comments
Open

create a squidpy or R object using baysor output #126

shrutikhare-git opened this issue Jun 20, 2024 · 3 comments
Labels
question Further information is requested

Comments

@shrutikhare-git
Copy link

Hi, I want to use baysor segmentation on my CosMx data and then visualize it in R/Python. CosMx usually outputs 5 files which are used by Seurat/Squidpy to create the object - metadata, tx, polygons, fov positions, exprMat. Can you please guide - how to reformat/create these 5 files to incorporate baysor segmentation?
Thanks!

@seigfried
Copy link

seigfried commented Jul 3, 2024

I tried running a Baysor and made my own files. However I still get this error

Error in data.frame(x = md$CenterX_global_px, y = md$CenterY_global_px, :
arguments imply differing number of rows: 0, 85911

I compared all columns and realised I did not have CenterX_local_px, CenterY_local_px, CenterX_global_px, CenterY_global_px in my metadata
I tried to manually calculate this by taking the information from a polygons.csv of a different experiement and then calculated the centroid i.e. x1+x2+...+xn/n
The results were close but not exactly the same as the CenterX_local_px, CenterY_local_px, CenterX_global_px, CenterY_global_px given in the metadata

So yes, my questions is also how I can convert Baysor output to say, a SquidPy or Seurat object

@VPetukhov VPetukhov added the question Further information is requested label Jul 24, 2024
@VPetukhov
Copy link
Collaborator

The names are different between Baysor output and CosmX. segmentation_cell_stats.csv contains cell features, particularly x, y and z columns contain cell centroid coordinates. So, I'd suggest to simply reading segmentation_cell_stats.csv and setting it as Seurat metadata.

@shrutikhare-git
Copy link
Author

I reformatted all baysor output to match CosMx output formats which involved calculating the centroids as well. But after loading the object in R, the cells look weird. Any ideas about what may be causing this? Thanks!
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants