navinlabcode / CellTrek

103 stars 18 forks source link

Dealing with spatial data with merged samples #31

Open Kennyluo4 opened 1 year ago

Kennyluo4 commented 1 year ago

Hello, I try to use CellTrek to merge my spatial and single-cell data. However, I had this error when running the traint ():

Cannot add more or fewer cell meta.data information without values being named with cell names

I found out that it is caused by st_data$coord_x <- st_data@images[[1]]@coordinates[, coord_xy[1]].

The spatial data is merged from two different samples. Therefore, the total spot number in the meta.data is larger if only images[[1]] coordinates are loaded.

The two spatial samples are replicates so I don't want to remove it. Is there a way I can load the merged st object for this analysis?

Thanks, Ziliang