drighelli / SpatialExperiment

55 stars 20 forks source link

spatialCoords should not be stored in the colData when built from it #53

Closed drighelli closed 3 years ago

drighelli commented 3 years ago

At the moment when building the spatialCoords and spatialData from the colData the object still stores the coordinates into the colData, a possible solution could be to drop them when storing elsewhere.

A reproducible example

cd <- DataFrame(x=1:26, y=1:26, z=letters)
mat <- matrix(nrow=26, ncol=26)
spe <- SpatialExperiment(assay=mat, colData=cd, spatialCoordsNames=c("x", "y"), spatialDataNames="z")
spatialData(spe)
head(spatialCoords(spe))
colData(spe)
HelenaLC commented 3 years ago

resolved by PR #54