Re: [MORPHMET] relative positions of landmark partitions in integration tests - how important?

2018-01-24 Thread David Katz
Now if only archaeological and museum skeletal samples would stop
disarticulating and stay in anatomical position.

On Wed, Jan 24, 2018 at 11:29 AM, David Katz <dck...@ucdavis.edu> wrote:

> No argument here.
>
> On Wed, Jan 24, 2018 at 11:12 AM, Adams, Dean [EEOBS] <dcad...@iastate.edu
> > wrote:
>
>> David,
>>
>>
>>
>> Yes, fixing the angle first allows for a single GPA, which then retains
>> relative size information across the substructures. And yes, it puts things
>> in a common orientation. Both have major advantages for downstream PLS, and
>> its interpretation. Many PLS-based integration analyses in GMM examine
>> covariation in substructures from a single larger object subjected to a
>> single GPA.  I point to the classic paper of Bookstein et al. 2003 as an
>> exemplar.
>>
>>
>>
>> I would argue that it is in such cases where integration patterns are
>> most interpretable, as with a single GPA one is able to characterize
>> covariation patterns among sets of variables whose spatial relationships
>> have been retained throughout the analysis. This is rather important. When
>> this isn’t the case, it is much more challenging to derive interpretable
>> estimates. This is what I was alluding to in the last part of my previous
>> post.
>>
>>
>>
>> Dean
>>
>>
>>
>> Dr. Dean C. Adams
>>
>> Professor
>>
>> Department of Ecology, Evolution, and Organismal Biology
>>
>>    Department of Statistics
>>
>> Iowa State University
>>
>> www.public.iastate.edu/~dcadams/
>>
>> phone: 515-294-3834 <(515)%20294-3834>
>>
>>
>>
>> *From:* katz.w...@gmail.com [mailto:katz.w...@gmail.com] *On Behalf Of *David
>> Katz
>> *Sent:* Wednesday, January 24, 2018 11:48 AM
>> *To:* Adams, Dean [EEOBS] <dcad...@iastate.edu>
>> *Cc:* Christy Anna Hipsley <chips...@unimelb.edu.au>; MORPHMET <
>> morphmet@morphometrics.org>
>> *Subject:* Re: [MORPHMET] relative positions of landmark partitions in
>> integration tests - how important?
>>
>>
>>
>> I read Christy's question a little differently, and requiring some
>> clarification.
>>
>>
>>
>> First, Dean, doesn't Dean & Felice fix the angle between jaw and cranium
>> so that you can subject a craniomandibular dataset to a common GPA, which
>> at the PLS step has the benefit of preserving relative size relationships
>> between the two structures? On the other hand, it's not clear if Christy
>> obtained landmarks in a way that allows her to do this as easily. For
>> instance, her sample may have had crania and mandibles dissected out and
>> landmarked separately, in which case she subject the cranium and mandible
>> to separate GPAs. Christy?
>>
>>
>>
>> If GPA was performed separately for the cranium and mandible, then
>> couldn't Christy's issue simply be that cranium and mandible have
>> differently oriented principal axes (as determined by gpagen)?
>>
>>
>>
>> Also, Christy, are you using the "plot.pls" function (warpgrids=TRUE) for
>> plotting? If so, then I think one option would be to make shapes=TRUE in
>> that function. This will give you an output that includes the coordinates
>> of the extreme shapes (I assume as *p**3 matrices). After that, you just
>> have to choose which two columns from crania extremes and which two columns
>> from mandible extremes provide you with common cranial and mandibular
>> views. You can then make 2D plots your landmarks using the base R plotting
>> functions. Unfortunately, you won't have warpgrids. But you can overlay two
>> (e.g., mandible) configurations to show the difference between extremes. Or
>> you can plot one extreme as the ball-and-stick wireframe and the change to
>> the other extreme as displacement vectors emanating from the wireframe.
>>
>>
>>
>> David
>>
>>
>>
>> On Wed, Jan 24, 2018 at 10:15 AM, Adams, Dean [EEOBS] <
>> dcad...@iastate.edu> wrote:
>>
>> Christy,
>>
>>
>>
>> That data example contained variation in relative jaw position among
>> specimens, which could affect shape estimates, as well as down-stream shape
>> analyses.  Several approaches have been proposed for dealing with such
>> rotational variation (see Adams 1999; also Bookstein’s Orange book). One
>> approach is to rotate one subset of landmarks so the angle between subsets
>> is invariant across specimens. The geomorph function ‘fixed.angle’

Re: [MORPHMET] relative positions of landmark partitions in integration tests - how important?

2018-01-24 Thread David Katz
No argument here.

On Wed, Jan 24, 2018 at 11:12 AM, Adams, Dean [EEOBS] <dcad...@iastate.edu>
wrote:

