Ecological not social factors explain brain size in cephalopods.
The 13 matches
- [1] § STAR★Methods › Quantification and statistical analysis › Miscalculation in chung et al. (2023) › Variable definitions ↔ consensus_analyses.R, lines 41–128 · score 0.72 · matage.max, matage.min, minimum age, sexual maturity, st.cephdat, species
- [2] § STAR★Methods › Quantification and statistical analysis › Miscalculation in chung et al. (2023) › Variable definitions ↔ plots_nov24.R, lines 390–464 · score 0.70 · matage.max, matage.min, minimum age, sexual maturity, st.cephdat, Variable
- [3] § STAR★Methods › Method details ↔ consensus_analyses.R, lines 1–39 · score 0.69 · maximum clade credibility, correlations matrices, consensus, tree, phylogeny, cephalopod
- [4] § STAR★Methods › Method details ↔ sensitivity-checks/supplement_sensitivitychecks.R, lines 1–51 · score 0.68 · maximum clade credibility, correlations matrices, tree, consensus, phylogeny, cephalopod
- [5] § STAR★Methods › Quantification and statistical analysis › Causal graph ↔ dataprep_cephs.R, lines 17–105 · score 0.66 · encompasses cognition, adjustmentSets, cephdag, exposure, defense, foraging
- [6] § STAR★Methods › Quantification and statistical analysis › Additional analyses › Age at sexual maturity ↔ sensitivity-checks/supplement_sensitivitychecks.R, lines 53–91 · score 0.64 · sexual maturity, maximum age, sensitivity checks, somewhat, sociality, species
- [7] § STAR★Methods › Quantification and statistical analysis › Additional analyses › Dietary breadth and predation pressure ↔ consensus_analyses.R, lines 217–266 · score 0.61 · Dietary breadth, diet breadth, predator breadth, interaction, predictor, benthic
- [8] § STAR★Methods › Quantification and statistical analysis › Additional analyses › Age at sexual maturity ↔ consensus_analyses.R, lines 41–128 · score 0.56 · sexual maturity, maximum age, sociality, species, CNS, brain
- [9] § STAR★Methods › Quantification and statistical analysis ↔ consensus_analyses.R, lines 1–39 · score 0.56 · consensus phylogeny, correlation matrix, bf, brms, Cormat, Models
- [10] § STAR★Methods › Quantification and statistical analysis ↔ sensitivity-checks/supplement_sensitivitychecks.R, lines 378–438 · score 0.56 · diet breadth, Sensitivity checks, predator breadth, age, species
- [11] § STAR★Methods › Quantification and statistical analysis ↔ sensitivity-checks/supplement_sensitivitychecks.R, lines 1–51 · score 0.54 · consensus phylogeny, correlation matrix, Cormat, ML, CNS, brain
- [12] § STAR★Methods › Quantification and statistical analysis › Additional analyses › Behavioral repertoire ↔ consensus_analyses.R, lines 167–215 · score 0.52 · foraging repertoire, defense repertoire
- [13] § STAR★Methods › Quantification and statistical analysis › Miscalculation in chung et al. (2023) › Variable definitions ↔ consensus_analyses.R, lines 217–266 · score 0.52 · diet.breadth, Dietary breadth, family, st.cephdat, Cephalopods
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
R · 468 lines · 23 KB · no license · 7 matches
- #using consensus phylogeny for all models, with the updated dataset April 10, 2024 excluding I. paradoxus
- #UPDATING november 19, 2024 with corrected depth data----
- #load packages----
- library(brms)
- library(ape)
- library(mice)
- library(tidyverse)
- library(cmdstanr)
- library(dagitty)
- options(scipen=999) #turn off scientific notation
- #set working directory----
- setwd("/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/ceph-brain-evolution")
- getwd()
- #read in data and phylogenies
- cephtreeMCC <- read.nexus("cephtreeMCC.tree") #consensus (maximum clade credibility) tree
- cormat <- vcv(cephtreeMCC, corr=TRUE) #correlation matrix for consensus phylogeny
- st.cephdat <- read.csv("st.cephdat.csv") #logged and standardized data
- st.cephdat$benthic <- factor(st.cephdat$benthic)
- st.cephdat$sociality.bin <- factor(st.cephdat$sociality.bin)
- st.cephdat$sociality.3 <- factor(st.cephdat$sociality.3)
- st.cephdat$habitat3 <- factor(st.cephdat$habitat3)
- st.cephdat$depth_cat <- factor(st.cephdat$depth_cat)
- #ML baseline----
- m.MLst <- brm(bf(CNS.1 ~ mi(ML.1) + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + (1 | gr(phy.species, cov = cormat))),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat = cormat),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend = "cmdstanr",
- cores = 4)
- summary(m.MLst)
- save(m.MLst, file="m.MLst.rda")
- #age of sexual maturity----
- ## with maximum age of sexual maturity and lifespan----
- m.smmax <- brm(bf(CNS.1 ~ mi(ML.1) + mi(lifespan.max) + mi(matage.max) + WoS + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))) +
- bf(matage.max | mi() ~ 1 + mi(ML.1) + mi(lifespan.max) + WoS + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))) +
- bf(lifespan.max | mi() ~ 1 + mi(ML.1) + WoS + benthic + depth.mean + (1|gr(phy.species,cov=cormat))) +
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + pos.latmean + (1|gr(phy.species, cov=cormat))),
- data=st.cephdat,
- data2=list(cormat=cormat),
- prior = c(prior(normal(0,0.5), class = Intercept),
- prior(normal(0,0.5), class = b)),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend="cmdstanr", cores=4)
- summary(m.smmax)
- save(m.smmax, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.smmax.rda")
- 0.33/0.75 #0.33 instead of 0.3 mean
- ## minimum age----
- m.smmin <- brm(bf(CNS.1 ~ mi(ML.1) + mi(lifespan.min) + mi(matage.min) + WoS + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))) +
- bf(matage.min | mi() ~ 1 + mi(ML.1) + mi(lifespan.min) + WoS + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))) +
- bf(lifespan.min | mi() ~ 1 + mi(ML.1) + WoS + benthic + depth.mean + (1|gr(phy.species,cov=cormat))) +
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + pos.latmean + (1|gr(phy.species, cov=cormat))),
- data=st.cephdat,
- data2=list(cormat=cormat),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend="cmdstanr", cores=4)
- summary(m.smmin)
- save(m.smmin, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.smmin.rda")
- -0.11/0.75
- m.smmean <- brm(bf(CNS.1 ~ mi(ML.1) + mi(lifespan.mean) + mi(matage.mean) + WoS + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))) +
- bf(matage.mean | mi() ~ 1 + mi(ML.1) + mi(lifespan.mean) + WoS + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))) +
- bf(lifespan.mean | mi() ~ 1 + mi(ML.1) + WoS + benthic + depth.mean + (1|gr(phy.species,cov=cormat))) +
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + pos.latmean + (1|gr(phy.species, cov=cormat))),
- data=st.cephdat,
- data2=list(cormat=cormat),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend="cmdstanr", cores=4)
- summary(m.smmean)
- save(m.smmean, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.smmean.rda")
- 0.26 /0.75 #instead of 0.18
- #sociality----
- ## binary----
- m.soc <- brm(bf(CNS.1 ~ mi(ML.1) + sociality.bin + WoS + benthic + depth.mean + (1|gr(phy.species,cov=cormat))) +
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + (1|gr(phy.species, cov=cormat))),
- data=st.cephdat,
- data2=list(cormat=cormat),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend="cmdstanr", cores=4)
- summary(m.soc)
- save(m.soc, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.soc.rda")
- -0.26/0.75 #-0.26 instead of -0.21
- ## 3 category----
- m.soc3 <- brm(bf(CNS.1 ~ mi(ML.1) + sociality.3 + WoS + benthic + depth.mean + (1|gr(phy.species,cov=cormat)))+
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + (1|gr(phy.species, cov=cormat))),
- data=st.cephdat,
- data2=list(cormat=cormat),
- family=gaussian("identity"),
- prior = c(prior(normal(0, 1), class = Intercept),
- prior(normal(0, 1), class = b)),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend="cmdstanr", cores=4)
- summary(m.soc3)
- save(m.soc3, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.soc3.rda")
- ## sociality decapodiformes only----
- decadat <- read.csv("decadat.csv")
- m.socdec <- brm(bf(CNS.1 ~ mi(ML.1) + sociality.bin + WoS + benthic + depth.mean + (1|gr(phy.species,cov=cormat))) +
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + (1|gr(phy.species, cov=cormat))),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data=decadat,
- data2=list(cormat=cormat),
- backend="cmdstanr", cores=4)
- summary(m.socdec)
- save(m.socdec, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/ceph-brain-evolution/nov2024_fits/m.socdec.rda")
- # behavioral complexity----
- #TB's constrained imputation function
- constrained_imputation <- function(model, vars) {
- # Extract and edit Stan code
- scode <- capture.output(stancode(model))
- # Initialize imp_code as empty
- imp_code <- scode
- for (var in vars) {
- # Match brms var name
- brms_var <- gsub("[\\._]", "", var)
- stan_var <- paste0("Ymi_", brms_var)
- # Find lower and upper bounds from the data
- lower_bound <- min(model$data[[var]], na.rm = TRUE)
- upper_bound <- max(model$data[[var]], na.rm = TRUE)
- # Amend Stan code and set lower and upper bounds on the imputed variable
- imp_code <- gsub(paste0("vector[Nmi_", brms_var, "] ", stan_var, ";"),
- paste0("vector<lower=", lower_bound, ", upper=", upper_bound, ">[Nmi_", brms_var, "] ", stan_var, ";"),
- imp_code, fixed = TRUE)
- }
- # Replace and compile the model object with the amended Stan code
- attributes(model$fit)$CmdStanModel <- cmdstan_model(write_stan_file(imp_code))
- # Fit to data with modified model
- model_constrain <- update(model,
- cores = 4, chains = 4, iter = 8000,
- recompile = FALSE,
- control = list(adapt_delta = 0.95))
- return(model_constrain)
- }
- ## combined cognition----
- m.cog.empty <- brm(bf(CNS.1 ~ mi(ML.1) + mi(cog2) + benthic + articles.read + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))) +
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat)))+
- bf(cog2 | mi() ~ 1 + benthic + articles.read + (1|gr(phy.species,cov=cormat))),
- family=gaussian,
- data=st.cephdat,
- data2=list(cormat=cormat),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- backend="cmdstanr",
- chains = 0)
- m.cog.constrained <- constrained_imputation(model = m.cog.empty,
- vars = c("ML.1", "cog2"))
- summary(m.cog.constrained)
- save(m.cog.constrained, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.cog.rda")
- ## defense repertoire----
- m.def.empty <- brm(bf(CNS.1 ~ mi(ML.1) + mi(defense.repertoire) + articles.read + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))) +
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat)))+
- bf(defense.repertoire | mi() ~ 1 + benthic + articles.read + (1|gr(phy.species,cov=cormat))),
- family=gaussian,
- data=st.cephdat,
- data2=list(cormat=cormat),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- chains = 0,
- backend="cmdstanr")
- m.def.constrained <- constrained_imputation(model = m.def.empty, vars = "defense.repertoire")
- summary(m.def.constrained)
- save(m.def.constrained, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.def.rda")
- ## foraging repertoire----
- m.hunt.empty <- brm(bf(CNS.1 ~ mi(ML.1) + mi(foraging.repertoire) + articles.read + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))) +
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat)))+
- bf(foraging.repertoire | mi() ~ 1 + benthic + articles.read + (1|gr(phy.species,cov=cormat))),
- family=gaussian,
- data=st.cephdat,
- data2=list(cormat=cormat),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- chains=0,
- backend="cmdstanr")
- m.hunt.constrained <- constrained_imputation(model = m.hunt.empty,
- vars = c("ML.1", "foraging.repertoire"))
- summary(m.hunt.constrained)
- save(m.hunt.constrained, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.hunt.rda")
- #ecological richness----
- ## dietary breadth----
- m.diet.empty <- brm(bf(CNS.1 ~ mi(ML.1) + mi(diet.breadth) + articles.read + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))) +
- bf(diet.breadth | mi() ~ 1 + mi(ML.1) + articles.read + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))) +
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))),
- family=gaussian,
- data=st.cephdat,
- data2=list(cormat=cormat),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- chains = 0,
- backend="cmdstanr")
- m.diet.constrained <- constrained_imputation(model = m.diet.empty,
- vars = c("diet.breadth"))
- summary(m.diet.constrained)
- save(m.diet.constrained, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/ceph-brain-evolution/nov2024_fits/m.diet.rda")
- ## diet-benthic interaction----
- m.dhab.empty <- brm(bf(CNS.1 ~ mi(ML.1) + mi(diet.breadth)*benthic + depth.mean + pos.latmean + articles.read + (1|gr(phy.species,cov=cormat))) +
- bf(diet.breadth | mi() ~ 1 + mi(ML.1) + articles.read + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))) +
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + pos.latmean + (1|gr(phy.species,cov=cormat))),
- family=gaussian,
- data=st.cephdat,
- data2=list(cormat=cormat),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- chains=0,
- backend="cmdstanr", cores=4)
- m.dhab.constrained <- constrained_imputation(model = m.dhab.empty, vars = "diet.breadth")
- summary(m.dhab.constrained)
- save(m.dhab.constrained, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.dhab.rda")
- ## number of predator groups----
- m.preds.empty <- brm(bf(CNS.1 ~ mi(ML.1) + mi(predator.breadth) + depth.mean + benthic + articles.read + (1 | gr(phy.species, cov = cormat))) +
- bf(predator.breadth | mi() ~ 1 + mi(ML.1) + depth.mean + benthic + articles.read + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + (1 | gr(phy.species, cov = cormat))),
- family = gaussian,
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat = cormat),
- chains=0,
- backend = "cmdstanr", cores = 4)
- m.preds.constrained <- constrained_imputation(model = m.preds.empty, vars = "predator.breadth")
- summary(m.preds.constrained)
- 0.08/0.75
- save(m.preds.constrained, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.preds.rda")
- ## predators-benthic interaction----
- m.phab.empty <- brm(bf(CNS.1 ~ mi(ML.1) + mi(predator.breadth)*benthic + articles.read + depth.mean + pos.latmean + (1 | gr(phy.species, cov = cormat))) +
- bf(predator.breadth | mi() ~ 1 + mi(ML.1) + articles.read + benthic + depth.mean + pos.latmean + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + benthic + depth.mean + pos.latmean + (1 | gr(phy.species, cov = cormat))),
- family = gaussian,
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat=cormat),
- chains=0,
- backend = "cmdstanr", cores = 4)
- m.phab.constrained <- constrained_imputation(model = m.phab.empty, vars = "predator.breadth")
- summary(m.phab.constrained)
- save(m.phab.constrained, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.phab.rda")
- ## habitat binary----
- m.benth <- brm(bf(CNS.1 ~ mi(ML.1) + benthic + WoS + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + WoS + (1 | gr(phy.species, cov = cormat))),
- prior = c(prior(normal(0, 1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat = cormat),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend = "cmdstanr",
- cores = 4)
- summary(m.benth)
- save(m.benth, file="m.benth.rda")
- 0.58/0.75
- ## habitat 3 category----
- m.hab <- brm(bf(CNS.1 ~ mi(ML.1) + habitat3 + WoS + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + WoS + (1 | gr(phy.species, cov = cormat))),
- prior = c(prior(normal(0, 1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat=cormat),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend = "cmdstanr",
- cores = 4)
- summary(m.hab)
- save(m.hab, file="m.hab.rda")
- ## latitude range----
- m.latrange <- brm(bf(CNS.1 ~ mi(ML.1) + lat.range + benthic + WoS + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + lat.range + benthic + (1 | gr(phy.species, cov = cormat))),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat=cormat),
- backend = "cmdstanr",
- iter=4000,
- cores = 4)
- summary(m.latrange)
- ## distance from equator----
- # rerunning August 2024 for distance from equator not mean
- m.eqdist <- brm(bf(CNS.1 ~ mi(ML.1) + eq.dist + benthic + WoS + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + pos.latmean + benthic + (1 | gr(phy.species, cov = cormat))),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat=cormat),
- backend = "cmdstanr",
- iter=4000,
- cores = 4)
- summary(m.eqdist)
- #and that's still nothing
- save(m.eqdist, file="m.eqdist.rda")
- ## mean depth----
- m.meandepth <- brm(bf(CNS.1 ~ mi(ML.1) + depth.mean + benthic + WoS + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + (1 | gr(phy.species, cov = cormat))),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat = cormat),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend = "cmdstanr",
- cores = 4)
- summary(m.meandepth)
- save(m.meandepth, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.meandepth.rda")
- load(file="m.meandepth.rda")
- ## maximum depth----
- m.maxdepth <- brm(bf(CNS.1 ~ mi(ML.1) + depth.max + benthic + WoS + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + (1 | gr(phy.species, cov = cormat))),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat = cormat),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend = "cmdstanr",
- cores = 4)
- summary(m.maxdepth)
- save(m.maxdepth, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.maxdepth.rda")
- 10/75 #instead of -0.22
- ## minimum depth----
- m.mindepth <- brm(bf(CNS.1 ~ mi(ML.1) + depth.min + benthic + WoS + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + (1 | gr(phy.species, cov = cormat))),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat = cormat),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend = "cmdstanr",
- cores = 4)
- summary(m.mindepth)
- save(m.mindepth, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.mindepth.rda")
- -0.17/0.75 #instead of -0.14
- ## benthic*depth----
- m.maxdb <- brm(bf(CNS.1 ~ mi(ML.1) + depth.max*benthic + WoS + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + (1 | gr(phy.species, cov = cormat))),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat = cormat),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend = "cmdstanr",
- cores = 4)
- summary(m.maxdb)
- save(m.maxdb, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.maxdb.rda")
- m.mindb <- brm(bf(CNS.1 ~ mi(ML.1) + depth.min*benthic + WoS + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + (1 | gr(phy.species, cov = cormat))),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat = cormat),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend = "cmdstanr",
- cores = 4)
- summary(m.mindb)
- save(m.mindb, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.mindb.rda")
- m.meandb <- brm(bf(CNS.1 ~ mi(ML.1) + depth.mean*benthic + WoS + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + (1 | gr(phy.species, cov = cormat))),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat = cormat),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend = "cmdstanr",
- cores = 4)
- summary(m.meandb)
- save(m.meandb, file="/Users/kiranbasava/nonhumans/di_cephproject/analyses/cephalopod_analyses/nov2024_fits/m.meandb.rda")
- ## depth categories----
- m.depthcat <- brm(bf(CNS.1 ~ mi(ML.1) + depth_cat + benthic + WoS + (1 | gr(phy.species, cov = cormat))) +
- bf(ML.1 | mi() ~ 1 + depth_cat + benthic + (1 | gr(phy.species, cov = cormat))),
- prior = c(prior(normal(0,1), class = Intercept),
- prior(normal(0,0.5), class = b)),
- data = st.cephdat,
- data2 = list(cormat=cormat),
- iter = 8000, chains = 4,
- control = list(adapt_delta = 0.89),
- backend = "cmdstanr",
- cores = 4)
- summary(m.depthcat)
- save(m.depthcat, file="m.depthcat.rda")
- #ASR and signal----
- library(phytools)
- library(mice)
- getwd()
- #decomposition of phylogenetic distance matrix into orthogonal vectors (PVRs)
- phylo.vectors = PVR::PVRdecomp(cephtreeMCC)
- cephdat <- read.csv("cephdat.csv")
- ML.dat <- cephdat[c("phy.species", "CNS.1", "ML.1")]
- ML.dat$CNS.1 <- log(ML.dat$CNS.1)
- ML.dat$ML.1 <- log(ML.dat$ML.1)
- ML.dat <- complete(mice(ML.dat)) #imputation
- #calculate EQ
- ML.dat$EQ <- ML.dat$CNS.1/ML.dat$ML.1
- logEQ <- as.vector(ML.dat$EQ)
- names(logEQ) <- ML.dat$phy.species
- #ancestral state reconstruction and plot
- ASR <- contMap(cephtreeMCC, logEQ, plot=FALSE)
- length(ASR$cols)
- ASR$cols[1:1001]<-colorRampPalette(c("#feba2c","#d6556d","#2a0593"))(1001)
- plot(ASR)
- # Plot the mapped characters with the new colors
- plot(ASR, type="fan", outline=FALSE, legend = 0.7*max(nodeHeights(cephtreeMCC)),
- fsize = c(0.5, 0.7))
- save(ASR, file="ASR.rda")
- load(file="ASR.rda")
- plot(ASR)
consensus_analyses.R at commit a0ed371, no license · at the source
Overview
- University of Oxford, Oxford, UK
- University of Arizona, Tucson, CA, USA
- Aarhus University, Aarhus, Denmark
- London School of Economics and Political Science, London, UK
- University of Lethbridge, Lethbridge, AB, Canada
- New York University, New York, NY, USA
Abstract
Social factors have been argued to be the main selection pressure for the evolution of large brains and complex behavior, but many cephalopods live largely solitary, semelparous, short lives. This suggests that the large brains found in cephalopods are not the result of social selection pressures. Here, we derive specific, preregistered predictions from the “Asocial Brain Hypothesis” (ABH; an untested extension of the cultural brain hypothesis formal model), and evaluate those predicted associations using a new comparative dataset on brain size alongside social, ecological, and life history factors. Consistent with the ABH and other hypotheses predicting that ecological factors should be the primary selection pressure with larger brains in more calorie-rich complex ecologies, we find that shallower and benthic (seafloor) habitats are associated with larger brain sizes, and that measures of sociality are not. Our findings are not interpreted as causal, but are consistent with ecological hypotheses for brain evolution.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 13 matches between paragraphs and lines of code.
kcbasava/ceph-brain-evolution
a0ed3711e8999c7bf390304926617e957fd77483, 6 February 2025Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
5 files
- consensus_analyses.R, R, 468 lines
- dataprep_cephs.R, R, 106 lines
- plots_nov24.R, R, 464 lines
- sensitivity-checks/
supplement_sensitivitych , R, 438 linesecks.R - README.md, Text, 1 line
drepanosaur/ceph-brain-evolution
a0ed3711e8999c7bf390304926617e957fd77483, 6 February 2025Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
5 files
- consensus_analyses.R, R, 468 lines, 7 matches
- dataprep_cephs.R, R, 106 lines, 1 match
- plots_nov24.R, R, 464 lines, 1 match
- sensitivity-checks/
supplement_sensitivitych , R, 438 lines, 4 matchesecks.R - README.md, Text, 1 line
kcbasava/ceph-brain-evolution.•All
Availability: 1 check, the latest on 27 September 2026: the link is dead
- 27 September 2026: the link is dead
kcbasava/ceph-brain-evolution.•Any
Availability: 1 check, the latest on 27 September 2026: the link is dead
- 27 September 2026: the link is dead
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 4 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 8 scripts, each with its path and the digest of its content;
- 13 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data and code availability
• All data have been deposited on GitHub and are publicly available as of the date of publication at www.github.com/
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 8 authors, 3 keywords, 1 funder, 72 references.
Cite
This paper
Basava, K., Bendixen, T., Leonhard, A., George, N. L., Vanhersecke, Z., Omotosho, J., Mather, J., & Muthukrishna, M. (2026). Ecological not social factors explain brain size in cephalopods. iScience, 29(7), 116324. https://
BibTeX
@article{basava2026ecolo
author = {Basava, Kiran and Bendixen, Theiss and Leonhard, Alexander and George, Nicole Lauren and Vanhersecke, Zoé and Omotosho, Joshua and Mather, Jennifer and Muthukrishna, Michael},
title = {{Ecological not social factors explain brain size in cephalopods}},
journal = {iScience},
year = {2026},
month = jul,
volume = {29},
number = {7},
pages = {116324},
publisher = {Elsevier},
issn = {2589-0042},
doi = {10.1016/
url = {https://
pmid = {42422194},
pmcid = {PMC13343137}
}
RIS
TY - JOUR
AU - Basava, Kiran
AU - Bendixen, Theiss
AU - Leonhard, Alexander
AU - George, Nicole Lauren
AU - Vanhersecke, Zoé
AU - Omotosho, Joshua
AU - Mather, Jennifer
AU - Muthukrishna, Michael
TI - Ecological not social factors explain brain size in cephalopods
T2 - iScience
J2 - iScience
PY - 2026
DA - 2026/
VL - 29
IS - 7
SP - 116324
SN - 2589-0042
PB - Elsevier
DO - 10.1016/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1016/
"type": "article-journal",
"title": "Ecological not social factors explain brain size in cephalopods",
"container-title": "iScience",
"author": [
{
"family": "Basava",
"given": "Kiran"
},
{
"family": "Bendixen",
"given": "Theiss"
},
{
"family": "Leonhard",
"given": "Alexander"
},
{
"family": "George",
"given": "Nicole Lauren"
},
{
"family": "Vanhersecke",
"given": "Zoé"
},
{
"family": "Omotosho",
"given": "Joshua"
},
{
"family": "Mather",
"given": "Jennifer"
},
{
"family": "Muthukrishna",
"given": "Michael"
}
],
"container-title-short":
"volume": "29",
"issue": "7",
"page": "116324",
"DOI": "10.1016/
"PMID": "42422194",
"PMCID": "PMC13343137",
"ISSN": "2589-0042",
"publisher": "Elsevier",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
1
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.7554/elife.107393 [code]
- Chromosome-scale genome assembly of the European common cuttlefish &
lt;i& gt;Sepia officinalis& lt;/ i& gt;. Journal: eLifeIn common: ggplot2, tidyverse, other, 3 references - [2] doi:10.1038/s42003-026-10957-8 [code]
- Brain defence by the extracellular matrix protein Cochlin.Journal: Communications biologyIn common: Stan, brms, patchwork, 2 other tools
- [3] doi:10.1371/journal.pone.0355165 [code]
- Pupillary dynamics during hands-off L2 driving and transitions of control under high cognitive load.Journal: PloS oneIn common: Stan, brms, patchwork, 2 other tools
- [4] doi:10.1162/opmi.a.372 [code]
- Broadening the Agent Preference Hypothesis Through Experiencers: Eye-Tracking and EEG Evidence of Proto-Agents and Proto-Patients.Journal: Open mind : discoveries in cognitive scienceIn common: Stan, brms, patchwork, 2 other tools
- [5] doi:10.1016/j.isci.2026.116747 [code]
- Age and loneliness relate to reduced trust learning and alterations in amygdala function.Journal: iScienceIn common: Stan, brms, patchwork, 2 other tools
- [6] doi:10.1162/nol.a.266 [code]
- The Role of the Anterior Temporal Lobe in Reading: An HD-tDCS Study.Journal: Neurobiology of language (Cambridge, Mass.)In common: Stan, brms, patchwork, 2 other tools
- [7] doi:10.1016/j.celrep.2026.117505 [code]
- Impaired spatial coding and neuronal hyperactivity in the medial entorhinal cortex of aged APP knock-in mice.Journal: Cell reportsIn common: Stan, brms, patchwork, 2 other tools
- [8] doi:10.1162/imag.a.1258 [code]
- Non-specific increase in alpha power during a neurofeedback session targeting its downregulation.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Stan, brms, patchwork, 2 other tools
- [9] doi:10.1038/s44271-026-00431-w [code]
- Alpha power increases spontaneously during a neurofeedback session.Journal: Communications psychologyIn common: Stan, brms, patchwork, 2 other tools
- [10] doi:10.1111/jne.70257 [code]
- A symmetric systemic challenge elicits a right-biased response mediated by vasopressin signaling.Journal: Journal of neuroendocrinologyIn common: Stan, brms, patchwork, 1 other tool
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 4 repositories of the authors' code, each at its verified commit and with its license, 8 scripts, and 13 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:86a89f2326fb57d7…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
