Tutorial 1
library(borealis)
data("pupfish", package="geomorph")
str(pupfish)
edge.landmarks <- 11:56
pup.links <- matrix(c(edge.landmarks[-length(edge.landmarks)], edge.landmarks[-1]),
ncol = 2, byrow = FALSE)
pup.links <- rbind(pup.links[-c(23,28,38),],
matrix(c(4,11, 1,3, 3,9, 9,38, 33,7, 34,8, 4,48, 1,46, 49,56),
ncol = 2, byrow = TRUE) )
landmark.plot(pupfish, links = pup.links)
pup.gpa <- align.procrustes(pupfish$coords)
names(pup.gpa)
pup.gdf <- listed.gdf(pup.gpa)
names(pup.gdf)
names(pup.gdf$gdf)
pup.gdf$gdf$Csize <- pupfish$CS
pup.gdf$gdf$sex <- pupfish$Sex
pup.gdf$gdf$pop <- pupfish$Pop
pup.gdf$gdf$pop.sex <- as.factor(paste(pup.gdf$gdf$pop, pup.gdf$gdf$sex, sep = "_"))
pup.pca <- gm.prcomp(pup.gdf$gdf$coords)
plot(pup.pca, col = as.factor(pup.gdf$gdf$pop.sex))
legend("topright", levels(pup.gdf$gdf$pop.sex),
col = c(1:length(levels(pup.gdf$gdf$pop.sex))),
pch = 1, box.lwd = 0)
i <- 1e4-1 # number of iterations
size.model <- procD.lm(coords ~ log(Csize), data=pup.gdf$gdf, iter=i)
anova(size.model)
sex.model <- procD.lm(coords ~ log(Csize) + sex, data=pup.gdf$gdf, iter=i)
anova(sex.model)
anova(size.model, sex.model)
pop.model <- procD.lm(coords ~ log(Csize) + pop, data=pup.gdf$gdf, iter=i)
sex.pop.model <- procD.lm(coords ~ log(Csize) + sex + pop, data=pup.gdf$gdf, iter=i)
anova(size.model, pop.model, sex.pop.model)
sex.by.pop.model <- procD.lm(coords ~ log(Csize) + sex * pop, data=pup.gdf$gdf, iter=i)
anova(sex.pop.model, sex.by.pop.model)
sex.by.pop.model <- procD.lm(coords ~ log(Csize) + sex + pop + sex:pop, data=pup.gdf$gdf, iter=i)
pop.unique.model <- procD.lm(coords ~ log(Csize) * pop, data=pup.gdf$gdf, iter=i)
anova(pop.model, pop.unique.model)
plotAllometry(fit = pop.unique.model, size = pup.gdf$gdf$Csize,
col = pup.gdf$gdf$pop, xlab = "log centroid size")
Problem 1
pop.unique.model2 <- procD.lm(coords ~ log(Csize) * pop + sex, data=pup.gdf$gdf, iter=i)
anova(sex.pop.model, pop.unique.model2)
plotAllometry(fit = pop.unique.model2, size = pup.gdf$gdf$Csize,
col = pup.gdf$gdf$pop.sex, xlab = "log centroid size")
Anova Results
Analysis of Variance, using Residual Randomization
Permutation procedure: Randomization of null model residuals
Number of permutations: 10000
Estimation method: Ordinary Least Squares
Effect sizes (Z) based on F distributions
ResDf Df RSS SS MS Rsq F
coords ~ log(Csize) + sex + pop (Null) 50 1 0.027002 0.000000
coords ~ log(Csize) * pop + sex 49 1 0.025351 0.0016509 0.0016509 0.029343 3.1909
Total 53 0.056262
Z P Pr(>F)
coords ~ log(Csize) + sex + pop (Null)
coords ~ log(Csize) * pop + sex 2.5575 0.0067
Total
Learn More →
Sex and population are an important factors influencing pupfish shape (permutation-based Procrustes ANOVA, F= 3.1909, p = .0067). The interaction between population and size was significant in determining that these groups have unique allometries.
Tutorial 2
create.tps(
input.filename = "Ofas.RNAi.nota.digitization.csv",
output.filename = "Ofas.RNAi.nota.tps",
id.factors = c('digitizer','treatment'),
include.scale = TRUE,
invert.scale = TRUE)
bug.nota <- read.tps("Ofas.RNAi.nota.tps", keep.original.ids = TRUE)
nota.lines <- matrix(c(1,2, 2,3, 3,4, 4,5, 5,6, 6,7, 7,8, 8,1, 2,6),
ncol = 2, byrow = TRUE)
bug.nota <- align.reflect(bug.nota, links = nota.lines)
bug.gpa <- align.procrustes(bug.nota)
x <- bug.gpa$Csize > 500
bug.gpa$Csize[x] <- NA
x <- bug.gpa$metadata$treatment == "vr"
bug.gpa$metadata$treatment[x] <- "vg"
x <- bug.gpa$metadata$treatment == "wildtype"
bug.gpa$metadata$treatment[x] <- "wt"
bug.gdf <- listed.gdf(bug.gpa)
bug.pca <- gm.prcomp(bug.gdf$gdf$coords)
ggGMMplot(bug.pca,
group = bug.gdf$gdf$treatment,
group.title = 'treatment',
convex.hulls = TRUE,
include.legend = TRUE )
Problem 2
i <- 1e4-1
bug.gdf <- listed.gdf(bug.gpa)
bug.model1 <- procD.lm(coords ~ log(Csize), data = bug.gdf$gdf, iter = i)
bug.model2 <- procD.lm(coords ~ log(Csize) + digitizer, data = bug.gdf$gdf, iter = i)
anova(bug.model1, bug.model2)
First, I wanted to look at whether or not the digitizer affected the size of the milkweed bug.
Analysis of Variance, using Residual Randomization
Permutation procedure: Randomization of null model residuals
Number of permutations: 10000
Estimation method: Ordinary Least Squares
Effect sizes (Z) based on F distributions
ResDf Df RSS SS MS Rsq F Z P Pr(>F)
coords ~ log(Csize) (Null) 88 1 2.2163 0.00000
coords ~ log(Csize) + digitizer 80 8 0.9453 1.2711 0.15888 0.57208 13.446 5.9842 1e-04
Total 89 2.2218
The sample digitizer had a significant effect on the size of the sample, meaning there was non insignificant human error (permutation-based Procrustes ANOVA, F= 13.446, p < .001)
Then I wanted to see if there was any allometry changes between treatment. This was done by modeling treatment and size (and controlling for digitizer), and then modeling an interaction between shape and treatment, to see if the rate of the change in size was affected by treatment.
bug.model3 <- procD.lm(coords ~ log(Csize) + treatment + digitizer, data = bug.gdf$gdf, iter = i)
bug.model4 <- procD.lm(coords ~ log(Csize) * treatment + digitizer, data = bug.gdf$gdf, iter = i)
anova(bug.model3, bug.model4)
Analysis of Variance, using Residual Randomization
Permutation procedure: Randomization of null model residuals
Number of permutations: 10000
Estimation method: Ordinary Least Squares
Effect sizes (Z) based on F distributions
ResDf Df RSS SS MS Rsq F Z P Pr(>F)
coords ~ log(Csize) + treatment + digitizer (Null) 71 1 0.13921 0.0000000
coords ~ log(Csize) * treatment + digitizer 62 9 0.12141 0.017802 0.001978 0.0080123 1.0101 0.12622 0.4545
Total
There is no evidence of allometry between bug size and treatments (permutation-based Procrustes ANOVA, F= 1.0101, p = .4545)
Emily Larson & Mark Young Proposal For our project, we plan to investigate variation in Monstera leaf shape. In a 2013 paper, Chris Muir presents a model to explain the evolutionary favorability of leaf fenestration for the sunfleck dependent Monstera. However, he ignores between leaf variation in fenestration. Monstera are characterized by a multi-layer canopy of different sized leaves with different numbers of cuts. We plan to capture leaf shape with geometric morphometrics and relate it to degree of fenestration and light recieved (we are using height as a proxy). Muir's model indicates that light conditions are critical to the selective advantage of fenestration. Thus, any observed relationship between light and leaf shape and fenestration may expose phenotypic plasticity in support his model. Specifically, we hope to see investment in fenestration and shape change only in high-light leaves, as his model predicts that fenestration is only beneficial for leaves recieving enough sunflecks. We also hope to see changes in leaf shape to maximize ground area (includes holes) in high light leaves, as this should further increase degree of fenestration. We plan to collect our data from Monstera deliciosa found on campus. Emily has one with 25 leaves and there are others in Arey and Olin. However, while Emily's resides in relative shade, the others are grown in greenhouse conditions. The differences in light conditions may confound our analysis so we have not yet decided to incorporate the Arey and Olin plants. In addition, we are interested in differences between leaves on the same plant, not differences between plants. Annotated Bibliography Muir, C. D. How did the swiss cheese plant get its holes? Am. Nat. 181, 273–281 (2013).
Nov 16, 2020Mark Young & Emily Larson ## packages library(borealis) #setwd("/personal/mgyoun21/bi376") create.tps( input.filename = "Ofas.RNAi.nota.digitization.csv", output.filename = "Ofas.RNAi.nota.tps", id.factors = c('digitizer','treatment'), include.scale = TRUE,
Sep 28, 2020Done by Emily Larson, Gus Shuster, and Michael Yorsz install.packages("dunn.test") devtools::install_github("aphanotus/borealis") #loaded ggplot 2 and dplyr Challenge 1 data("ChickWeight") ChickWeight$log10wt <- log10(ChickWeight$weight)
Sep 14, 2020His name was George but my younger brother had trouble with the G sound so he became Borge. He has no teeth so his tongue is always out His favorite food is other dogs ears
Aug 31, 2020or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up