> David,
>
>
>
> Yes, fixing the angle first allows for a single GPA, which then retains
> relative size information across the substructures. And yes, it puts things
> in a common orientation. Both have major advantages for downstream PLS, and
> its interpretation. Many PLS-based integration analyses in GMM examine
> covariation in substructures from a single larger object subjected to a
> single GPA.  I point to the classic paper of Bookstein et al. 2003 as an
> exemplar.
>
>
>
> I would argue that it is in such cases where integration patterns are most
> interpretable, as with a single GPA one is able to characterize covariation
> patterns among sets of variables whose spatial relationships have been
> retained throughout the analysis. This is rather important. When this isn’t
> the case, it is much more challenging to derive interpretable estimates.
> This is what I was alluding to in the last part of my previous post.
>
>
>
> Dean
>
>
>
> Dr. Dean C. Adams
>
> Professor
>
> Department of Ecology, Evolution, and Organismal Biology
>
>Department of Statistics
>
> Iowa State University
>
> www.public.iastate.edu/~dcadams/
>
> phone: 515-294-3834 <(515)%20294-3834>
>
>
>
> *From:* katz.w...@gmail.com [mailto:katz.w...@gmail.com] *On Behalf Of *David
> Katz
> *Sent:* Wednesday, January 24, 2018 11:48 AM
> *To:* Adams, Dean [EEOBS] <dcad...@iastate.edu>
> *Cc:* Christy Anna Hipsley <chips...@unimelb.edu.au>; MORPHMET <
> morphmet@morphometrics.org>
> *Subject:* Re: [MORPHMET] relative positions of landmark partitions in
> integration tests - how important?
>
>
>
> I read Christy's question a little differently, and requiring some
> clarification.
>
>
>
> First, Dean, doesn't Dean & Felice fix the angle between jaw and cranium
> so that you can subject a craniomandibular dataset to a common GPA, which
> at the PLS step has the benefit of preserving relative size relationships
> between the two structures? On the other hand, it's not clear if Christy
> obtained landmarks in a way that allows her to do this as easily. For
> instance, her sample may have had crania and mandibles dissected out and
> landmarked separately, in which case she subject the cranium and mandible
> to separate GPAs. Christy?
>
>
>
> If GPA was performed separately for the cranium and mandible, then
> couldn't Christy's issue simply be that cranium and mandible have
> differently oriented principal axes (as determined by gpagen)?
>
>
>
> Also, Christy, are you using the "plot.pls" function (warpgrids=TRUE) for
> plotting? If so, then I think one option would be to make shapes=TRUE in
> that function. This will give you an output that includes the coordinates
> of the extreme shapes (I assume as *p**3 matrices). After that, you just
> have to choose which two columns from crania extremes and which two columns
> from mandible extremes provide you with common cranial and mandibular
> views. You can then make 2D plots your landmarks using the base R plotting
> functions. Unfortunately, you won't have warpgrids. But you can overlay two
> (e.g., mandible) configurations to show the difference between extremes. Or
> you can plot one extreme as the ball-and-stick wireframe and the change to
> the other extreme as displacement vectors emanating from the wireframe.
>
>
>
> David
>
>
>
> On Wed, Jan 24, 2018 at 10:15 AM, Adams, Dean [EEOBS] <dcad...@iastate.edu>
> wrote:
>
> Christy,
>
>
>
> That data example contained variation in relative jaw position among
> specimens, which could affect shape estimates, as well as down-stream shape
> analyses.  Several approaches have been proposed for dealing with such
> rotational variation (see Adams 1999; also Bookstein’s Orange book). One
> approach is to rotate one subset of landmarks so the angle between subsets
> is invariant across specimens. The geomorph function ‘fixed.angle’ performs
> this operation for 2D landmark datasets.
>
>
>
> As to your comment on whether or not such positional variation makes a
> difference, yes it can. PLS examines the degree of covariation between
> blocks of variables and estimates of the between block covariation will
> differ if one set of variables is rotated relative to the other. Whether
> this results in a large or small difference in r-PLS values is
> data-dependent, but the values will not be the same.
>
>
>
> For this reason, prior to any PLS analysis for evaluating integration and
> covariation patterns, one must first carefully consi

Re: [MORPHMET] relative positions of landmark partitions in integration tests - how important?

2018-01-24 Thread David Katz
I read Christy's question a little differently, and requiring some
clarification.

First, Dean, doesn't Dean & Felice fix the angle between jaw and cranium so
that you can subject a craniomandibular dataset to a common GPA, which at
the PLS step has the benefit of preserving relative size relationships
between the two structures? On the other hand, it's not clear if Christy
obtained landmarks in a way that allows her to do this as easily. For
instance, her sample may have had crania and mandibles dissected out and
landmarked separately, in which case she subject the cranium and mandible
to separate GPAs. Christy?

If GPA was performed separately for the cranium and mandible, then couldn't
Christy's issue simply be that cranium and mandible have differently
oriented principal axes (as determined by gpagen)?

Also, Christy, are you using the "plot.pls" function (warpgrids=TRUE) for
plotting? If so, then I think one option would be to make shapes=TRUE in
that function. This will give you an output that includes the coordinates
of the extreme shapes (I assume as *p**3 matrices). After that, you just
have to choose which two columns from crania extremes and which two columns
from mandible extremes provide you with common cranial and mandibular
views. You can then make 2D plots your landmarks using the base R plotting
functions. Unfortunately, you won't have warpgrids. But you can overlay two
(e.g., mandible) configurations to show the difference between extremes. Or
you can plot one extreme as the ball-and-stick wireframe and the change to
the other extreme as displacement vectors emanating from the wireframe.

David

On Wed, Jan 24, 2018 at 10:15 AM, Adams, Dean [EEOBS] 
wrote:

> Christy,
>
>
>
> That data example contained variation in relative jaw position among
> specimens, which could affect shape estimates, as well as down-stream shape
> analyses.  Several approaches have been proposed for dealing with such
> rotational variation (see Adams 1999; also Bookstein’s Orange book). One
> approach is to rotate one subset of landmarks so the angle between subsets
> is invariant across specimens. The geomorph function ‘fixed.angle’ performs
> this operation for 2D landmark datasets.
>
>
>
> As to your comment on whether or not such positional variation makes a
> difference, yes it can. PLS examines the degree of covariation between
> blocks of variables and estimates of the between block covariation will
> differ if one set of variables is rotated relative to the other. Whether
> this results in a large or small difference in r-PLS values is
> data-dependent, but the values will not be the same.
>
>
>
> For this reason, prior to any PLS analysis for evaluating integration and
> covariation patterns, one must first carefully consider what type of
> variables are being utilized, how they were generated, and whether it even
> makes sense to interpret the results biologically.
>
>
>
> Dean
>
>
>
> Dr. Dean C. Adams
>
> Professor
>
> Department of Ecology, Evolution, and Organismal Biology
>
>Department of Statistics
>
> Iowa State University
>
> www.public.iastate.edu/~dcadams/
>
> phone: 515-294-3834 <(515)%20294-3834>
>
>
>
> *From:* Christy Anna Hipsley [mailto:chips...@unimelb.edu.au]
> *Sent:* Tuesday, January 23, 2018 9:34 PM
> *To:* MORPHMET 
> *Subject:* [MORPHMET] relative positions of landmark partitions in
> integration tests - how important?
>
>
>
> Hi all,
>
>
>
> I'm trying to run an integration test in geomorph, or rather
> phylo.integration on 2 sets of Procrustes aligned coordinates for cranium
> and jaws of lizards, landmarked on both sides. When I plot the results I
> get graphs of the landmarks for the positive and negative extremes of
> PLS1&2, but for the cranium they are in lateral view while for the
> mandibles they are in frontal view.
>
> I'm wondering if this is an issue for the estimation of r-PLS, since in
> Adams & Felice 2004 (PLoS ONE: Assessing Trait Covariation and
> Morphological Integration on Phylogenies Using Evolutionary Covariance
> Matrices), they write "the position of the jaw was standardized relative to
> the skull by rotating the jaw to a common articulation angle among
> specimens".
>
>
>
> If it is an issue, how do I rotate the position of one of the partitions
> to be in the same orientation as the other?
>
>
>
> Thanks for any advice!
>
> Christy
>
>
>
> *Dr Christy Anna Hipsley | ARC DECRA Fellow *
>
> School of BioSciences, University of Melbourne/
>
> Museums Victoria
>
> GPO Box 666
>
> Melbourne, Victoria 3001 Australia
>
> *T:* +61 3 8341 7423 <+61%203%208341%207423> *E:*
> christy.hips...@unimelb.edu.au; chips...@museum.vic.gov.au
>
> http://blogs.unimelb.edu.au/hipsleylab/
>
> --
> 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 

Re: [MORPHMET] pairwise matrix of vector angles in R

2017-11-05 Thread David Katz
function(M, type = c("rad", "deg", "r")){
>   M <- as.matrix(M)
>   type <- match.arg(type)
>   if(type == "r") {
> vc <- vec.cor.matrix(M) # as above
>   } else {
> vc <- vec.cor.matrix(M)
> vc <- acos(vc) # finds angles for vector correlations
> diag(vc) = 0 # Make sure computational 0s are true 0s
>   }
>   if(type == "deg") vc <- vc*180/pi # turns radians into degrees
>   vc
> }
>
> These functions have some extras that would not pertain to the general
> solution but are meant to trap warnings and round 0s for users, but they
> should not get in the way of understanding.
>
> Cheers!
> Mike
>
> On Nov 3, 2017, at 11:33 AM, David Katz <dck...@ucdavis.edu> wrote:
>
> I think this does it (but please check; I quickly stuck together two
> different pieces of code)...
>
> # matrix where each vector is a row
> vec.mat <- ...
> #Compute group*loci matrix of mean microsatellite lengths
> angle.mat <- matrix(NA,nrow=nrow(vec.mat),ncol=nrow(vec.mat))
> # angle function (radians converted to degrees)
> vec.angle <- function(v1,v2){cos(t(v1)%*%v2)*57.2958}
> # angles-to-matrix loop
> for(i in 1:nrow(vec.mat))
> {
>   for(j in 1:nrow(vec.mat))
>   {
> # angle bw vec1 and vec2
> angle.mat[i, j] <- vec.angle(vec.mat[i,], vec.mat[j,])}
> }
> return(angle.mat)
> }
>
> On Fri, Nov 3, 2017 at 2:38 AM, andrea cardini <alcard...@gmail.com>
> wrote:
>
>> Dear All,
>> please, does anyone know if there's an R package that, using a matrix
>> with several vectors (e.g., coefficients for allometric regressions in
>> different taxa), will compute the pairwise (all possible pairs of taxa)
>> matrix of vector angles?
>>
>> Thanks in advance for any suggestion.
>> Cheers
>>
>> Andrea
>>
>>
>> --
>>
>> Dr. Andrea Cardini
>> Researcher, Dipartimento di Scienze Chimiche e Geologiche, Università di
>> Modena e Reggio Emilia, Via Campi, 103 - 41125 Modena - Italy
>> <https://maps.google.com/?q=Emilia,+Via+Campi,+103+-+41125+Modena+-+Italy=gmail=g>
>> tel. 0039 059 2058472
>>
>> Adjunct Associate Professor, School of Anatomy, Physiology and Human
>> Biology, The University of Western Australia, 35 Stirling Highway,
>> Crawley WA 6009, Australia
>> <https://maps.google.com/?q=35+Stirling+Highway,+Crawley+WA+6009,+Australia=gmail=g>
>>
>> E-mail address: alcard...@gmail.com, andrea.card...@unimore.it
>> WEBPAGE: https://sites.google.com/site/alcardini/home/main
>>
>> FREE Yellow BOOK on Geometric Morphometrics:
>> http://www.italian-journal-of-mammalogy.it/public/journals/3
>> /issue_241_complete_100.pdf
>>
>> ESTIMATE YOUR GLOBAL FOOTPRINT: http://www.footprintnetwork.or
>> g/en/index.php/GFN/page/calculators/
>>
>> --
>> 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 morphmet+unsubscr...@morphometrics.org.
>>
>>
>
>
> --
> David C. Katz, Ph.D.
> Postdoctoral Fellow
> Benedikt Hallgrimsson Lab
> University of Calgary
>
> Research Associate
> Department of Anthropology
> University of California, Davis
>
> ResearchGate profile <https://www.researchgate.net/profile/David_Katz29>
> Personal webpage
> <https://davidckatz.wordpress.com/>
>
> --
> 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 morphmet+unsubscr...@morphometrics.org.
>
>
>


-- 
David C. Katz, Ph.D.
Postdoctoral Fellow
Benedikt Hallgrimsson Lab
University of Calgary

Research Associate
Department of Anthropology
University of California, Davis

ResearchGate profile <https://www.researchgate.net/profile/David_Katz29>
Personal webpage
<https://davidckatz.wordpress.com/>

-- 
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 morphmet+unsubscr...@morphometrics.org.


Re: [MORPHMET] pairwise matrix of vector angles in R

