Hi guys,
I hope you are well, I just want to make sure I am understanding the workflow of Slicermorph and SlicermorphR correctly. Apologies if this seems simple but I must have have an error somewhere and it is driving me
When looking at the SlicermorphR page my code is essentially the same
##set your working directory!
files=dir(patt='json')
fixed.LMs <- 1:2
semi.LMs <- 3:82
#Array is LAND, DIM, IND
#where LAND is the number of landmarks
#where DIM is the number of dimensions
#where INd is the number of individuals
samples=gsub(".json","",fixed=T, files)
LMs <- array(dim=c(82,3,10))
for (i in 1:10) LMs[,,i] = read.markups.json(files[i])
dimnames(LMs) <- list(paste0("LM_",1:82), c("x", "y", "z"), samples)
#read in the curves file
curves<-as.matrix(read.csv("curves.csv", header=FALSE))
#completes a GPA without sliding
defaultGPA<- gpagen(A=LMs, surfaces = semi.LMs, ProcD = TRUE)
This runs and completes without issue, and everything is great, it is sliding that seems to be an issue.
If I understand correctly, I will run a PCA based on the newly acquired GPA.
Something like this:
DefaultPCA = gm.prcomp(defaultGPA$coords)
If I am sliding by Procrustes distance, it would look like this:
PDGPA<- gpagen(A=LMs, curves=curves, surfaces = semi.LMs, ProcD = TRUE)
then
PDPCA = gm.prcomp(PDGPA$coords)
Then, to get it out, it would be the following?
geomorph2slicermorph2(gpa=defaultGPA, pca=DefaultPCA, paste0(output.path, "sliding'))
geomorph2slicermorph2(gpa=PDGPA, pca=PDPCA, paste0(output.path, "PDsliding')).
This then would give me files that I could then put back into Slicermorph to do visual analysis, correct?
Apologies again, I’ve been really wracking my brain on what is going wrong today.