Last updated: 2022-10-23

Checks: 2 0

Knit directory: Code/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 32c0378. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    Flexibility Comparisons.nb.html
    Ignored:    Main.nb.html
    Ignored:    PGLS.FullData.nb.html
    Ignored:    PGLSforeachMeasFeature.nb.html
    Ignored:    PGLSwithPCA_Dims.nb.html
    Ignored:    PreppedVertMeas.nb.html
    Ignored:    ProcessCymatogasterFiles.nb.html
    Ignored:    ProcessFCSVfiles.nb.html
    Ignored:    TestingHabitatwithFriedmanData.nb.html
    Ignored:    Trilok_tree.nb.html
    Ignored:    VertLM.nb.html
    Ignored:    VertMeasLDA_Attempt.nb.html
    Ignored:    VertPGLS.nb.html
    Ignored:    VertPairs.nb.html
    Ignored:    analysis/.DS_Store
    Ignored:    analysis/.Rhistory
    Ignored:    analysis/02-CheckSpeciesMatch.nb.html
    Ignored:    analysis/10-VertLM.nb.html
    Ignored:    analysis/12-VertPGLS2.nb.html
    Ignored:    analysis/13-VertPGLS-MANOVA40.nb.html
    Ignored:    analysis/13-VertPGLS-MANOVA90.nb.html
    Ignored:    analysis/14-VertPGLS-MANOVA40.nb.html
    Ignored:    analysis/20-plot_phylogeny.nb.html
    Ignored:    analysis/21-plot_fits_and_summary.nb.html
    Ignored:    analysis/CheckSpeciesMatch.nb.html
    Ignored:    caper_test.nb.html
    Ignored:    data/.DS_Store
    Ignored:    ggtree_attempt.nb.html
    Ignored:    output/.DS_Store
    Ignored:    plot_example_data.nb.html
    Ignored:    plot_fits_and_summary.nb.html
    Ignored:    plot_phylogeny.nb.html
    Ignored:    summarize_vert_meas.nb.html
    Ignored:    test_phylogeny.nb.html
    Ignored:    test_vertebraspace.nb.html
    Ignored:    vert_evol.Rproj

Untracked files:
    Untracked:  Archive.zip
    Untracked:  Main.html
    Untracked:  ProcessFCSVfiles.Rmd
    Untracked:  VertPGLS.html
    Untracked:  analysis/13-VertPGLS-MANOVA90.Rmd
    Untracked:  analysis/14-VertPGLS-MANOVA40.Rmd
    Untracked:  data/actinopt_12k_raxml.tre.xz
    Untracked:  gg_saver.R
    Untracked:  output/BodyDistribution.pdf
    Untracked:  output/MasterVert_Measurements.csv
    Untracked:  output/anova_table.rtf
    Untracked:  output/anovatabs.csv
    Untracked:  output/effectsizes.csv
    Untracked:  output/fineness.pdf
    Untracked:  output/habitatvals.csv
    Untracked:  output/manova_table.rtf
    Untracked:  output/mean_d_alphaPos_CBL.pdf
    Untracked:  output/mean_params.pdf
    Untracked:  output/pair_plot.pdf
    Untracked:  output/phylogeny_families.pdf
    Untracked:  output/plot_example_data_figure.pdf
    Untracked:  output/predvals.Rds
    Untracked:  output/stats_table.rtf
    Untracked:  output/vertdata_show_species.csv
    Untracked:  output/vertdata_summary_species.csv
    Untracked:  output/vertshape.pdf
    Untracked:  plot_fits_and_summary.Rmd
    Untracked:  summarize_vert_meas.html
    Untracked:  testtree.csv
    Untracked:  vert_tree.csv

