# Exercise 8. Modularity, Disparity, Phylogeny
###### tags: `exercise`
## Instructions
- Below are Problems which should all be achievable using the information from class. The Challenge will require you to find resources or answers on your own.
- **Please complete this assignment in your assigned groups of two** or three. Be sure to include the members of your group at the top of your answers.
- Create a HackMD note to share your answers to these prompts. Include your names. Copy the prompts, add your code and explanatory text and images. Use markdown formatting to distinguish the prompts from the code and explanatory text of your answers.
- Submit your answers by sharing the note with Dr. Angelini before Friday at dawn.
---
### Problem 1: Modularity
Examine modularity in the bumblebee worker forewings from the [`worker.forewings`](https://github.com/aphanotus/BI377.Morphometry/raw/refs/heads/main/worker.forewings.Rda) dataset. Remember that you will need to reflect wing shapes into a consistent orientation and perform GPA before testing for modularity. Recall that landmarks 1 and 2 are on the anterior (or costal) edge of the wing, which is the leading surface in flight. Landmarks 1,6-8 and 17 are distal, and landmarks 13 and 19 are proximal.
<img src="https://i.imgur.com/zyQmqxd.png" style="zoom:35%;" />
Chose **two modularity hypotheses**. (Two different vectors with two or more groups of landmarks that you think might covary with one another.)
**Test your hypotheses** using `modularity.test` and **interpret the results** in one or a few sentences.
#### Challenge 1
Test one additional, different, modularity hypothesis. Apply a method of multiple test correction and re-evaluate the results of all these tests.
### Problem 2: Disparity
Examine disparity in wing shapes among bumblebee species, again using the [`worker.forewings`](https://github.com/aphanotus/BI377.Morphometry/raw/refs/heads/main/worker.forewings.Rda) dataset. Perform PCA on the GPA-aligned wing shapes, and create a shape space plot with species bounded by convex hulls. Include this plot in your answer.
Test whether or not centroid size is a factor that influences wing shape. Based on the interpretation of that model, decide whether or not your disparity comparisons of species should account for size first.
Run `morphol.disparity` and explain the results.
#### Challenge 2
How balanced is the sampling of species in this dataset? (Use R to determine this.)
Filter the dataset to include only species with at least 15 specimens.
Repeat the disparity comparison with this reduced dataset and explain the results.
### Problem 3: Phylogeny
Find mean shapes for each species in the [`worker.forewings`](https://github.com/aphanotus/BI377.Morphometry/raw/refs/heads/main/worker.forewings.Rda) dataset (including all the original species).
Plot a wing shape space with the species phylogeny superimposed.
Test whether wing shape varies by size, after correcting for the influence of evolutionary history and explain the results.
#### Challenge 3
Plot all of the mean shapes, using one command.
---
**Quick Links** | [BI377 Moodle](https://moodle.colby.edu/course/view.php?id=33250) | [BI377 HackMD](https://hackmd.io/@ColbyBI377/landingpage) | [rstudo.colby.edu](https://rstudio.colby.edu/)
---