Strange plot with phylo.integration

199 views
Skip to first unread message

lowiea...@gmail.com

unread,
Feb 17, 2021, 12:01:20 PM2/17/21
to geomorph R package
Hi everybody,

It's me, again! Sorry!

I performed 2BPLS using 'two.b.pls(B1,B2)' function with Shape coords as block 1 and a matrix with force measurements as block 2 (r-PLS=0.6, p=0.8). So far so good.

Once I include my phylogeny using 'phylo.integration (B1,B2,phy)', the summary gives me a r-PLS=1 (and a p=0.001), which means than all my points are aligned on a perfect diagonal. 

My tree is of class phylo. BUT dim(tree)=NULL, I don't know if that could tell you something. Sometimes, I have to change the order between B1 and B2 to get a result, otherwise R says 'r in La.svd(S12, 1, 1) : a dimension is zero'

I think it's a pretty weird result and I guess I have made, again, a mistake somewhere that could explain why my r-PLS is 1 and thus why is my plot so weird.

Thanks!

Aurélien


Adams, Dean [EEOB]

unread,
Feb 17, 2021, 7:30:19 PM2/17/21
to geomorph-...@googlegroups.com

Aurélien,

 

For the force measurements, are these a matrix of values, or a vector of a single measurement? We’ve been looking into possible issues, but having a bit more information would be helpful for your situation.


Best,

 

Dean

 

Dr. Dean C. Adams

Director of Graduate Education, EEB Program

Professor

Department of Ecology, Evolution, and Organismal Biology

Iowa State University

https://www.eeob.iastate.edu/faculty/adams/

phone: 515-294-3834

--
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/2896b49c-7bf6-48f0-ae91-83bcfa191921n%40googlegroups.com.

lowiea...@gmail.com

unread,
Feb 18, 2021, 2:54:02 AM2/18/21
to geomorph R package
Thank you Dean,

class(B1) returns "matrix" "array" for the shape. 

For B2 I tried differents options: B2 with a single column for the force. class(B2) returns "numeric", so I transformed into a matrix using "as.matrix (B2)". I also tried to use the force in three directions for B2, so with 3 columns as a "matrix "array". 

Same result with these three scenarios, two.b.pls is working but once I use phylo.integration r-PLS=1. 

The tree is a maximum credibility tree from 10 000 trees downloaded through vertlife. 

I also tried to go through a geomorph data frame and run the function as follows: 'phylo.integration(gdf$Coords, gdf$Force, gdf$phy)' but same result, it's working but r-PLS=1

Best,

Aurélien
 


Mike Collyer

unread,
Feb 18, 2021, 7:51:54 AM2/18/21
to geomorph R package
Aurélien,

I found a typo (missing character) that would affect the second data set, only if it were not a 3D array, which is why the order of input would make a difference.  (The typo was that A2 was referenced as A, which would replace the second matrix with the first, and would explain the correlation of 1.)

I have fixed the bug and uploaded a new version of the function on Github.  I would appreciate knowing if this solved the problem.  Please note that correlation should be the same, irrespective of order of input, but the Z-scores and P-values might be slightly different (but not qualitatively different), as the matrix that is randomized changes when the order is changed.

I hope this resolves your issue.

Mike

lowiea...@gmail.com

unread,
Feb 18, 2021, 8:37:17 AM2/18/21
to geomorph R package
Thank you Mike, I updated the package and the problem is solved! :)

Best,

Aurélien

Vasco Avramo

unread,
May 27, 2024, 4:45:16 AM5/27/24
to geomorph R package
Dear all,

I reply to this tread because I think I have a similar problem. I run the 'two.b.pls function to test the covariation between shape (Procustes coordinates) and the diet habits of different species, expressed as a matrix of the relative proportion of the food type (fig. diet_matrix) and it seems to work well (fig. two.b.pls). When I try the phylo.integration function to include the phylogenetic signal in the analysis the output is quite weird (fig. phylo.integration, and I am sure the class "phylo" object is correct, it works well with all other analysis). Could you help me to understand where is the problem or if I did something wrong?

Thank you very much

Vasco Avramo
two.b.pls.png
diet_matrix.png
phylo.integration.png

Adams, Dean [EEOB]

unread,
May 27, 2024, 5:23:09 PM5/27/24
to geomorph-...@googlegroups.com

Vasco,

 

Without the phylogeny it is challenging to respond to this. Once data are conditioned on the phylogeny things can change considerably. So the shift in the plot that you observed is possible. It may also be the code you are using. Hard to tell without more information.

 

Dean

 

Dr. Dean C. Adams

Distinguished Professor of Evolutionary Biology

Department of Ecology, Evolution, and Organismal Biology

Iowa State University

Vasco Avramo

unread,
May 30, 2024, 9:57:28 AM5/30/24
to geomorph-...@googlegroups.com
Dear Prof. Adams,

thank you for your response. I checked the phylo file and it seems to be ok, I don't know where the problem could be. I would send the file but without the whole dataset doesn't make sense. Anyway, thank you again for the feedback, I will try to figure out how to solve this problem.

Best

Vasco

Reply all
Reply to author
Forward
0 new messages