PLS scores to warp a mesh

150 views
Skip to first unread message

lowiea...@gmail.com

unread,
Jul 2, 2021, 6:16:50 AM7/2/21
to geomorph R package
Hi everyone,

I just did a two.b.pls with quantitative muscle data as block 2 and skull shape as block 1. I would like to wrap a mean shape towards the extremes of the PLS1 Block1 to assess the shape variation in my skull along this axis.

However, as I only have 7 muscles in my block 2, the PLS$XScores returns 7 columns as well. And thus it's not matching anymore the amount of landmark from my mean shape... 

Is there a way to get new matrices with new coordinates after the 2BPLS?
I guess that using the coordinates from a PCA instead is not really correct? The shape variation is probably different as here I take my muscles into account, right? 

Thank you! 

Best,

Aurélien 

Adams, Dean [EEOB]

unread,
Jul 2, 2021, 7:17:43 AM7/2/21
to geomorph-...@googlegroups.com
See the shape.predictor help file.

Dean


From: geomorph-...@googlegroups.com <geomorph-...@googlegroups.com> on behalf of lowiea...@gmail.com <lowiea...@gmail.com>
Sent: Friday, July 2, 2021 5:16:50 AM
To: geomorph R package <geomorph-...@googlegroups.com>
Subject: [geomorph-r-package] PLS scores to warp a mesh
 
--
You received this message because you are subscribed to the Google Groups "geomorph R package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/3e04afc1-739b-4df4-9c3c-8719a0178910n%40googlegroups.com.

Mike Collyer

unread,
Jul 2, 2021, 8:19:46 AM7/2/21
to geomorph R package
Hi Aurélien,

PLS will always have left and right matrices with the number of columns matching the minimum of the columns of the two original matrices.  The reason is because a singular value decomposition (SVD) is performed on the matrix cross-products, which for p landmarks in k dimensions is either a pk x 7 or 7 by pk matrix product (in your case).  SVD can only produce 7 singular values this way, so only 7 vectors are produced.

Said another way, there are only 7 dimensions of **covariation** (not variation) between the sets of data.

As Dean noted, you can get coordinates from shape.predicter along any of these 7 dimensions (or all of them) to see how shape changes along these axes.  However, it is a different thing to asses “shape variation” along these axes as it is shape covariation that is represented.

Another thing you could do is save your two.b.pls plot — e.g., myplot <- plot(my.two.b.pls) — and use picknplot.shape.  Then you can click on points at the block 1 extremes to generate warp grips.  You will notice when you do this that a vertical line forms and if you subsequently pick a point anywhere on that line, you will get the same warp grid.  This is because even though it looks like a 2-dimensional space, the shape change is merely along a single axis, which is the first block PLS1.  This is the only way to model shape covariation between your sets of data.   

No matter how you go about it, I would encourage you to not think of “shape variation” in PLS plots.  The axis can reveal shape change associated with covariation between sets of data, but looking at the plots the same way one would look at a PC plot can be misleading.

Cheers!
Mike

lowiea...@gmail.com

unread,
Jul 2, 2021, 10:33:04 AM7/2/21
to geomorph R package
Thanks Dean and Mike!

Yes, I agree, I should have say covariation. 

Indeed, both shape.predictor and picknplot.shape did the trick when I use Y.gpa$coords as block1 and Y.gpa$Csize as block2, like in the vignette. 

However, if I try with muscles and skull, the picknplot.shape shows me nonsense shapes. I am pretty sure I made a mistake somewhere, again, but could that be that I have weird shapes because the new coordinates from the PLS don't have something to do with the original shape anymore, because I included muscle data? 

Because, if I understood correctly, imagine you want to see the covariation between skull as one block and mandible in the other one. You perform the 2B-PLS and you play with picknplot.shape. Once you click, you only have 1 set of coordinates displayed in the viewer (X,Y) right? So, you wouldn't get a modified skull, or a modified mandible, but rather something mixing both sets of landmarks, no? A nonsense skull-mandible thing? 

I.e. I have my muscles on block 2 and skull on block 1. But I can't really interpret it because I don't know what's happening on PLS1 Block1 right? I know there is a covariation between muscle volume and skull shape (p=0.02; r-PLS= 0.92). Thanks to the "loadings" of block 2 I know how muscles volumes covary, but I don't know how shape is along PLS1 Block1... Am I right? 

test.png

Thanks again! 

Aurélien

Mike Collyer

unread,
Jul 2, 2021, 10:40:48 AM7/2/21
to geomorph R package
Aurélien,

Try switching your blocks around and see if that resolves things.  Let us know whether it worked or not.  There might be a glitch because shape.predictor (also used in picknplot.shape) is basically a linear regression tool to fit shapes predicted by scores.  What is difficult with PLS is that shape can be represented by either axis, and the function has to try to determine if the axis is a shape axis or other.  It is possible that our code for picknplot.shape gets mixed up regarding which axis is the shape axis.  Switching the blocks around might elucidate if that is the case.

Thanks!
Mike



On Jul 2, 2021, at 10:33 AM, lowiea...@gmail.com <lowiea...@gmail.com> wrote:

Thanks Dean and Mike!

Yes, I agree, I should have say covariation. 

Indeed, both shape.predictor and picknplot.shape did the trick when I use Y.gpa$coords as block1 and Y.gpa$Csize as block2, like in the vignette. 

However, if I try with muscles and skull, the picknplot.shape shows me nonsense shapes. I am pretty sure I made a mistake somewhere, again, but could that be that I have weird shapes because the new coordinates from the PLS don't have something to do with the original shape anymore, because I included muscle data? 

Because, if I understood correctly, imagine you want to see the covariation between skull as one block and mandible in the other one. You perform the 2B-PLS and you play with picknplot.shape. Once you click, you only have 1 set of coordinates displayed in the viewer (X,Y) right? So, you wouldn't get a modified skull, or a modified mandible, but rather something mixing both sets of landmarks, no? A nonsense skull-mandible thing? 

I.e. I have my muscles on block 2 and skull on block 1. But I can't really interpret it because I don't know what's happening on PLS1 Block1 right? I know there is a covariation between muscle volume and skull shape (p=0.02; r-PLS= 0.92). Thanks to the "loadings" of block 2 I know how muscles volumes covary, but I don't know how shape is along PLS1 Block1... Am I right? 

<test.png>

Thanks again! 

Aurélien

lv xiao

unread,
Jul 2, 2021, 1:13:02 PM7/2/21
to geomorph R package
Following the example in shape.predictor, I would like to confirm the following code is correct to predict shape at +3SD along PLS1 of the shape block:

data(plethShapeFood)
Y.gpa<-gpagen(plethShapeFood$land) #GPA-alignment
# 2B-PLS between head shape and food use data
PLS <-two.b.pls(A1 = plethShapeFood$food, A2 = Y.gpa$coords, iter=999)

preds <- shape.predictor(Y.gpa$coords, PLS$YScores[, 1], Intercept = FALSE, method = "PLS", pred1 = 3*sd(PLS$YScores[,1]))

Thank you.

Lv

Reply all
Reply to author
Forward
0 new messages