dcellwanger/CellTrails

Unable to store layout in trajLayout() and stateTrajLayout()

Closed this issue · 2 comments

Hello CellTrails developers,

I'm running into the following error messages whenever I'm attempting to store my graph layouts to the SingleCellExperiment object:

p <- plotStateTrajectory(sce_obj, color_by="phenoName", name="state", component=1, point_size=1.5, label_offset=4)
stateTrajLayout(sce_obj) <- p

Error in stateTrajLayout<-(*tmp*, value = list(data = list(), layers = list( :
No proper layout information detected.

Here's the following error message when attempting to store my graphml plot:

tl <- read.ygraphml("../data/updated_yed_celltrails.graphml")

plot(tl[,1:2], axes=FALSE, xlab="", ylab="", pch=20, cex=.25)

trajLayout(sce_obj, adjust=TRUE) <- tl

Error in ext[[class2]] : no such index at level 1

To my understanding, storing the layout in the SingleCellExperiment is necessary to perform the plotMap function.
Any suggestions on how to proceed is greatly appreciated! Thank you!

Update:

It seems the error message in the stateTrajLayout function went away after I added the recalculate = TRUE parameter to the plotStateTrajectory function, however the error message for storing the tl dataframe in trajLayout still persists.

I've checked the structure of the tl dataframe and it looks like the sample names and coordinates are placed correctly (samples = rows, coordinates = columns 1 &2)

> str(tl)

'data.frame': 3758 obs. of 3 variables:
$ x1 : num 76502 22916 19181 58460 80850 ...
$ x2 : num -25352 -66285 -89538 -6036 -11173 ...
$ shape: chr "ellipse" "ellipse" "ellipse" "ellipse" ...

I've also checked to make sure that the rownames and length of the tl dataframe matches the sampleNames() and length of the SingleCellExperiment object so I'm not sure of there's anything else I'm missing

> grep("FALSE",rownames(tl) %in% sampleNames(sce_obj))

integer(0)

> length(rownames(tl))

[1] 3758

> length(sampleNames(sce_obj))

[1] 3758

Any suggestions on how to proceed is greatly appreciated!

Update:

This issue was resolved after updating to R version 3.6.3