Disregard this previous post: I am going to stick with .tps files. I will 
have to append all of the individuals for each group first in order to do 
the between group analysis, but it's a method I know works. I hope I didn't 
waste anyone's time looking into this. 

Brenna


On Monday, April 4, 2016 at 5:47:59 PM UTC-4, Brenna Hays wrote:
>
> Hello All, 
> For my thesis project I am looking at the shape variations of crinoid 
> ossicles between species of a certain taxonomic family. I have completed my 
> within-species analysis and have saved the mean configurations of each 
> species for my between-species or "between-group" PCA. To test this out, I 
> compiled three species (three configurations) into a .txt file then 
> performed Procrustes superimposition on the matrix. All of the coding is 
> working fine, but I notice when I plot the superimposed configurations, not 
> all 3 are oriented together. Two of them are oriented to the left, and the 
> third is oriented to the right. These orientations are exactly the same as 
> how their mean configurations were saved (they didn't change after gpagen), 
> so it doesn't seem they were actually correctly superimposed upon each 
> other. 
> For my intra-species tests I was able to directly upload the coordinates 
> via a .tps file so the superimposition worked great. However, since I have 
> had to save mean configurations as the representative for each of my 
> species and compile them for the different between-group tests I will be 
> doing, the coding has been a bit different. I compiled the mean 
> configurations in Excel then exported it as a .txt file. 
> Below is my code. I have also attached the superimposed image with 
> joinline so you can see how one of oriented opposite of the other two. Any 
> help or thoughts on this matter would be greatly appreciated!
>
> > setwd("C:/Users/B/Documents/THESIS/Statistics/Scenario1/Antedonidae 
> incertae sedis")
> > AISdata <- read.table(file.choose("AIS matrix.txt"), head=TRUE)
> > species <- as.factor(AISdata[,1])
> > csize <- as.vector(AISdata[,2])
> > depth <- as.factor(AISdata[,3])
> > locale <- as.factor(AISdata[,4])
> > RR <- as.factor(AISdata[,5])
> > CDR <- as.factor(AISdata[,6])
>
> > AIS <- as.matrix(AISdata[,-(1:6)])
> > 
> > is.numeric(AIS)
> [1] TRUE
>
> > AIS.shape <- arrayspecs(AIS,25,2)
> > AIS.super <- gpagen(AIS.shape)
> > names(AIS.super)
>  [1] "coords"       "Csize"        "iter"         "points.VCV"   
> "points.var"   "consensus"   
>  [7] "p"            "k"            "nsliders"     "nsurf"        "data"   
>       "Q"           
> [13] "slide.method" "call"        
>
> > AISarray <- two.d.array(AIS.shape)
> > AISarray
>            [,1]        [,2]        [,3]       [,4]        [,5]       [,6] 
>       [,7]       [,8]
> [1,] -0.3023043  0.11018580 -0.09019077  0.2063007  0.10797090  0.2356602 
>  0.1942508  0.1284485
> [2,] -0.3189721  0.08885828 -0.10303453  0.1979945  0.10652075  0.2377025 
>  0.1694973  0.1731607
> [3,]  0.3680717 -0.05312220  0.01887333 -0.1909477 -0.08767592 -0.2014106 
> -0.1486420 -0.1485168
>            [,9]       [,10]      [,11]       [,12]       [,13]       [,14] 
>      [,15]       [,16]
> [1,]  0.1980599  0.03970195  0.1017983  0.05041833  0.09914963 -0.04387893 
>  0.1933970 -0.08178463
> [2,]  0.1651301  0.08660780  0.1155678  0.08307038  0.11690521 -0.07633613 
>  0.1716527 -0.08059491
> [3,] -0.1603194 -0.06361361 -0.1035876 -0.06069144 -0.10815490  0.04951909 
> -0.1662444  0.06520166
>           [,17]      [,18]       [,19]      [,20]        [,21]      [,22] 
>      [,23]       [,24]
> [1,]  0.1764013 -0.1647228  0.09535528 -0.2353786 -0.092696160 -0.1846257 
> -0.2982749 -0.11114690
> [2,]  0.1716527 -0.1667319  0.11626194 -0.2417347 -0.101362815 -0.1927248 
> -0.3245558 -0.07686364
> [3,] -0.1572431  0.1453066 -0.10713760  0.1982355  0.003947048  0.1968381 
>  0.3625471  0.05191814
>           [,25]       [,26]      [,27]         [,28]       [,29]       
> [,30]       [,31]      [,32]
> [1,] -0.2892081 -0.01549321 -0.2661613 -0.0000096006 -0.07823776 
>  0.02564890 -0.05870517  0.1191063
> [2,] -0.2791457 -0.02152225 -0.2136730  0.0004915837 -0.06976480 
>  0.02706498 -0.07740526  0.1500473
> [3,]  0.3512638  0.01748087  0.3235535  0.0000778100  0.03703989 
> -0.02924458  0.02404925 -0.1525469
>             [,33]       [,34]       [,35]       [,36]       [,37]       
>  [,38]       [,39]       [,40]
> [1,] -0.023388670  0.12534780  0.05604006  0.07290103  0.09462322 
>  0.004968850  0.04503409 -0.06598428
> [2,] -0.004267756  0.10304202  0.05518285  0.05854853  0.09531672 
>  0.001285137  0.05287348 -0.05727687
> [3,] -0.024146350 -0.07941564 -0.05238288 -0.04300939 -0.08674858 
> -0.003493334 -0.05213929  0.04122498
>             [,41]         [,42]         [,43]       [,44]       [,45]     
>  [,46]       [,47]       [,48]
> [1,] -0.001610772  0.0066155220 -0.0301974800 -0.10920320 -0.06167416 
> -0.1110030 -0.07546186 -0.01649362
> [2,]  0.012413723 -0.0002767074 -0.0009055873 -0.11089758 -0.07277358 
> -0.1487385 -0.06680632 -0.03298501
> [3,] -0.013718360 -0.0004120264 -0.0261172500  0.07330989  0.01402188 
>  0.1622024  0.03644913  0.02526047
>           [,49]         [,50]
> [1,]  0.3060308  0.0144204200
> [2,]  0.2808471 -0.0011906212
> [3,] -0.2455590 -0.0001512177
>
> > AIS.means <- rowsum(AISarray, species)/as.vector(table(species))
> > AIS.means.shape <- arrayspecs(AIS.means, 25, 2)
> > AIS.means.super <- gpagen(AIS.means.shape, Proj=TRUE, ProcD=TRUE, 
> PrinAxes=TRUE, curves=NULL, surfaces=NULL)
>
> > #plot the superimposed configurations
> > AISMcoord <- AIS.means.super$coords
> > max(AISMcoord[ ,1, ]); min(AISMcoord[ ,1, ]); max(AISMcoord[ ,2, ]); 
> min(AISMcoord[ ,2, ])
> [1] 0.3076018
> [1] -0.3717857
> [1] 0.2391025
> [1] -0.2434714
> > plot(AISMcoord[ ,1,1], AISMcoord[ ,2,1], asp=1, pch=21, 
> bg="darkgoldenrod1", xlab="x", ylab="y", cex=1.5, xlim=c(-0.4, 0.35), 
> ylim=c(-0.3, 0.3))
> > points(AISMcoord[ ,1,2], AISMcoord[ ,2,2], asp=1, pch=21, 
> bg="darkorange", cex=1.5)
> > points(AISMcoord[ ,1,3], AISMcoord[ ,2,3], asp=1, pch=21, bg="orange", 
> cex=1.5)
> > legend('bottomright', legend=c("Balba", "Hybse", "Polpx"), 
> fill=c("darkgoldenrod1", "darkorange", "orange"), cex=1)
> > title("Superimpositions for specimens of \nAntedonidae incertae sedis", 
> cex.main=1.5)
> > joinline <- c(1:3,25,10:14,NA,15:17,3:10,22:24,NA,18:21,18)
> > for (i in 1:3) {lines(AIS.shape[joinline,,i], col="grey")}
>
> Thanks, 
> Brenna
>

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
You received this message because you are subscribed to the Google Groups 
"MORPHMET" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].

Reply via email to