Supplementary material Text S1. Behavioural measurements in nestlings before and after 2011 Just before fledging (day 16), morphometric and behavioural measurements were taken on all the nestlings. Handling aggression has been measured from 2006 and 2007 onwards in adults and nestlings respectively and breath rates from 2007 onwards. Until 2010, nestlings were taken out of their box and placed individually in a small paper bag, the order of these being then randomized and nestlings were measured and assayed. From 2011 onwards, nestlings were taken out of the box and placed jointly in a large paper bag and taken from there individually to be measured and assayed. We tested whether changes in the protocol used to assay behaviours of nestlings had consequences for genetic variances. We estimated the genetic correlation for each trait contrasting measures before and after 2011. We used animal models for HA and BR separately, with sex, observer, year and order of measurement as fixed effects and nest of rearing as additional random effect. We obtained genetic correlations close to 1 (0.99±0.01 for BR, 0.88±0.32 for HA). We concluded that these measurements are reflecting the same nestling traits independently of the details of how they were measured. Text S2. R script used for the simulation of extra-pair paternities and for the estimation of the quantitative genetic parameters based on the resulting pedigrees. library(pedantics) library(asreml) #Import files young<-read.csv("young_2003_2013_25042014.csv",header=T,sep=",", na.strings= c(""," ","-99","-999")) basic<-read.csv("Basic_data_2003_2013.csv",header=T,sep=",", na.strings= c("-999",""," ","-99","0")) Data<-read.table("ontoData2013.txt", header=T,na.strings=c("-999") ) basic<-subset(basic,basic$species=="BT") #Create data frames for nestlings and adults containing brood IDs #that can be merged basic.parents<-data.frame("NestID"=basic$NestID,"Mother"=basic$fem_MATLAB, "Father"=basic$mal_MATLAB) young.rings<-data.frame("Ring"=young$Ring, "NestID"=young$GeneticID, "Year"=young$Year) young.rings<-subset(young.rings,is.na(young.rings$Ring)==FALSE) young.rings<-unique(young.rings) Pedigree<-merge(young.rings,basic.parents,all=T) # remove the nest IDs where no nestlings ringed Pedigree<-subset(Pedigree, is.na(Pedigree$Ring)==FALSE) Pedigree<-Pedigree[order(Pedigree$NestID),] #Only take broods where Father is known. Ped_red<-subset(Pedigree, is.na(Pedigree$Father)==FALSE) broodsize<-aggregate(Ped_red$Ring, list(Ped_red$NestID), length) colnames(broodsize)<-c("NestID", "Size") ############################################################################### ################Simulation part Data$YEAR<-as.factor(Data$YEAR) Data$RearID<-as.factor(Data$RearID) Data$GeneticID<-as.factor(Data$GeneticID) Data$Sex<-as.factor(Data$Sex) Data$HAa<-as.numeric(Data$HAa) Data$HAn<-as.numeric(Data$HAn) #Pin function will be used to calculate genetic correlations and heritabilities pin<-function (object, transform) { pframe <- as.list(object$gammas) names(pframe) <- paste("V", seq(1, length(pframe)), sep = "") tvalue <- eval(deriv(transform[[length(transform)]], names(pframe)), pframe) X <- as.vector(attr(tvalue, "gradient")) X[object$gammas.type == 1] <- 0 tname <- if (length(transform) == 3) transform[[2]] else "" n <- length(pframe) i <- rep(1:n, 1:n) j <- sequence(1:n) k <- 1 + (i > j) Vmat <- object$ai se <- sqrt(sum(Vmat * X[i] * X[j] * k)) data.frame(row.names = tname, Estimate = tvalue, SE = se) } #Prepare the data frames Sim_EPP<-data.frame("LogL1"=NA, "LogL2"=NA, "Convergence M1"=NA, "Convergence M2"=NA, "EPO Broods"=NA, "EPO prop"= NA) VA_sim<-data.frame("HAn"=NA, "HAa"=NA, "BRn"=NA, "BRa"=NA,"HAnHAa"=NA, "BRnBRa"=NA, "BRaHAa"=NA, "BRnHAn"=NA, "BRnHAa"=NA, "BRaHAn"=NA) VPE_sim<-data.frame( "HAa"=NA,"BRa"=NA, "BRaHAa"=NA) VB_sim<-data.frame("HAn"=NA, "BRn"=NA, "BRnHAn"=NA) VR_sim<-data.frame("HAn"=NA, "HAa"=NA, "BRn"=NA, "BRa"=NA,"BRnHAn"=NA,"BRaHAa"=NA ) #Run the loop for (i in 1:1000){ #Generate pedigrees where paternal links are removed #Attribute a number of EPY for each brood n.broods=805 n.EPC<-rpois(n.broods,0.8751) s=0.1555 f.per.brood=n.EPC*s/(n.EPC*s+(1-s)) broodsize$EPY.per.brood<-rbinom(n.broods,broodsize$Size,f.per.brood) #Number of broods with EPO will be saved in a table broodsize$EPO<-ifelse(broodsize$EPY.per.brood >=1, 1, 0) Ped_red.size<-merge(Ped_red, broodsize, all=T) Ped.EPP<-Pedigree #Choose randomly which offspring are EPY in each brood for (y in 1:805){ Brood<-subset(Ped_red.size, Ped_red.size$NestID==as.character(broodsize[y,1])) EPY.Ring<-sample(Brood$Ring,Brood$EPY.per.brood) #Delete information on father for these rings Ped.EPP[Ped.EPP$Ring %in% EPY.Ring,5]<-NA } ##Add the founders to the pedigree Females<-basic.parents$Mother[!is.na(basic.parents$Mother)] Females<-unique(Females) Females<-Females[-which(Females %in% Ped.EPP$Ring)] Males<-basic.parents$Father[!is.na(basic.parents$Father)] Males<-unique(Males) Males<-Males[-which(Males %in% Ped.EPP$Ring)] Femalesped<-data.frame("Ring"=Females, "Year"=NA,"Mother"=NA,"Father"=NA) Malesped<-data.frame("Ring"=Males, "Year"=NA,"Mother"=NA,"Father"=NA) Pedigreetot<-rbind(Femalesped, Malesped,Ped.EPP[,c(2:5)]) Pedigreetot$Mother<-as.factor(Pedigreetot$Mother) Pedigreetot$Father<-as.factor(Pedigreetot$Father) Ped<-Pedigreetot[,c(1,4,3)] Ped<-fixPedigree(Ped=Ped) colnames(Ped)<-c("Ring", "Father", "Mother") #Run the animal models #create the inverse of the relationship matrix from the pedigree file ainv<-asreml.Ainverse(Ped)$ginv #starting values are needed. sv<-asreml(cbind(HAn,BRn,HAa,BRa)~trait+YEAR+ at(trait,3):Sex+at(trait,4):Sex + at(trait,3):OBSa +at(trait,4):OBSa+ at(trait,1):OBSn+at(trait,2):OBSn ,random=~us(trait):ped(Ring)+us(trait):ide(Ring)+us(trait):RearID ,rcov= ~ units:us(trait) ,data=Data ,ginverse=list(Ring=ainv) , na.method.X="include", na.method.Y ="include" ,maxiter=20, start.values=TRUE) gam<-sv$gammas.table gam$fac<-factor(c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41)) #No constraint in this model M<-asreml.constraints(~fac, gammas=gam) gam$Value[c(1:10)]=c(0.3,0,0.03,0.1,0,3,0,0,0,0.03) gam$Value[c(11:20)]=c(0.7,0.01,0.01,0,0,0.1,0,0,0.1,0.1) gam$Value[c(21:30)]=c(0.3,0.001,0.03,0,0,0.001,0,0,0,0.001) gam$Value[c(32:41)]=c(0.001,0,0.001,0,0,7,0,0,0.05,0.1) gam$Constraint[c(14,15,17,18,24,25,26,27,28,29,30,32,33,34,35,36,38,39)]="F" gam$Constraint[c(1:13,16,19,20:23,37,40,41)]="U" model.1<-asreml(cbind(HAn,BRn,HAa,BRa)~trait+YEAR+at(trait,3):Sex+ at(trait,4):Sex + at(trait,3):OBSa +at(trait,4):OBSa+ at(trait,1):OBSn+at(trait,2):OBSn ,random=~us(trait):ped(Ring)+us(trait):ide(Ring)+us(trait):RearID ,rcov= ~ units:us(trait) ,data=Data ,ginverse=list(Ring=ainv) , na.method.X="include", na.method.Y ="include" ,maxiter=100,constraints=M,G.param=gam,R.param=gam) #HABR (parameter 2) constrained over the ontogeny for model 2 gam$fac<-factor(c(1,2,3,4,5,6,7,8,2,10,11,12,13,14,15,16,17,18, 19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41)) M<-asreml.constraints(~fac, gammas=gam) model.2<-asreml(cbind(HAn,BRn,HAa,BRa)~trait+YEAR+at(trait,3):Sex+ at(trait,4):Sex + at(trait,3):OBSa +at(trait,4):OBSa+ at(trait,1):OBSn+at(trait,2):OBSn ,random=~us(trait):ped(Ring)+us(trait):ide(Ring)+us(trait):RearID ,rcov= ~ units:us(trait) ,data=Data ,ginverse=list(Ring=ainv) , na.method.X="include", na.method.Y ="include" ,maxiter=20,constraints=M,G.param=gam,R.param=gam) Sim_EPP[i,1]<-summary(model.1)$loglik Sim_EPP[i,2]<-summary(model.2)$loglik Sim_EPP[i,3]<-model.1$conv Sim_EPP[i,4]<-model.2$conv Sim_EPP[i,5]<-sum(broodsize$EPO) Sim_EPP[i,6]<-mean(broodsize[,3]/broodsize[,2]) VA_sim[i,1]<-pin(model.1, va.HAn ~ V1 / (V1+V11+V21))[1] VA_sim[i,2]<-pin(model.1, va.HAa ~ V6 / (V6+V16+V37))[1] VA_sim[i,3]<-pin(model.1, va.BRn ~ V3 / (V3+V13+V23))[1] VA_sim[i,4]<-pin(model.1, va.BRa ~ V10 / (V10+V20+V41))[1] VA_sim[i,5]<-pin(model.1, ra.HAn.HAa ~ V4 / sqrt(V1*V6))[1] VA_sim[i,6]<-pin(model.1, ra.BRn.BRa ~ V8 / sqrt(V3*V10))[1] VA_sim[i,7]<-pin(model.1, ra.BRa.HAa ~ V9 / sqrt(V6*V10))[1] VA_sim[i,8]<-pin(model.1, ra.BRn.HAn ~ V2 / sqrt(V3*V1))[1] VA_sim[i,9]<-pin(model.1, ra.BRn.HAa ~ V5 / sqrt(V3*V6))[1] VA_sim[i,10]<-pin(model.1, ra.BRa.HAn ~ V7 / sqrt(V1*V10))[1] VPE_sim[i,1]<-pin(model.1, vpe.HAa ~ V16 / (V6+V16+V37))[1] VPE_sim[i,2]<-pin(model.1, vpe.BRa ~ V20 / (V10+V20+V41))[1] VPE_sim[i,3]<-pin(model.1, rpe.HAa.BRa ~ V19 / sqrt(V20*V16))[1] VB_sim[i,1]<-pin(model.1, vb.HAn ~ V21/ (V1+V11+V21))[1] VB_sim[i,2]<-pin(model.1, vb.BRn ~ V23 / (V3+V13+V23))[1] VB_sim[i,3]<-pin(model.1, rb.HAn.BRn ~ V22 / sqrt(V21*V23))[1] VR_sim[i,1]<-pin(model.1, VR_sim[i,2]<-pin(model.1, VR_sim[i,3]<-pin(model.1, VR_sim[i,4]<-pin(model.1, VR_sim[i,5]<-pin(model.1, VR_sim[i,6]<-pin(model.1, vr.HAn ~ V11 vr.HAa ~ V37 vr.BRn ~ V13 vr.BRa ~ V41 rr.HAn.BRn ~ rr.HAa.BRa ~ / (V1+V11+V21))[1]#taken from ide matrix / (V6+V16+V37))[1] / (V3+V13+V23))[1]#taken from ide matrix / (V10+V20+V41))[1] V12 / sqrt(V11*V13))[1]#taken from ide V40 / sqrt(V37*V41))[1] } ############################################################################ ######################End of the simulation #Estimate the genetic correlations HAnHAa<-posterior.mode(as.mcmc((VA_sim[,5]))) CIHAnHAa<-HPDinterval(as.mcmc((VA_sim[,5])),0.95) BRnBRa<-posterior.mode(as.mcmc((VA_sim[,6]))) CIBRnBRa<-HPDinterval(as.mcmc((VA_sim[,6])),0.95) HAaBRa<-posterior.mode(as.mcmc((VA_sim[,7]))) CIHAaBRa<-HPDinterval(as.mcmc((VA_sim[,7])),0.95) HAnBRn<-posterior.mode(as.mcmc((VA_sim[,8]))) CIHAnBRn<-HPDinterval(as.mcmc((VA_sim[,8])),0.95) BRnHAa<-posterior.mode(as.mcmc((VA_sim[,9]))) CIBRnHAa<-HPDinterval(as.mcmc((VA_sim[,9])),0.95) HAnBRa<-posterior.mode(as.mcmc((VA_sim[,10]))) CIHAnBRa<-HPDinterval(as.mcmc((VA_sim[,10])),0.95) Text S3. R script used for the simulation of breeding values across ontogeny: library(mvtnorm) # Use the genetic variance-covariance matrix to simulate BV in nestlings sigma <- matrix(c(0.38,-0.06,-0.06,0.04), ncol=2) nestlings <- rmvnorm(n=1000, mean = rep(0, nrow(sigma)),sigma=sigma) nestlings<-data.frame("BVHA"=nestlings[,1], "BVBR"=nestlings[,2]) cor.test(nestlings$BVHA,nestlings$BVBR) # Simulate breeding values for adult traits based on the BV of nestling ## traits (X1) and the cross-ontogeny correlations (rho) ### using the function getBiCop # Cross-trait-cross-ontogeny correlations are not modelled # The function “getBiCop” was created by Dr. Felix Schönbrodt, Ludwig-Maximilian#University (LMU) Munich, Germany, and can be found at: #http://stats.stackexchange.com/questions/15011/generate-a-random-variable-with-a#defined-correlation-to-an-existing-variable getBiCop <- function(n, rho, X1 , sd) { C <- matrix(rho, nrow = 2, ncol = 2) diag(C) <- 1 C <- chol(C) X2 <- rnorm(n, mean=0, sd) X <- cbind(X1,X2) # induce the correlation (does not change X1) df <- X %*% C return(df) } BVHA<-as.data.frame(getBiCop(10000,0.38,nestlings$BVHA,sd(nestlings$BVHA))) colnames(BVHA)<-c("HAn", "HAa") BVBR<-as.data.frame(getBiCop(10000,0.50,nestlings$BVBR,sd(nestlings$BVBR))) colnames(BVBR)<-c("BRn", "BRa") Correlations<-data.frame("HAnBRn"=NA,"HAnHAa"=NA,"BRnBRa"=NA,"HAnBRa"=NA,"BRnHAa"=NA, "HAaBRa"=NA) for (i in 1:1000){ BVHA<-as.data.frame(getBiCop(1000,0.38,nestlings$BVHA,0.56)) colnames(BVHA)<-c("HAn", "HAa") BVBR<-as.data.frame(getBiCop(1000,0.5,nestlings$BVBR,0.2)) colnames(BVBR)<-c("BRn", "BRa") Correlations[i, Correlations[i, Correlations[i, Correlations[i, Correlations[i, Correlations[i, 1]<-cor.test(BVHA$HAn,BVBR$BRn)$estimate 2]<-cor.test(BVHA$HAn,BVHA$HAa)$estimate 3]<-cor.test(BVBR$BRn,BVBR$BRa)$estimate 4]<-cor.test(BVHA$HAn,BVBR$BRa)$estimate 5]<-cor.test(BVBR$BRn,BVHA$HAa)$estimate 6]<-cor.test(BVHA$HAa,BVBR$BRa)$estimate } require(MCMCglmm) posterior.mode(as.mcmc((Correlations[,1]))) HPDinterval(as.mcmc((Correlations[,1])),0.95) posterior.mode(as.mcmc((Correlations[,2]))) HPDinterval(as.mcmc((Correlations[,2])),0.95) posterior.mode(as.mcmc((Correlations[,3]))) HPDinterval(as.mcmc((Correlations[,3])),0.95) posterior.mode(as.mcmc((Correlations[,4]))) HPDinterval(as.mcmc((Correlations[,4])),0.95) posterior.mode(as.mcmc((Correlations[,5]))) HPDinterval(as.mcmc((Correlations[,5])),0.95) posterior.mode(as.mcmc((Correlations[,6]))) HPDinterval(as.mcmc((Correlations[,6])),0.95) Table S1: Data structure of the four behavioural traits measured. Handling aggression is a score from 1 to 5 describing how aggressive an individual is during handling and is measured in nestlings (HAn) and in adults (HAa). Breath rate is the number of breaths per second measured during handling and is measured in nestlings (BRn) and in adults (BRa). For each trait, we present the total number of observations (Nobs) and the number of individuals measured (Nind) with between parentheses the number of individuals with 1, 2, 3, 4, or 5 repeated observations in the data. The mean, standard deviation (SD) and range are provided. Han BRn HAa BRa Nobs Nindiv (1/2/3/4/5/6) Mean SD Range 6149 5863 1633 1526 6149 5863 1103(766/209/79/36/10/3) 1031(720/182/89/28/9/3) 2.62 1.89 3.00 2.38 1.20 0.42 1.11 0.45 1-5 0.81 - 4.26 1-5 1.41 - 5.22 Table S2: Genetic correlations of handling aggression and breathing rate in adults of age 1, 2 and 3+ years old (n=1038 for HA, n=998 for BR). Age was estimated based on the colouration of the greater coverts as either yearling or older. Hence, only individuals of known age such as recruits and individuals caught for the first time at 1 year old were considered. Genetic correlations (upper triangle) are represented as estimate ±SE and are derived from the matrix of additive genetic effects estimated by a multivariate animal model, where HA and BR in different age classes are considered as 3 different traits. Correlations were not significantly different from 1 as judged form a LRT (HA: χ2= 0.33, d.f. = 3, P = 0.95; BR: χ2= 0.29,d.f=3, P=0.96). Trait Handling aggression: Correlation ± SE Age 2 Age 3 Age 1 0.99 ± n.e. 0.78 ± 0.33 Age 2 Age 3 Age 1 0.99 ± n.e. 0.86 ± 0.24 Age 2 0.99 ± n.e. Breath rate: Age 2 0.81 ± 0.38 Table S3: Proportion of the phenotypic variance (VP) due to different variance components (VA: additive genetic variance, VB: common environment variance in nestlings due to being reared in the same brood, VE: permanent environment variance, VR: residual variance). These variance components have been estimated using the multivariate mixed-effects model for HA and BR in adults and nestlings Trait Variance component Proportion of VP ±SE HAn VA VB VR 0.26 ± 0.04 0.19 ± 0.02 0.54 ± 0.03 BRn VA VB VR 0.28 ± 0.04 0.23± 0.02 0.50± 0.03 HAa VA VE VR 0.29 ± 0.06 0.11 ± 0.06 0.60 ± 0.04 BRa VA VE VR 0.27 ± 0.06 0.11± 0.06 0.63 ± 0.04 . Table S4: Estimates of the correlation between handling aggression and breathing rate in nestlings and adults and their standard error for different components of variance. These correlations have been estimated using the multivariate mixed-effects model for HA and BR in adults and nestlings. Component Nestlings Additive genetic -0.49 ±0.09 Permanent environment Adults 0.07 ± 0.16 -0.67 ± 0.49 Common environment -0.26 ±0.07 Residual -0.19 ±0.03 0.18 ± 0.04 Phenotypic -0.36 ±0.03 0.07 ± 0.03 Table S5: Estimates and conditional Wald-F tests of the fixed effects included in the multivariate mixed effects model for HA and BR in adults and nestlings. The sex-specific contrast “male” specifies the difference in trait value of a male relative to a female for adult traits. Estimate ± SE Fcond df P 2.68 ± 0.12 5294 22.62 2.895 1 3 7 <0.001 <0.001 0.005 1.78 ± 0.03 23900 47.67 17.6 1 3 6 <0.001 <0.001 <0.001 3.14 ± 0.29 0.46 ± 0.06 7800 57.49 9.701 4.221 1 1 6 6 <0.001 <0.001 <0.001 <0.001 2.58 ± 0.11 -0.31 ± 0.02 35840 187.8 31.96 8.368 1 1 6 5 <0.001 <0.001 <0.001 <0.001 HA in nestlings : Intercept Observer Year BR in nestlings : Intercept Observer Year HA in adults : Intercept Sex (male) Observer Year BR in adults : Intercept Sex (male) Observer Year Table S6: Genetic correlations and heritabilities of handling aggression (HA) and breath rate (BR) in recruited nestlings, non-recruited nestlings and adults. Genetic correlations (upper triangle) and heritabilities (diagonal) are represented as estimate ± 1SE and are derived from the fully unconstrained matrix of additive genetic (co)variances (model I/I/I in Table 2). The genetic correlations underlying the HA – BR behavioural syndrome in the recruited and non-recruited nestlings are indicated in bold and these are reported in the main text. HArec BRrec HAnonrec BRnonrec HAa BRa 0.31± 0.09 -0.59 ± 0.27 0.21 ±0.1 1.00 ± n.e. -0.56 ± 0.21 0.25± 0. 04 -0.50 ± 0.15 0.89 ± 0.18 -0.46 ± 0.09 0.30± 0.04 0.25 ± 0.17 -0.14 ± 0.21 0.37 ± 0.11 -0.19 ± 0.10 0.31 ±0.06 0.22 ± 0.20 0.21 ± 0.23 0.07 ± 0.12 0.53 ± 0.11 -0.11 ± 0.15 0.30± 0.06 Figure S1: Additive genetic correlations estimated by the animal model using the population’s social pedigree (filled symbols) and simulated pedigrees with extra-pair paternity (open symbols). Point estimates and SE of each correlation were calculated over all the simulations using highest posterior density distributions. The point estimates of the genetic correlations obtained for the social pedigree always fall within the range of the simulated correlations which confirms that the results are robust to integration of uncertainty in pedigree links due to extra-pair paternity. Figure S2: Distribution of the χ2 used to compare the models where HABR was unconstrained across ontogeny to the models where HAnBRn and HAaBRa were constrained to the same value (2*(logL model1- logL model2) for all the simulated pedigrees with extra-pair paternity. The thick black vertical line represents the χ2 value of 3.8 above which the difference between two models differing by 1 degree of freedom is significant (P<0.05).