2017-11-03 Thread David Katz
I think this does it (but please check; I quickly stuck together two
different pieces of code)...

# matrix where each vector is a row
vec.mat <- ...
#Compute group*loci matrix of mean microsatellite lengths
angle.mat <- matrix(NA,nrow=nrow(vec.mat),ncol=nrow(vec.mat))
# angle function (radians converted to degrees)
vec.angle <- function(v1,v2){cos(t(v1)%*%v2)*57.2958}
# angles-to-matrix loop
for(i in 1:nrow(vec.mat))
{
  for(j in 1:nrow(vec.mat))
  {
# angle bw vec1 and vec2
angle.mat[i, j] <- vec.angle(vec.mat[i,], vec.mat[j,])}
}
return(angle.mat)
}

On Fri, Nov 3, 2017 at 2:38 AM, andrea cardini  wrote:

> Dear All,
> please, does anyone know if there's an R package that, using a matrix with
> several vectors (e.g., coefficients for allometric regressions in different
> taxa), will compute the pairwise (all possible pairs of taxa) matrix of
> vector angles?
>
> Thanks in advance for any suggestion.
> Cheers
>
> Andrea
>
>
> --
>
> Dr. Andrea Cardini
> Researcher, Dipartimento di Scienze Chimiche e Geologiche, Università di
> Modena e Reggio Emilia, Via Campi, 103 - 41125 Modena - Italy
> 
> tel. 0039 059 2058472
>
> Adjunct Associate Professor, School of Anatomy, Physiology and Human
> Biology, The University of Western Australia, 35 Stirling Highway, Crawley
> WA 6009, Australia
>
> E-mail address: alcard...@gmail.com, andrea.card...@unimore.it
> WEBPAGE: https://sites.google.com/site/alcardini/home/main
>
> FREE Yellow BOOK on Geometric Morphometrics:
> http://www.italian-journal-of-mammalogy.it/public/journals/3
> /issue_241_complete_100.pdf
>
> ESTIMATE YOUR GLOBAL FOOTPRINT: http://www.footprintnetwork.or
> g/en/index.php/GFN/page/calculators/
>
> --
> 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 morphmet+unsubscr...@morphometrics.org.
>
>


-- 
David C. Katz, Ph.D.
Postdoctoral Fellow
Benedikt Hallgrimsson Lab
University of Calgary

Research Associate
Department of Anthropology
University of California, Davis

ResearchGate profile 
Personal webpage


-- 
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 morphmet+unsubscr...@morphometrics.org.


Re: [MORPHMET] eliminating the effect of population differences

2017-08-10 Thread David Katz
Well, that took longer than I'd hoped... Our multivariate mixed model
approach to 3DGM is now available in early view. Using a global human
sample, we treat population history and structure as a random effect in
order to quantify the (fixed) effect of the transition to agriculture on
skull shape and form.

http://www.pnas.org/content/early/2017/07/18/1702586114.full

I hope you find it interesting.

David



On Fri, Jan 20, 2017 at 8:50 AM, David Katz <dck...@ucdavis.edu> wrote:

> Elahe and Ari,
>
> If your dependent observations have more than a few dimensions, such as is
> typical with landmark data or even a collections of linear measurements,
> then I think the common covariance matrix recommendation from Dr. Rohlf is
> the more standard approach. A typical strategy for removing group structure
> is to perform your analysis on the pooled within group covariance matrix.
> Chs.11 and 12 of Zelditch et al's *Geometric Morphometrics for Biologists*
> provides an overview and citations, as well as the equation for
> partitioning overall covariance into within and between group components.
>
> However, Dr. Belk is correct that, in principle, a mixed model suits your
> needs. The mixed model provides a way to partition random deviances
> attributable to population history and structure from common (fixed)
> effects of developmental stage and sex. You will have to think about how
> you want to model conditionality of sexual dimorphism with respect to
> stage. For example, if dimorphism does not arise until later stages of
> development in your subject species, it does not make much sense to model a
> single dimorphism coefficient across the entire sample.
>
> To make the model go, you will need data with which to estimate pairwise
> evolutionary relationships among the groups in your sample. The computation
> of random effects depends upon it. Stone et al (
> http://rstb.royalsocietypublishing.org/content/366/1569/1410) describe
> some of the challenges of estimating relatedness where there is gene flow
> among the sample clusters (i.e., where your groups are populations rather
> than non-reticulating species). A paper from me+colleagues, linked to
> below, provides an overly simple but (we think) reasonable solution to this.
>
> This leaves one more potential problem: dimensionality. If the dependent
> observation is univariate (centroid size, the first shape principal
> component, etc.) or very low dimensional, the MCMCglmm package (see
> http://onlinelibrary.wiley.com/doi/10./j.1420-9101.2009.01915.x/full)
> could suit your mixed model needs. However, if your data is truly
> multivariate (GM or anything more than a handful of linear measurements), I
> would recommend looking at the BSFG package. We used it to estimate sex and
> climate effects on the human cranium, using a subset of populations from
> the Howells linear craniometric collection. You can find that paper on my
> ResearchGate page (ResearchGate profile
> <https://www.researchgate.net/profile/David_Katz29>). You will also find
> a poster where we extend the application to cranial and mandibular 3D
> landmark data. In the next few months, we should have a paper out that
> combines high-dimensional mixed model analysis with 3DGM in a more
> satisfying way than was managed in the poster.
>
> Unfortunately, unless the developers have finished updating the BSFG
> package, it is not quite plug and play. It takes some time to figure out.
> You need familiarity with Bayesian analysis, and with Matlab. However, the
> outputs are worth the effort. For example, with GM data, your fixed effect
> posterior will estimate shape contrasts for sex and developmental stage
> effects for the whole shape configuration, rather than on synthetic,
> orthogonal subsets (PCs).
>
> Conclusion: if your data is multidimensional and you don't think you can
> get going with BSFG, for the time being, the common covariance matrix
> approach is probably your best option.
>
> David
>
> On Thu, Jan 19, 2017 at 5:24 PM, Mark Belk <mark_b...@byu.edu> wrote:
>
> What you describe – samples from multiple populations – is best considered
> as a random effect in a typical generalized linear model format.  You have
> randomly sampled some populations from all of those that might be
> available.  If I understand your data correctly, to evaluate allometry, use
> a mixed model approach where some trait measurement is the response
> variable and some measure of body size would be the predictor variable,
> then population would be included as a random effect in the model.  This
> structure has the advantage of accounting for and adjusting for covariation
> among populations before the fixed effect is evaluated.  Appropriately
> crafted mixed models c

Re: [MORPHMET] eliminating the effect of population differences

2017-01-20 Thread David Katz
Elahe and Ari,

If your dependent observations have more than a few dimensions, such as is
typical with landmark data or even a collections of linear measurements,
then I think the common covariance matrix recommendation from Dr. Rohlf is
the more standard approach. A typical strategy for removing group structure
is to perform your analysis on the pooled within group covariance matrix.
Chs.11 and 12 of Zelditch et al's *Geometric Morphometrics for Biologists*
provides an overview and citations, as well as the equation for
partitioning overall covariance into within and between group components.

However, Dr. Belk is correct that, in principle, a mixed model suits your
needs. The mixed model provides a way to partition random deviances
attributable to population history and structure from common (fixed)
effects of developmental stage and sex. You will have to think about how
you want to model conditionality of sexual dimorphism with respect to
stage. For example, if dimorphism does not arise until later stages of
development in your subject species, it does not make much sense to model a
single dimorphism coefficient across the entire sample.

To make the model go, you will need data with which to estimate pairwise
evolutionary relationships among the groups in your sample. The computation
of random effects depends upon it. Stone et al (http://rstb.
royalsocietypublishing.org/content/366/1569/1410) describe some of the
challenges of estimating relatedness where there is gene flow among the
sample clusters (i.e., where your groups are populations rather than
non-reticulating species). A paper from me+colleagues, linked to below,
provides an overly simple but (we think) reasonable solution to this.

This leaves one more potential problem: dimensionality. If the dependent
observation is univariate (centroid size, the first shape principal
component, etc.) or very low dimensional, the MCMCglmm package (see
http://onlinelibrary.wiley.com/doi/10./j.1420-9101.2009.01915.x/full)
could suit your mixed model needs. However, if your data is truly
multivariate (GM or anything more than a handful of linear measurements), I
would recommend looking at the BSFG package. We used it to estimate sex and
climate effects on the human cranium, using a subset of populations from
the Howells linear craniometric collection. You can find that paper on my
ResearchGate page (ResearchGate profile
). You will also find a
poster where we extend the application to cranial and mandibular 3D
landmark data. In the next few months, we should have a paper out that
combines high-dimensional mixed model analysis with 3DGM in a more
satisfying way than was managed in the poster.

Unfortunately, unless the developers have finished updating the BSFG
package, it is not quite plug and play. It takes some time to figure out.
You need familiarity with Bayesian analysis, and with Matlab. However, the
outputs are worth the effort. For example, with GM data, your fixed effect
posterior will estimate shape contrasts for sex and developmental stage
effects for the whole shape configuration, rather than on synthetic,
orthogonal subsets (PCs).

Conclusion: if your data is multidimensional and you don't think you can
get going with BSFG, for the time being, the common covariance matrix
approach is probably your best option.

David

On Thu, Jan 19, 2017 at 5:24 PM, Mark Belk  wrote:

What you describe – samples from multiple populations – is best considered
as a random effect in a typical generalized linear model format.  You have
randomly sampled some populations from all of those that might be
available.  If I understand your data correctly, to evaluate allometry, use
a mixed model approach where some trait measurement is the response
variable and some measure of body size would be the predictor variable,
then population would be included as a random effect in the model.  This
structure has the advantage of accounting for and adjusting for covariation
among populations before the fixed effect is evaluated.  Appropriately
crafted mixed models can rigorously account for a range of complicated
covariance structures within the context of one model.  Several examples of
the use of mixed models in ecology and evolution can be found in the
literature.

Hope that helps,



Mark



Mark C. Belk, Professor of Biology

Brigham Young University

Editor, *Western North American Naturalist*

801-422-4154 <(801)%20422-4154>



*From:* Ariadne Schulz [mailto:ariadne.sch...@gmail.com]
*Sent:* Wednesday, January 18, 2017 1:27 PM
*To:* Elahe
*Cc:* MORPHMET
*Subject:* Re: [MORPHMET] eliminating the effect of population differences



I would like to hear any responses to this as well. I did something similar
and I wasn't sure how to approach this question. In future studies I would
like to address precisely this issue. My inclination would be that first
you would want to determine how much morphological 

Re: [MORPHMET] Small object (insectivorous bat) photogrammetry

2016-12-14 Thread David Katz
Hi Giada,

The object may simply be too small. However...

1. My recollection is that you need to keep your f-stop much lower, maybe
f-11 maximum. Look into it. It's possible this has changed with recent
software updates.

2. I assume each chunk is a rotation around the skull. Try shooting more
than 3 rotations. For crania, I prefer 5.

3. How many photos per rotation are you using? For small primate crania, I
have used as many as 35.

4. Sometimes dirtier skulls are better than clean ones. If the bones are
bleached white, it will interfere with the ability of the program to
identify specific points.

5. Sometimes a few photographs mess up the whole alignment. If you align
each rotation individually, and your photographs are sequentially numbered,
you may be able to pick out these photographs and remove them from the
dataset.

Good luck.

David

On Tue, Dec 13, 2016 at 6:02 AM, Giada Giacomini <
giada.giacomin...@gmail.com> wrote:

> Hi all,
>
> I am quite new to photogrammetry and geometric morphometric worlds and I
> got a bit stocked.
> I am trying to build 3D models of insectivorous bat skulls employing
> photogrammetry (more details at the end) and Agisoft Photoscan software.
> The methodology works quite well with bigger specimens (19 mm x 12 mm x 7
> mm).
> But with a smaller ones (e.g. 13 x 8 x 5 mm) the software has different
> problems in the 3D reconstruction: usually it is not able to reconstruct
> the dense cloud (doing “inside out” or providing a long scratch of points)
> or, if the first step had worked successfully, it isn’t able to align the 3
> chunks together.
>
> The pictures are in focus and the specimens in the picture results big
> enough I would say.
> We are trying with other software different from Agisoft but the
> reconstruction is still difficult.
>
> Anyone of you have already tried to perform photogrammetry on such small
> objects?
> Do you have any suggestions or comments?
>
> Many thanks
>
> Giada
>
> Photogrammetry equipment and camera settings:
> Camera: NIKON D5300 (24 megapixel)
> Lens: NIKON macro 60 mm, f2.8
> Settings:
> 4-5 cm from the specimen
> 100 ISO
> f/32
> 0.5 sec exposure time
> No flash. 3 white lights
> Focus: automatic focus on a manual selected square
>
> --
> 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 morphmet+unsubscr...@morphometrics.org.
>



-- 
David C. Katz, Ph.D.
Evolutionary Anthropology
University of California, Davis
Young Hall 204
ResearchGate profile 
Personal webpage 

-- 
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 morphmet+unsubscr...@morphometrics.org.


Re: [MORPHMET] Read .landmarkAscii file into R

2016-02-16 Thread David Katz
Thanks, Antonio! It's good to know it's a bug. Then it's just about finding
a workaround (like those you provided).

Best,
David

On Tue, Feb 16, 2016 at 10:39 AM, <antonio.prof...@uniroma1.it> wrote:

> Dear David,
>
> when you do many operations in Amira or Avizo for a bug the landmarkAscii
> file is converted in a 2setlandmarkAscii file, in fact a second empty
> matrix will be added…
>
> I report two functions to convert a landmarkAscii file or a folder
> containing the amira/avizo Landmark files in an array k*3*n, where k=number
> of landmarks and n=number of specimens.
> My functions read only the matrix between the @1 and @2.
>
> Let me know if it works or not…
>
> Best,
> Antonio
>
> #' read.amira.set
> #'
> #' This function convert a file landmark set of Amira in a array
> #' @param name.file character: path of landamrkascii file
> #' @param nland numeric: number of landmark sampled in Amira, if is set on
> "auto" will be automatically recognized the landmark number
> #' @return array.set numeric: an array with landmark coordinates (kxdxn)
> #' @author Antonio Profico
> #' @export
> #'
>
> read.amira.set=function(name.file,nland){
> A <- readLines(name.file, n = 100)
> end <- which(A == "@1")
> end_2 <- which(A == "@2")
> if(length(end_2!=0)){
> print(paste("file named",name.file, "contains a second matrix of 000"))
> B_junk=read.table(name.file,skip=end,nrows=(end_2-end-2))
> if(nland!="auto"){
> if (dim(B_junk)[1] != nland){
> print(paste("nland is different from dim(matrix)[1]:
> ",paste("nland=",nland,",",sep=""),
>   paste("dim(matrix)[1]=", dim(B_junk)[1],sep="")))
> B=matrix(NA,ncol=3,nrow=nland)}
> if(dim(B_junk)[1]==nland){
> B=B_junk
> }}
> if(nland=="auto"){
> B=read.table(name.file,skip=end,nrows=(end_2-end-2))
> }}
> if(length(end_2)==0){
> B_junk=read.table(name.file,skip=end)
> if(nland!="auto"){
> if (dim(B_junk)[1] != nland){
> print(paste("nland is different from dim(matrix)[1]:
> ",paste("nland=",nland,",",sep=""),
> paste("dim(matrix)[1]=", dim(B_junk)[1],sep="")))
> B=matrix(NA,ncol=3,nrow=nland)}
> if(dim(B_junk)[1]==nland){
> B=B_junk
> }}
> if(nland=="auto"){
> B=B_junk}}
> array.set=array(as.matrix(B),dim=c(dim(B)[1],3,1))
> dimnames(array.set)[[3]]=list(name.file)
> return(array.set)}
>
>
>
>
> #' read.amira.dir
> #'
> #' This function read and store in array the coordinated allocated in a
> folder in separate files (format
> #' @param path.dir character: path of the folder
> #' @param nland numeric: number of landmark sampled in Amira
> #' @return array.set numeric: a kxdxn array with landmark coordinates
> #' @author Antonio Profico
> #' @export
>
> read.amira.dir=function(path.dir,nland){
> names=list.files(path.dir)
> if(nland=="auto"){
> dims=c()
> for(i in 1:length(names)){
> dims[i]=dim(read.amira.set(paste(path.dir,"/",names[i],sep=""),"auto"))[1]}
>
> array.amira=array(NA,dim=c(as.numeric(names(sort(-table(dims)))[1]),3,length(names)))}
> else{array.amira=array(NA,dim=c(nland,3,length(names)))}
> for(i in 1:length(names)){
> array.amira[,,i]=read.amira.set(paste(path.dir,"/",names[i],sep=""),nland)
> }
> if(length(names)==1){
> dimnames(array.amira)[[3]]=list(names)}
> if(length(names)!=1){
> dimnames(array.amira)[[3]]=names}
> return(array.amira)
> }
>
>
> __
>
> Antonio Profico
> PhD student
> Department of Environmental Biology – Dipartimento di Biologia Ambientale
> SAPIENZA Università di Roma
>
> Lab.  06 4991 2690
> Mob. 3293440766
>
> *Da:* David Katz <dck...@ucdavis.edu>
> *Data invio:* ‎mercoledì‎ ‎20‎ ‎gennaio‎ ‎2016 ‎06‎:‎49
> *A:* Emma Sherratt <emma.sherr...@gmail.com>
> *Cc:* MORPHMET <morphmet@morphometrics.org>
>
> I won't get back to my office, and the hard drive where the files are
> stored, for about a week. I'll send something along then.
>
> Thanks, Emma.
>
> David
>
> On Wed, Jan 20, 2016 at 12:08 AM, Emma Sherratt <emma.sherr...@gmail.com>
> wrote:
>
>> Hi David,
>>
>> Not sure what the file actually looks like since you’ve not included a
>> sample here. However I suggest taking a look at the readland functions in
>> geomorph R package to see how we tackle the different types. If you want,
>> send it through to us and we can take a look. If there’s a lot of people
>> using AVIZO for digitising, we can inc

[MORPHMET] Read .landmarkAscii file into R

2016-01-19 Thread David Katz
Hi everyone,

I've collected 3D landmarks on a series of cranial surface models in Avizo.
Avizo's landmark editor outputs .landmarkAscii files, which I would like to
read into R. The way I've done the reading has the following very
unexpected effect: *sometimes, *it* writes *additional data to my
.landmarkAscii files. I'd like to understand why, but am mostly interested
in finding a solution.

To read in the landmark files for a specimen...

# Below, avz.file is the filepath for the .landmarkAscii
# file for a single specimen.
# The code reads the .landmarkAscii file with read.csv.
# This is useful because the object created lays out
# the informational data that precedes the coordinate data
# predictably. This makes it easy to lop off the
# informational data.
  read.lms <- read.csv(avz.file, header=FALSE)[,1]

  # The last row of informational data will contain the
  # text "@1" and nothing else.
  lm.start <- which(read.lms=="@1")+1

  # Now it is possible to create an object with landmark
  # data only. R interprets each landmark (all three
  # coordinates together) as a factor. I convert the factor
  # vector to a character vector.
  lm.char <-
 as.character(droplevels(
 read.lms[(lm.start):length(read.lms)]))

  # Then I create an empty matrix for the landmark data
  lm.mat <- matrix(NA, nrow=length(lm.char), ncol=3)

  # Then fill lm.mat with the landmark data. As mentioned,
  # lm.char is a vector. Each element of that vector
  # contains the X, Y, and Z coordinate for a landmark.
  # The coordinates are separated by spaces
  # (or maybe tabs)
  for(i in 1:nrow(lm.mat))
 {lm.mat[i,] <-
 as.numeric(unlist(strsplit(ctlm.char[i], " ")))}

That's it. The code above will read in the data and make a landmark matrix.
Unfortunately, it sometimes also writes additional lines to the
.landmarkAscii file. The first added element is "@2." Thereafter, the
landmark file adds as many three-coordinate triplets as there are landmarks
in the original data file. The values of these triplets are 0,0,1 (or maybe
1,0,0).

This is really strange behavior. A read function shouldn't write.

My issue may be better suited to an R forum, but I am hoping someone here
has reliable code for reading Avizo landmarks into R.

Thanks in advance.

David


-- 
David Katz
University of California, Davis

-- 
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 morphmet+unsubscr...@morphometrics.org.


Re: [MORPHMET] Read .landmarkAscii file into R

2016-01-19 Thread David Katz
I won't get back to my office, and the hard drive where the files are
stored, for about a week. I'll send something along then.

Thanks, Emma.

David

On Wed, Jan 20, 2016 at 12:08 AM, Emma Sherratt <emma.sherr...@gmail.com>
wrote:

> Hi David,
>
> Not sure what the file actually looks like since you’ve not included a
> sample here. However I suggest taking a look at the readland functions in
> geomorph R package to see how we tackle the different types. If you want,
> send it through to us and we can take a look. If there’s a lot of people
> using AVIZO for digitising, we can include a function in geomorph.
>
> Regarding a read function writing? Nope, never heard of that.
>
> Em
>
> ~~~
>
> Emma Sherratt, PhD.
>
> Lecturer in Zoology,
> Zoology Division, School of Environmental and Rural Science,
> Room L112 Bldg C02,
> University of New England,
> Armidale, NSW, Australia, 2351
> Tel: +61 2 6773 5041
> email: emma.sherr...@une.edu.au
> Twitter: @DrEmSherratt
>
> Caecilians are legless amphibians...
>
> *  __
> (\   .-.   .-.   /_")
>  \\_//^\\_//^\\_//
>   `"`   `"`   `"`*
>
> learn more about them here: www.emmasherratt.com/caecilians
>
>
> On 20 January 2016 at 14:50:38, David Katz (dck...@ucdavis.edu) wrote:
>
> Hi everyone,
>
> I've collected 3D landmarks on a series of cranial surface models in
> Avizo. Avizo's landmark editor outputs .landmarkAscii files, which I would
> like to read into R. The way I've done the reading has the following very
> unexpected effect: *sometimes,* it* writes *additional data to my
> .landmarkAscii files. I'd like to understand why, but am mostly interested
> in finding a solution.
>
> To read in the landmark files for a specimen...
>
> # Below, avz.file is the filepath for the .landmarkAscii
> # file for a single specimen.
> # The code reads the .landmarkAscii file with read.csv.
> # This is useful because the object created lays out
> # the informational data that precedes the coordinate data
> # predictably. This makes it easy to lop off the
> # informational data.
>   read.lms <- read.csv(avz.file, header=FALSE)[,1]
>
>   # The last row of informational data will contain the
>   # text "@1" and nothing else.
>   lm.start <- which(read.lms=="@1")+1
>
>   # Now it is possible to create an object with landmark
>   # data only. R interprets each landmark (all three
>   # coordinates together) as a factor. I convert the factor
>   # vector to a character vector.
>   lm.char <-
>  as.character(droplevels(
>  read.lms[(lm.start):length(read.lms)]))
>
>   # Then I create an empty matrix for the landmark data
>   lm.mat <- matrix(NA, nrow=length(lm.char), ncol=3)
>
>   # Then fill lm.mat with the landmark data. As mentioned,
>   # lm.char is a vector. Each element of that vector
>   # contains the X, Y, and Z coordinate for a landmark.
>   # The coordinates are separated by spaces
>   # (or maybe tabs)
>   for(i in 1:nrow(lm.mat))
>  {lm.mat[i,] <-
>  as.numeric(unlist(strsplit(ctlm.char[i], " ")))}
>
> That's it. The code above will read in the data and make a landmark
> matrix. Unfortunately, it sometimes also writes additional lines to the
> .landmarkAscii file. The first added element is "@2." Thereafter, the
> landmark file adds as many three-coordinate triplets as there are landmarks
> in the original data file. The values of these triplets are 0,0,1 (or maybe
> 1,0,0).
>
> This is really strange behavior. A read function shouldn't write.
>
> My issue may be better suited to an R forum, but I am hoping someone here
> has reliable code for reading Avizo landmarks into R.
>
> Thanks in advance.
>
> David
>
>
> --
> David Katz
> University of California, Davis
> --
> 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 morphmet+unsubscr...@morphometrics.org.
>
> --
> 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 morphmet+unsubscr...@morphometrics.org.
>



-- 
David Katz
Doctoral Candidate
Evolutionary Anthropology
University of California, Davis
Young Hall 204
ResearchGate profile <https://www.researchgate.net/profile/David_Katz29>

-- 
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 morphmet+unsubscr...@morphometrics.org.


Re: [MORPHMET] Error with read.ply in geomorph

2014-12-16 Thread David Katz
Thanks again, Emma.

On Mon, Dec 15, 2014 at 8:02 PM, Emma Sherratt emma.sherr...@gmail.com
wrote:

 Dear David and Stefan,

 The issue was that the PLY file of David has textures, which our read.ply
 function currently does not support. Resaving the file without the texture
 information made the file readable.

 FYI Stefan, the original file read fine with your vsgImport function, but
 only when readcolor=FALSE. When TRUE, it crashed R.

 Emma

 On Tuesday, 16 December 2014 05:34:00 UTC+11, Stefan Schlager wrote:

  Hi David,
 You can use either vcgImport from Rvcg or file2mesh from Morpho (which
 is basically the same) to import all kinds of meshes (stl, obj, ply) binary
 and ascii into an object of class mesh3d

 Best
 Stefan

 On 15/12/14 01:52, David Katz wrote:

 Hello,

  When I try to read a 3D surface file (ply ascii format) into geomorph,
 I get the following error:

  Error in dim(points) - c(ncolpts, npoints) :
   dims [product 6426920] do not match the length of object [5784228]

  For what it's worth, length of object is *exactly *90% of dims.

  Does anyone have an idea where this problem is coming from and how to
 fix it? Note that the model opens without difficulty as a binary ply in
 Geomagic.

  Thanks.

 David Katz

  --
 David Katz
 Doctoral Candidate
 Department of Anthropology--Evolutionary Wing
 University of California, Davis
 Young Hall 204
   --
 MORPHMET may be accessed via its webpage at http://www.morphometrics.org
 To unsubscribe from this group and stop receiving emails from it, send an
 email to morphmet+u...@morphometrics.org.


   --
 MORPHMET may be accessed via its webpage at http://www.morphometrics.org

 To unsubscribe from this group and stop receiving emails from it, send an
 email to morphmet+unsubscr...@morphometrics.org.



-- 
David Katz
Doctoral Candidate
Department of Anthropology--Evolutionary Wing
University of California, Davis
Young Hall 204

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org

To unsubscribe from this group and stop receiving emails from it, send an email 
to morphmet+unsubscr...@morphometrics.org.


[MORPHMET] Error with read.ply in geomorph

2014-12-14 Thread David Katz
Hello,

When I try to read a 3D surface file (ply ascii format) into geomorph, I
get the following error:

Error in dim(points) - c(ncolpts, npoints) :
  dims [product 6426920] do not match the length of object [5784228]

For what it's worth, length of object is *exactly *90% of dims.

Does anyone have an idea where this problem is coming from and how to fix
it? Note that the model opens without difficulty as a binary ply in
Geomagic.

Thanks.

David Katz

-- 
David Katz
Doctoral Candidate
Department of Anthropology--Evolutionary Wing
University of California, Davis
Young Hall 204

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org

To unsubscribe from this group and stop receiving emails from it, send an email 
to morphmet+unsubscr...@morphometrics.org.


Re: [MORPHMET] Recommendations for sticky substances

2014-09-16 Thread David Katz
Bostik Prestik Knetdichtun. You may have to order from a European online
retailer.

On Tue, Sep 9, 2014 at 11:22 AM, Novack-Gottshall, Philip M. 
pnovack-gottsh...@ben.edu wrote:

 Hi all,

 I'm looking for any recommendations for binding agents that are useful
 for holding fossil specimens for morphometric and laser scanning
 purposes. I've used art putty in the past, but many have oils that stain
 the specimens, or stick within tiny pores. I've heard some use sticky
 putty or 3M double-sided tape with some success. Ideally we want
 something that is a strong bond so that we can move the stage with the
 specimen on it, but won't leave any residue on the specimen. The fossils
 tend to be fist sized or smaller (Paleozoic invertebrates mostly), but
 can sometimes have some mass to them.

 Do any of you have any other recommendations or experiences?

 Thanks,
 Phil

 --
 ~
  Phil Novack-Gottshall
  Associate Professor
  Department of Biological Sciences
  Benedictine University
  5700 College Road
  Lisle, IL 60532

  pnovack-gottsh...@ben.edu
  Phone: 630-829-6514
  Fax: 630-829-6547
  Office: 332 Birck Hall
  Lab: 316 Birck Hall
  http://www1.ben.edu/faculty/pnovack-gottshall
 ~


 --
 MORPHMET may be accessed via its webpage at http://www.morphometrics.org

 To unsubscribe from this group and stop receiving emails from it, send an
 email to morphmet+unsubscr...@morphometrics.org.




-- 
David Katz
Doctoral Candidate
Department of Anthropology--Evolutionary Wing
University of California, Davis
Young Hall 204

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org

To unsubscribe from this group and stop receiving emails from it, send an email 
to morphmet+unsubscr...@morphometrics.org.