Unstaged changes:
    Deleted:    .Rprofile
    Modified:   data/MasterVert_Measurements.csv
    Modified:   output/MasterVert_Measurements_Matched.csv
    Modified:   output/vert_tree.rds
    Modified:   output/vertdata_centered.csv
    Modified:   output/vertdata_summary.csv
    Deleted:    renv.lock
    Deleted:    renv/.gitignore
    Deleted:    renv/activate.R
    Deleted:    renv/settings.dcf

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/index.Rmd) and HTML (docs/index.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 32c0378 Eric Tytell 2022-10-23 Final analysis scripts
html 5e4be8c Eric Tytell 2022-04-11 Build site.
Rmd 7983950 Eric Tytell 2022-04-11 wflow_git_commit(c("analysis/about.Rmd", "analysis/index.Rmd",
Rmd 0be8f4f Eric Tytell 2021-12-30 Updated the index file to link correctly
Rmd 23908bd Eric Tytell 2021-12-30 Test site build again
Rmd b9f4976 Eric Tytell 2021-12-30 Start workflowr project.

Internal vertebral morphology of bony fishes matches the mechanical demands of different environments

Dana Baxter\(^1\) | Karly E. Cohen\(^3\) | Cassandra M. Donatelli\(^2\) | Eric D. Tytell\(^1\)

\(^1\)Tufts University, Department of Biology \(^2\)University of Ottawa, Department of Biology \(^3\)University of Washington, Friday Harbor Labs

Accepted at Ecology and Evolution October 20, 2022.

Abstract

Raw data

The initial measurements were made by Dana Baxter by clicking points on vertebrae from CT scans. The measurements are in MasterVert_Measurements_old.csv.

Dana processed the data from Cymatogaster aggregata a bit later, so we have to merge it into the main data set.

Input: data/MasterVert_Measurements_old.csv Output: data/MasterVert_Measurements.csv

Here is the process to merge the Cymatogaster data: 01-ProcessCymatogasterFiles.

Matching species

Species are distributed somewhat randomly throughout the bony fishes. We use the phylogeny from Betancur-R et al 2017. Not every species we digitized is in their tree. For most of them, we can use another species in the same genus, since we don’t have many species in our data set that are in one genus.

Input: data/MasterVert_Measurements.csv Output: output/MasterVert_Measurements_Matched.csv This contains all of the measurements for all of the vertebrae, but with a new set of columns for “MatchSpecies” and “MatchGenus”, which are the matching species in the Betancur-R tree.

This notebook checks the match between our species and the one in the tree: 02-CheckSpeciesMatch.

Summary data sets

Centering and taking maxes and medians

Here, we take the data for each vertebra and produce summary values for each species. We first center the data set by finding the median value of any measurement for each vertebra across all of the species, then subtracting the actual value from that median.

Input: output/MasterVert_Measurements_Matched.csv Output:

  • output/vertdata_centered.csv: This contains the centered measurements
  • output/vertdata_summary.csv: This contains the summary maximum values and medians for each species

Notebook

Merge the phylogeneny

First, we need to merge our data set with an existing phylogeny. We use the phylogeny from Fish Tree of Life: https://fishtreeoflife.org/. (Daniel L. Rabosky, Jonathan Chang, Pascal O. Title, Peter F. Cowman, Lauren Sallan, Matt Friedman, Kristin Kaschner, Cristina Garilao, Thomas J. Near, Marta Coll, Michael E. Alfaro (2018). An inverse latitudinal gradient in speciation rate for marine fishes. Nature, 559(7714), 392–395 doi:10.1038/s41586-018-0273-1)

Input: data/actinopt_12k_treePL.tre.xz, output/vertdata_summary.csv Output:

Notebook

Run the statistics

This script runs all of the PGLS analysis and generates most of the output tables and figures.

Notebook

Input: output/MasterVert_Measurements_Matched.csv, output/vertdata_summary_species.csv output/vert_tree.rds Output:

Figures

Figure 1: Shows the phylogeny and several example vertabrae.

This produces the phylogeny.

Notebook

Figure 3, 4, 5

Figures showing the distribution of fineness across habitats, the means of all the morphological parameters as a function of habitat and fineness, and the mean shape of the vertebrae based on the measurements.

Also generates the stats table.

Notebook