diff --git a/DESCRIPTION b/DESCRIPTION index c1eea93..a2ab11e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,12 +1,12 @@ Package: prWarp Title: Warping Landmark Configurations -Version: 1.0.0 +Version: 1.0.1 Authors@R: c( person("Anne", "Le Maitre", email = "anne.le.maitre@univie.ac.at", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2690-7367")), person("Silvester", "Bartsch", email = "silvester.bartsch@univie.ac.at", role = "aut"), person("Nicole", "Grunstra", email = "nicolegrunstra@googlemail.com", role = "aut"), person("Philipp", "Mitteroecker", email = "philipp.mitteroecker@univie.ac.at", role = "aut")) -Date: 2020-10-07 +Date: 2024-03-19 Description: Compute bending energies, principal warps, partial warp scores, and the non-affine component of shape variation for 2D landmark configurations, as well as Mardia-Dryden distributions and self-similar distributions of landmarks, as described in Mitteroecker et al. (2020) . Working examples to decompose shape variation into small-scale and large-scale components, and to decompose the total shape variation into outline and residual shape components are provided. Two landmark datasets are provided, that quantify skull morphology in humans and papionin primates, respectively from Mitteroecker et al. (2020) and Grunstra et al. (2020) . Depends: R (>= 3.6.0) Imports: Morpho @@ -15,13 +15,13 @@ Encoding: UTF-8 LazyData: true Suggests: knitr, rmarkdown, geomorph VignetteBuilder: knitr -RoxygenNote: 7.1.1 +RoxygenNote: 7.3.1 NeedsCompilation: no -Packaged: 2020-10-22 15:46:34 UTC; lemaitre +Packaged: 2024-03-20 17:30:06 UTC; Anne Author: Anne Le Maitre [aut, cre] (), Silvester Bartsch [aut], Nicole Grunstra [aut], Philipp Mitteroecker [aut] Maintainer: Anne Le Maitre Repository: CRAN -Date/Publication: 2020-11-02 08:40:02 UTC +Date/Publication: 2024-03-20 18:00:02 UTC diff --git a/MD5 b/MD5 index a2d36a1..9bc1ee2 100644 --- a/MD5 +++ b/MD5 @@ -1,30 +1,31 @@ -4febe4f84d3951ace483dd42e318cf25 *DESCRIPTION +d46b4d88f8b82b965235148cbde3680c *DESCRIPTION 2a938af0f48840a86ba70f5b994b4551 *NAMESPACE -e753c8dd1c47c87674264b7a64b681f2 *R/HomoMidSag-dataset.R +3979f77465becd35907c9bf1623e164a *NEWS +e6fb42167f2d77c814de6af792e16081 *R/HomoMidSag-dataset.R 97a01061f7071e7ee35916b020ce6971 *R/array.to.xxyy.R 33ba4788f6ce75e7eaa288b808c5ae8d *R/create.pw.be.R f028d8cb219fa80bcadd8723c35801c6 *R/md.distri.R -62afe0a0e47a0fc7e1acd9867a78c3d7 *R/papionin-dataset.R +02385b005963791915c9162b25f905e1 *R/papionin-dataset.R 44c808b5840e586e94c01dc093b1ca51 *R/ssim.distri.R -b6aacbae966366623b9f05dae2c54c1a *R/tps.all.R +720136dd95ba4078f1925db2dd1fd9f4 *R/tps.all.R 200981e0046f15d421d9df93a3a69486 *R/xxyy.to.array.R -f519e8b9dc90bf78c5cbfb3cd0f539a2 *build/vignette.rds +1533a0034e3f603dbfa8d9fed9995da8 *build/vignette.rds 0093899f573dff859dc3dbab4c38a90e *data/HomoMidSag.rda 39807235a4b8fbbd530322c887482608 *data/papionin.rda -ae559ba62ed43a8142c70bd179fb76e1 *inst/CITATION -3977b116505926d51c917c6b25159377 *inst/doc/prWarp-homo-example.R -32aba465cd587707f478d55cbd682021 *inst/doc/prWarp-homo-example.Rmd -a7f191028ffd15e4eb25754e8ba844eb *inst/doc/prWarp-homo-example.html -f3b692cb55c28c9b289c5409e4487c0b *inst/doc/prWarp-papionin-example.R -364f4b587329927704d134dc5394974d *inst/doc/prWarp-papionin-example.Rmd -07801d47bb4ccbf88525dc0353df5ebf *inst/doc/prWarp-papionin-example.html -fdd67833cbb0edabf10c227e47bbf58e *man/HomoMidSag.Rd +97afe44dc6d5c287cbb3cf3a3c92e521 *inst/CITATION +90cde8753ef0edd60fbe5b64dc5eb71f *inst/doc/prWarp-homo-example.R +fe66cbdee6425636e4999d0af688bb78 *inst/doc/prWarp-homo-example.Rmd +1e031a2519e90d80638216a6eac2e8f0 *inst/doc/prWarp-homo-example.html +fe3051d7f346fcbf32050fa7eecb07f0 *inst/doc/prWarp-papionin-example.R +d743e2a701eed21092f34cdb137e91fb *inst/doc/prWarp-papionin-example.Rmd +271acdace9f45e23c7d7fd6751378930 *inst/doc/prWarp-papionin-example.html +14d095aa3e0a1b237d82c47c58ba65c8 *man/HomoMidSag.Rd 6438385df01d4a8666eb2152e4dd8d3c *man/array.to.xxyy.Rd c15c43a98f76f969275edfd5e7b204e4 *man/create.pw.be.Rd 60c6c7aa899bedd129453a99fccc7631 *man/md.distri.Rd -31490867ddd725684aeb40d386f2e756 *man/papionin.Rd +b72d5e09e0bcd390a533c890b021b2fc *man/papionin.Rd b1cd1e19a69199785fcefda5c659c608 *man/ssim.distri.Rd -3a9b57f73274cebffb26db7b9bd26c8e *man/tps.all.Rd +ff2b4b6fdf641056cc44d0077dbd153c *man/tps.all.Rd df5a5a1b85d004bd5bbb8f5dfd1062b3 *man/xxyy.to.array.Rd -32aba465cd587707f478d55cbd682021 *vignettes/prWarp-homo-example.Rmd -364f4b587329927704d134dc5394974d *vignettes/prWarp-papionin-example.Rmd +fe66cbdee6425636e4999d0af688bb78 *vignettes/prWarp-homo-example.Rmd +d743e2a701eed21092f34cdb137e91fb *vignettes/prWarp-papionin-example.Rmd diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..d9d158d --- /dev/null +++ b/NEWS @@ -0,0 +1,10 @@ +# CHANGES IN PRWARP VERSION 1.0.1 + +### OTHER CHANGES + +* Replaced all url by the DOI in the references of the two datasets 'HomoMidSag' and 'papionin' +* Added spaces after each item of the 'outline' element in the description of the dataset 'papionin' +* Updated the reference Grunstra et al. (2021) which was 'in press' in the vignettes, datasets and CITATION files +* Replaced all occurences of plot.param by plot_param in the two vignettes 'prWarp: Homo example' and 'prWarp: Papionin example' +* Remove 'include = FALSE' for the chunk 'gpa' in the vignette 'prWarp: Homo example' + diff --git a/R/HomoMidSag-dataset.R b/R/HomoMidSag-dataset.R index bdb0576..632e2d9 100644 --- a/R/HomoMidSag-dataset.R +++ b/R/HomoMidSag-dataset.R @@ -7,10 +7,10 @@ #' Master's thesis, University of Vienna. #' @references Mitteroecker, Philipp et al. (2020) #' Morphometric variation at different spatial scales: coordination and compensation in the emergence of organismal form. -#' \emph{Systematic Biology}, syaa007. \url{https://doi.org/10.1093/sysbio/syaa007} +#' \emph{Systematic Biology}, 69(5): 913--926. doi: 10.1093/sysbio/syaa007 #' @references Mitteroecker, Philipp et al. (2020) #' Data form: Morphometric variation at different spatial scales: coordination and compensation in the emergence of organismal form. -#' \emph{Dryad Digital Repository}. \url{https://doi.org/10.5061/dryad.j6q573n8s} +#' \emph{Dryad Digital Repository}. doi: 10.5061/dryad.j6q573n8s #' #' @name HomoMidSag #' @usage data(HomoMidSag) diff --git a/R/papionin-dataset.R b/R/papionin-dataset.R index f5cd9dc..038b0ff 100644 --- a/R/papionin-dataset.R +++ b/R/papionin-dataset.R @@ -6,23 +6,20 @@ #' The data correspond to a list with the 6 following elements: #' #' \itemize{ -#' \item \strong{coords} {The 3D array of landamrk coordinates} -#' \item \strong{species} {The vector of species names} -#' \item \strong{semi_lm} {The vector of semilandmark numbers of the full dataset} -#' \item \strong{curves} {The list of curves for sliding semilandmarks of the full dataset} -#' \item \strong{links} {The matrix of links between landmarks for the full dataset} -#' \item \strong{outline} {A list of 4 elements for the analysis of the outline shape: -#' \strong{subset}, the landmark numbers for the susbet; -#' \strong{semi_lm}, the vector of semilandmark numbers; -#' \strong{curves}, the list of curves for sliding semilandmarks; -#' \strong{links}, the matrix of links between landmarks for the full dataset.} +#' \item {\strong{coords} The 3D array of landmark coordinates} +#' \item {\strong{species} The vector of species names} +#' \item {\strong{semi_lm} The vector of semilandmark numbers of the full dataset} +#' \item {\strong{curves} The list of curves for sliding semilandmarks of the full dataset} +#' \item {\strong{links} The matrix of links between landmarks for the full dataset} +#' \item {\strong{outline} A list of 4 elements for the analysis of the outline shape: \strong{subset}, the landmark numbers for the susbet; \strong{semi_lm}, the vector of semilandmark numbers; \strong{curves}, the list of curves for sliding semilandmarks; \strong{links}, the matrix of links between landmarks for the full dataset.} #' } #' -#' @references Grunstra, Nicole D. S. et al. (in press) +#' @references Grunstra, Nicole D. S. et al. (2021) #' Detecting phylogenetic signal and adaptation in papionin cranial shape by decomposing variation at different spatial scales. +#' \emph{Systematic Biology}, 70(4): 694--706. doi: 10.1093/sysbio/syaa093 #' @references Grunstra, Nicole D. S. et al. (2020) #' Data form: Detecting phylogenetic signal and adaptation in papionin cranial shape by decomposing variation at different spatial scales. -#' \emph{Dryad Digital Repository}. \url{https://doi.org/10.5061/dryad.zkh189373} +#' \emph{Dryad Digital Repository}. doi: 10.5061/dryad.zkh189373 #' #' @name papionin #' @usage data(papionin) diff --git a/R/tps.all.R b/R/tps.all.R index 9c5ee39..8a03e15 100644 --- a/R/tps.all.R +++ b/R/tps.all.R @@ -1,8 +1,8 @@ #' Thin plate spline mapping (2D and 3D) for several sets of landmark coordinates #' #' @description Maps landmarks via thin plate spline -#' based on a reference and a target configuration in 2D and 3D. -#' This function is an extension of the tps3d function a set of specimens. +#' based on a reference and a target configuration in 2D or in 3D. +#' This function is an extension of the tps3d function for a set of specimens. #' #' @param X_array original coordinates #' - a 3D array (p x k x n) containing original landmark coordinates for a set of specimens @@ -17,7 +17,7 @@ #' #' @references Bookstein FL. (1989). #' Principal Warps: Thin-plate splines and the decomposition of deformations. -#' \emph{IEEE Transactions on pattern analysis and machine intelligence 11(6)}: 567--585. +#' \emph{IEEE Transactions on pattern analysis and machine intelligence}, 11(6): 567--585. #' \url{https://ieeexplore.ieee.org/abstract/document/24792} #' #' @return Function returns a 3D array (p x k x n) containing the deformed input diff --git a/build/vignette.rds b/build/vignette.rds index 1f562cf..8b52537 100644 Binary files a/build/vignette.rds and b/build/vignette.rds differ diff --git a/inst/CITATION b/inst/CITATION index a53168b..df97e70 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,16 +1,20 @@ citHeader("To cite prWarp in publication use:") -citEntry( - entry="Article", +bibentry( + bibtype="Article", title="Detecting phylogenetic signal and adaptation in papionin cranial shape by decomposing variation at different spatial scales", author="Nicole D. S. Grunstra and Silvester Bartsch and Anne Le Maitre and Philipp Mitteroecker", journal="Systematic Biology", - year="2020", - textVersion="Grunstra, N.D.S., et al. (in press) Detecting phylogenetic signal and adaptation in papionin cranial shape by decomposing variation at different spatial scales. Systematic Biology." + year="2021", + volume="70", + number="4", + pages="694--706", + doi="10.1093/sysbio/syaa093", + textVersion="Grunstra, N.D.S., et al. (2021) Detecting phylogenetic signal and adaptation in papionin cranial shape by decomposing variation at different spatial scales. Systematic Biology, 70(4): 694--706. https://doi.org/10.1093/sysbio/syaa093" ) -citEntry( - entry="Article", +bibentry( + bibtype="Article", title="Morphometric variation at different spatial scales: coordination and compensation in the emergence of organismal form", author="Philipp Mitteroecker and Silvester Bartsch and Corinna Erkinger and Nicole D. S. Grunstra and Anne Le Maitre and Fred L. Bookstein", journal="Systematic Biology", @@ -18,5 +22,6 @@ citEntry( volume="69", number="5", pages="913--926", - textVersion="Mitteroecker, P., et al. (2020) Morphometric variation at different spatial scales: coordination and compensation in the emergence of organismal form. Systematic Biology, 69(5): 913--926. https://doi.org/10.1093/sysbio/syaa007 " + doi="10.1093/sysbio/syaa007", + textVersion="Mitteroecker, P., et al. (2020) Morphometric variation at different spatial scales: coordination and compensation in the emergence of organismal form. Systematic Biology, 69(5): 913--926. https://doi.org/10.1093/sysbio/syaa007" ) diff --git a/inst/doc/prWarp-homo-example.R b/inst/doc/prWarp-homo-example.R index 52196fe..af4faba 100644 --- a/inst/doc/prWarp-homo-example.R +++ b/inst/doc/prWarp-homo-example.R @@ -12,7 +12,7 @@ homo_ar <- geomorph::arrayspecs(HomoMidSag, k, 2) # create an array dimnames(homo_ar)[[1]] <- 1:k dimnames(homo_ar)[[2]] <- c("X", "Y") -## ----gpa, include=FALSE------------------------------------------------------- +## ----gpa---------------------------------------------------------------------- homo_gpa <- Morpho::procSym(homo_ar) m_overall <- homo_gpa$rotated # Procrustes coordinates m_mshape <- homo_gpa$mshape # average shape @@ -41,7 +41,7 @@ tr_nonaf <- sum(diag(t(homo_be_pw$Xnonaf) %*% homo_be_pw$Xnonaf)) # Convert matrix into a 3D array Anonaf <- xxyy.to.array(homo_be_pw$Xnonaf, p = k, k = 2) # Plot the non-affine shape variation around the mean -geomorph::plotAllSpecimens(Anonaf, plot.param = list(pt.cex = 0.3, mean.cex = 0.8, mean.col = "red")) +geomorph::plotAllSpecimens(Anonaf, plot_param = list(pt.cex = 0.3, mean.cex = 0.8, mean.col = "red")) ## ----------------------------------------------------------------------------- # Compute the self-similar distribution @@ -51,7 +51,7 @@ tr_defl <- sum(diag(t(Xdefl) %*% Xdefl)) # Convert matrix into a 3D array Adefl <- xxyy.to.array(Xdefl, p = k, k = 2) # Plot the self-similar distribution -geomorph::plotAllSpecimens(Adefl, plot.param = list(pt.cex = 0.3, mean.cex = 0.8, mean.col = "red")) +geomorph::plotAllSpecimens(Adefl, plot_param = list(pt.cex = 0.3, mean.cex = 0.8, mean.col = "red")) ## ----------------------------------------------------------------------------- @@ -60,5 +60,5 @@ Xmd <- md.distri(m_mshape, n = n_spec, sd = 0.005) # Convert matrix into a 3D array Amd <- xxyy.to.array(Xmd, p = k, k = 2) # Plot the Mardia-Dryden distribution -geomorph::plotAllSpecimens(Amd, plot.param = list(pt.cex = 0.3, mean.cex = 0.8, mean.col = "red")) +geomorph::plotAllSpecimens(Amd, plot_param = list(pt.cex = 0.3, mean.cex = 0.8, mean.col = "red")) diff --git a/inst/doc/prWarp-homo-example.Rmd b/inst/doc/prWarp-homo-example.Rmd index 1af7b4d..734abfc 100644 --- a/inst/doc/prWarp-homo-example.Rmd +++ b/inst/doc/prWarp-homo-example.Rmd @@ -33,7 +33,7 @@ dimnames(homo_ar)[[2]] <- c("X", "Y") ``` Superimpose landmarks using the generalized Procrustes analysis (GPA). -```{r gpa, include=FALSE} +```{r gpa} homo_gpa <- Morpho::procSym(homo_ar) m_overall <- homo_gpa$rotated # Procrustes coordinates m_mshape <- homo_gpa$mshape # average shape @@ -46,7 +46,7 @@ plot(m_mshape, asp = 1, main = "Average shape", xlab = "X", ylab = "Y") ## Partial warp decomposition -Decompose the 87 Procrustes aligned landmarks into partial warps. The reference matrix is generally the average landmark configuration. Note that the function `create.pw.be` returns principal warps, partial warp scores, partial warp variation and associated bending energies, but also the non-affine componentn of shape variation. +Decompose the 87 Procrustes aligned landmarks into partial warps. The reference matrix is generally the average landmark configuration. Note that the function `create.pw.be` returns principal warps, partial warp scores, partial warp variation and associated bending energies, but also the non-affine componennt of shape variation. ```{r partial warp decomposition} homo_be_pw <- create.pw.be(m_overall, m_mshape) ``` @@ -72,7 +72,7 @@ tr_nonaf <- sum(diag(t(homo_be_pw$Xnonaf) %*% homo_be_pw$Xnonaf)) # Convert matrix into a 3D array Anonaf <- xxyy.to.array(homo_be_pw$Xnonaf, p = k, k = 2) # Plot the non-affine shape variation around the mean -geomorph::plotAllSpecimens(Anonaf, plot.param = list(pt.cex = 0.3, mean.cex = 0.8, mean.col = "red")) +geomorph::plotAllSpecimens(Anonaf, plot_param = list(pt.cex = 0.3, mean.cex = 0.8, mean.col = "red")) ``` ## Self-similar and Mardia-Dryden distributions @@ -86,7 +86,7 @@ tr_defl <- sum(diag(t(Xdefl) %*% Xdefl)) # Convert matrix into a 3D array Adefl <- xxyy.to.array(Xdefl, p = k, k = 2) # Plot the self-similar distribution -geomorph::plotAllSpecimens(Adefl, plot.param = list(pt.cex = 0.3, mean.cex = 0.8, mean.col = "red")) +geomorph::plotAllSpecimens(Adefl, plot_param = list(pt.cex = 0.3, mean.cex = 0.8, mean.col = "red")) ``` @@ -97,15 +97,15 @@ Xmd <- md.distri(m_mshape, n = n_spec, sd = 0.005) # Convert matrix into a 3D array Amd <- xxyy.to.array(Xmd, p = k, k = 2) # Plot the Mardia-Dryden distribution -geomorph::plotAllSpecimens(Amd, plot.param = list(pt.cex = 0.3, mean.cex = 0.8, mean.col = "red")) +geomorph::plotAllSpecimens(Amd, plot_param = list(pt.cex = 0.3, mean.cex = 0.8, mean.col = "red")) ``` ## References Bartsch S (2019). *The ontogeny of hominid cranial form: A geometric morphometric analysis of coordinated and compensatory processes.* Master's thesis, University of Vienna. -Bookstein FL (1989). Principal Warps: Thin-plate splines and the decomposition of deformations. *IEEE Transactions on pattern analysis and machine intelligence 11(6)*: 567--585. https://ieeexplore.ieee.org/abstract/document/24792 +Bookstein FL (1989). Principal Warps: Thin-plate splines and the decomposition of deformations. *IEEE Transactions on pattern analysis and machine intelligence*, 11(6): 567--585. https://ieeexplore.ieee.org/abstract/document/24792 -Mitteroecker P et al. (2020a). Morphometric variation at different spatial scales: coordination and compensation in the emergence of organismal form. *Systematic Biology*, syaa007. https://doi.org/10.1093/sysbio/syaa007 +Mitteroecker P et al. (2020a). Morphometric variation at different spatial scales: coordination and compensation in the emergence of organismal form. *Systematic Biology*, 69(5): 913--926. https://doi.org/10.1093/sysbio/syaa007 Mitteroecker P et al. (2020b). Data form: Morphometric variation at different spatial scales: coordination and compensation in the emergence of organismal form.*Dryad Digital Repository*. https://doi.org/10.5061/dryad.j6q573n8s diff --git a/inst/doc/prWarp-homo-example.html b/inst/doc/prWarp-homo-example.html index 4a54474..67c5290 100644 --- a/inst/doc/prWarp-homo-example.html +++ b/inst/doc/prWarp-homo-example.html @@ -12,61 +12,107 @@ - + prWarp: Homo example - - + +code{white-space: pre-wrap;} +span.smallcaps{font-variant: small-caps;} +span.underline{text-decoration: underline;} +div.column{display: inline-block; vertical-align: top; width: 50%;} +div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} +ul.task-list{list-style: none;} + - - + + +code{white-space: pre-wrap;} +span.smallcaps{font-variant: small-caps;} +span.underline{text-decoration: underline;} +div.column{display: inline-block; vertical-align: top; width: 50%;} +div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} +ul.task-list{list-style: none;} + - - +