Unconstrained Ordination for Macatawa Watershed Data
Introduction
In this assignment you will perform unconstrained ordinations of the Macatawa watershed data. You will be doing many of the same things you did with the Lake Erie data in Tutorial 6.
You will do the ordination computations using HPC (the corresponding code in Tutorial 6 includes everything before the section titled PCoA and NMDS plots), and you will produce ordination plots using your local computer (the rest of Tutorial 6). As before, we will customize our plots using color schemes that have already been chosen to work well with the Macatawa watershed data. You have been provided with code on our Moodle site that you can modify to do the plotting. As in the past, you will need to add an introduction, explanatory text for each code block and corresponding output, and discussion of your interpretation of the plots.
Each person will create two pairs of plots. All four plots will use ordination results based on Bray-Curtis (bray) dissimilarities and two factors to determine the appearance of the points. For the first pair everyone will create the same two ordination plots. Site will be used to color the points, and CalendarSeason will be used to determine the shapes of the points. One plot in the pair will be created using PCoA as the ordination method and the other one will use NMDS as the ordination method.
Each person will also create a unique second pair of plots using a unique pair of variables from the following list: CalendarSeason, Site, WaterTempSeason4, SiteType, Month, BaseflowCondition_locmin, BaseflowCondition_Eckhardt. You will indicate your variable choices in a spreadsheet that is posted on our Moodle page.
Ordination
We will start by doing the ordination computations (without the plots) on HPC. Create a Quarto file and save it in the code directory in your watershedMacatawa project directory on HPC. Give the file an appropriate descriptive name.
You will need to modify your code from Tutorial 6 in the usual way–change variable names so that they use mac or macatawa instead of erie. Also remove the plotting code at the end (everything from the PCoA and NMDS plots section in Tutorial 6), since we will be creating the plots using a separate Quarto file.
Make sure you have an introduction and explanatory text for each code block. You do not need to include any interpretation in this Quarto document. You will include that when you do the plotting instead.
You should use the following file names and locations for the clean data that your code produces (edit your code accordingly before you run it):
| Data set or figure | folder | file name |
|---|---|---|
| Bray-Curtis distance matrix | clean_data | dist_matrix_bray.rds |
| Metadata with ordination columns using bray | clean_data | macatawa_meta_ordination_bray.rds |
Finally, update your code to use the following options when you run the NMDS ordination (trace = 2, trymax = 50000, maxit = 1000000, sfgrmin = 5e-16, sratmax = 0.999999999999999). This will ensure that the algorithm will converge to a solution.
Run your code on HPC by submitting an appropriate Slurm job (you will need to write a new Slurm script and submit it). It takes a long time to run the code (50 hours or so!), so don’t wait until the due date to work on this!
Once your code has run successfully copy the code and the clean data files you produced to your local computer so that you can use them for plotting later.
Ordination plots
Plot pair 1
Modify the ordination plotting code from our Moodle page by adding an introduction and explanatory text where indicated. Save the file in the code directory in your watershedMacatawa directory on your local computer. Make sure you have copied the clean data files you created earlier from HPC to the clean_data directory on your local computer. Ensure that the file names match the file names read in by the code.
For the plot interpretation, describe any patterns you see in your plots. Do the patterns make sense biologically/physically? Why? Is there much of a difference between the two ordination methods? Does one method seem to separate the data more than the other?
Plot pair 2
Save a copy of the plotting code you created for the first pair of plots. Give it a name that clearly differentiates it from your other Quarto file. Modify the introduction and explanatory text as required to reflect your choice of factors and distance measure. Change the names of the output files (the .pdf files) to reflect your choices.
Modify the code so that the variables you chose are converted to factors. Modify the plotting code so that it uses your factors to determine the colors and shapes of the points. Also modify the titles, etc. accordingly.
For the plot interpretation, describe any patterns you see in your plots. Do the patterns make sense biologically/physically? Why?
What you need to turn in
For this assignment, you need to turn in 6 files:
- The following Quarto (.qmd) files:
- the one you used to perform the ordination using the bray distance
- the one you used to produce the first pair of plots
- the one that you used to produce the second pair of plots (for the variables and the distance you chose)
- The rendered reports (.html) that were generated for each of the Quarto files you turned in that are listed above