#running null BDNF in CANDLE for trauma paper file.choose() merged1<-read.csv("/Users/stefaniepilkay/Candle.csv", as.is = TRUE) females<-subset(merged1, merged1$SEX==2) males<-subset(merged1, merged1$SEX==1) #checking phenotype variables #checking distribution of child abuse reported according neonate sex a<-lm(merged1$ChAb~merged1$SEX) summary(a) boxplot(merged1$ChAb~merged1$SEX, names=c("Males","Females"), ylab="Maternal Child Abuse") counts<-table(merged1$ChAb,merged1$SEX) barplot(counts,col=c("black","grey"), names=c("Males","Females"), ylab="Maternal Child Abuse in Grey",cex.names=1.5, cex.lab=1.5) #get N for interpersonal trauma #Assessing distribution of reported interpersonal trauma according to neonate sex a<-lm(merged1$InterpTr~merged1$SEX) summary(a) #boxplot of maternal fear by neonate sex to assess distribution differences boxplot(merged1$CFH~merged1$SEX, names=c("Males","Females"), ylab="Maternal Fear") #generating tables of interpersonal trauma according to neonate sex table(male1$InterpTr) table(female1$InterpTr) #assessing correlations among phenotype variables according to neonate sex cor.test(merged1$InterpTr,merged1$CFH) cor.test(males$InterpTr,males$CFH) cor.test(females$InterpTr,females$CFH) cor.test(merged1$trtime,merged1$CFH) cor.test(males$trtime,males$CFH) cor.test(females$trtime,females$CFH) #Full cohort neonates #Maternal fear analyses #Association between bdnf methylation (1st CpG probe) and maternal fear while controlling cell type, neonate race and sex a<-lm(merged1$cg16257091~merged1$CFH + merged1$SEX + merged1$Chdrace + merged1$M3_CD4 + merged1$M3_CD8 + merged1$M3_CD14 + merged1$M3_CD19 + merged1$M3_CD56) summary(a) #Association between bdnf methylation (2nd CpG probe) and maternal fear while controlling cell type, neonate race and sex a<-lm(merged1$cg27351358~merged1$CFH + merged1$SEX + merged1$Chdrace + merged1$M3_CD4 + merged1$M3_CD8 + merged1$M3_CD14 + merged1$M3_CD19 + merged1$M3_CD56) summary(a) plot(merged1$CFH,merged1$cg27351358, xlab="Maternal Fear", ylab="BDNF Methylation cg27351358") intercept <- (a$coefficients[1] + (a$coefficients[3] * mean(merged1$Chdrace, na.rm = T)) + (a$coefficients[4] * mean(merged1$M3_CD4, na.rm = T))+ (a$coefficients[5] * mean(merged1$M3_CD8, na.rm = T)) + (a$coefficients[6] * mean(merged1$M3_CD14, na.rm = T)) + (a$coefficients[7] * mean(merged1$M3_CD19, na.rm = T)) +(a$coefficients[8]* mean(merged1$M3_CD56, na.rm = T))) abline(intercept, a$coefficients[2], col = "black") #bdnf expression and maternal fear, controlled cell types and neonate race and sex a<-lm(merged1$ILMN_1809543~merged1$CFH+merged1$SEX+merged1$M3_CD4+merged1$M3_CD8+merged1$M3_CD14+merged1$M3_CD19+merged1$M3_CD56+merged1$Chdrace) summary(a) plot(merged1$CFH,merged1$ILMN_1809543, ylab="Maternal Fear", xlab="BDNF ILMN_1809543") intercept <- (a$coefficients[1] + (a$coefficients[3] * mean(merged1$M3_CD4, na.rm = T)) + (a$coefficients[4] * mean(merged1$M3_CD8, na.rm = T))+ (a$coefficients[5] * mean(merged1$M3_CD14, na.rm = T))+ (a$coefficients[6] * mean(merged1$M3_CD19, na.rm = T))+ (a$coefficients[7] * mean(merged1$M3_CD56, na.rm = T)+(a$coefficients[8] * mean(merged1$Chdrace, na.rm = T)))) abline(intercept, a$coefficients[2], col = "black") #Child abuse analyses #bdnf expression and maternal child abuse while controlling cell type and neonate race and sex a<-lm(merged1$ILMN_1809543~merged1$ChAb+merged1$SEX+merged1$Chdrace+merged1$M3_CD4+merged1$M3_CD8+merged1$M3_CD14+merged1$M3_CD19+merged1$M3_CD56) summary(a) boxplot(merged1$ILMN_1809543~merged1$ChAb, names=c("0","1"), ylab="BDNF Gene Expression",ylim=c(4,8),cex.names=2, cex.lab=1) #bdnf methylation probe 1 and maternal child abuse while controlling cell type and neonate race and sex a<-lm(merged1$cg16257091~merged1$ChAb+merged1$SEX+merged1$Chdrace+merged1$M3_CD4+merged1$M3_CD8+merged1$M3_CD14+merged1$M3_CD19+merged1$M3_CD56) summary(a) boxplot(merged1$cg16257091~merged1$ChAb, names=c("0","1"), ylab="BDNF Methylation",ylim=c(4,8),cex.names=2, cex.lab=1) #bdnf methylation probe 2 and maternal child abuse while controlling cell type and neonate race and sex a<-lm(merged1$cg27351358~merged1$ChAb+merged1$SEX+merged1$Chdrace+merged1$M3_CD4+merged1$M3_CD8+merged1$M3_CD14+merged1$M3_CD19+merged1$M3_CD56) summary(a) boxplot(merged1$cg27351358~merged1$ChAb, names=c("0","1"), ylab="BDNF Methylation",ylim=c(4,8),cex.names=2, cex.lab=1) #Interpersonal trauma analyses #bdnf methylation (1st CpG probe) and maternal interpersonal trauma while controlling cell type and neonate race and sex a<-lm(merged1$cg16257091~merged1$InterpTr+merged1$SEX+merged1$Chdrace+merged1$M3_CD4+merged1$M3_CD8+merged1$M3_CD14+merged1$M3_CD19+merged1$M3_CD56) summary(a) #bdnf methylation (2nd CpG probe) and maternal interpersonal trauma while controlling cell type and neonate race and sex a<-lm(merged1$cg27351358~merged1$InterpTr + merged1$SEX + merged1$Chdrace + merged1$M3_CD4 + merged1$M3_CD8 + merged1$M3_CD14 + merged1$M3_CD19 + merged1$M3_CD56) summary(a) boxplot(merged1$cg27351358~merged1$InterpTr, names=c("0","1"), ylab="BDNF Methylation",ylim=c(4,8),cex.names=2, cex.lab=1) #bdnf expression and maternal interpersonal trauma while controlling cell type and neonate race and sex a<-lm(merged1$ILMN_1809543~merged1$InterpTr+merged1$SEX+merged1$Chdrace+merged1$M3_CD4+merged1$M3_CD8+merged1$M3_CD14+merged1$M3_CD19+merged1$M3_CD56) summary(a) boxplot(merged1$ILMN_1809543~merged1$InterpTr, names=c("0","1"), ylab="BDNF Gene Expression",ylim=c(4,8),cex.names=2, cex.lab=1) #Male neonates #Maternal fear analyses #Association between bdnf methylation (1st CpG probe) and maternal fear in male neonates while controlling cell type and neonate race a<-lm(males$cg16257091~males$CFH+males$Chdrace+males$M3_CD4+males$M3_CD8+males$M3_CD14+males$M3_CD19+males$M3_CD56) summary(a) #Association between bdnf methylation (2nd CpG probe) and maternal fear in male neonates while controlling cell type and neonate race a<-lm(males$cg27351358~males$CFH + males$Chdrace + males$M3_CD4 + males$M3_CD8 + males$M3_CD14 + males$M3_CD19 + males$M3_CD56) summary(a) plot(males$CFH,males$cg27351358, xlab="Maternal Fear", ylab="BDNF Methylation cg27351358") intercept <- (a$coefficients[1] + (a$coefficients[3] * mean(males$Chdrace, na.rm = T)) + (a$coefficients[4] * mean(males$M3_CD4, na.rm = T))+ (a$coefficients[5] * mean(males$M3_CD8, na.rm = T)) + (a$coefficients[6] * mean(males$M3_CD14, na.rm = T)) + (a$coefficients[7] * mean(males$M3_CD19, na.rm = T)) +(a$coefficients[8]* mean(males$M3_CD56, na.rm = T))) abline(intercept, a$coefficients[2], col = "black") #male neonates, bdnf expression and maternal fear, controlled cell types and neonate race a<-lm(males$ILMN_1809543~males$CFH+males$M3_CD4+males$M3_CD8+males$M3_CD14+males$M3_CD19+males$M3_CD56+males$Chdrace) summary(a) plot(males$CFH,males$ILMN_1809543, ylab="Maternal Fear", xlab="BDNF ILMN_1809543") intercept <- (a$coefficients[1] + (a$coefficients[3] * mean(males$M3_CD4, na.rm = T)) + (a$coefficients[4] * mean(males$M3_CD8, na.rm = T))+ (a$coefficients[5] * mean(males$M3_CD14, na.rm = T))+ (a$coefficients[6] * mean(males$M3_CD19, na.rm = T))+ (a$coefficients[7] * mean(males$M3_CD56, na.rm = T)+(a$coefficients[8] * mean(males$Chdrace, na.rm = T)))) abline(intercept, a$coefficients[2], col = "black") #Child abuse analyses #bdnf expression and maternal child abuse while controlling cell type and neonate race in male neonates a<-lm(males$ILMN_1809543~males$ChAb+males$Chdrace+males$M3_CD4+males$M3_CD8+males$M3_CD14+males$M3_CD19+males$M3_CD56) summary(a) boxplot(males$ILMN_1809543~males$ChAb, names=c("0","1"), ylab="BDNF Gene Expression",ylim=c(4,8),cex.names=2, cex.lab=1) #bdnf methylation probe 1 and maternal child abuse while controlling cell type and neonate race in male neonates a<-lm(males$cg16257091~males$ChAb+males$Chdrace+males$M3_CD4+males$M3_CD8+males$M3_CD14+males$M3_CD19+males$M3_CD56) summary(a) boxplot(males$cg16257091~males$ChAb, names=c("0","1"), ylab="BDNF Methylation",ylim=c(4,8),cex.names=2, cex.lab=1) #bdnf methylation probe 2 and maternal child abuse while controlling cell type and neonate race in male neonates a<-lm(males$cg27351358~males$ChAb+males$Chdrace+males$M3_CD4+males$M3_CD8+males$M3_CD14+males$M3_CD19+males$M3_CD56) summary(a) boxplot(males$cg27351358~males$ChAb, names=c("0","1"), ylab="BDNF Methylation",ylim=c(4,8),cex.names=2, cex.lab=1) #Interpersonal trauma analyses #bdnf methylation (1st CpG probe) and maternal interpersonal trauma in male neonates while controlling cell type and neonate race a<-lm(males$cg16257091~males$InterpTr+males$Chdrace+males$M3_CD4+males$M3_CD8+males$M3_CD14+males$M3_CD19+males$M3_CD56) summary(a) #bdnf methylation (2nd CpG probe) and maternal interpersonal trauma in male neonates while controlling cell type and neonate race a<-lm(males$cg27351358~males$InterpTr + males$Chdrace + males$M3_CD4 + males$M3_CD8 + males$M3_CD14 + males$M3_CD19 + males$M3_CD56) summary(a) boxplot(males$cg27351358~males$InterpTr, names=c("0","1"), ylab="BDNF Methylation",ylim=c(4,8),cex.names=2, cex.lab=1) #bdnf expression and maternal interpersonal trauma while controlling cell type and neonate race in male neonates a<-lm(males$ILMN_1809543~males$InterpTr+males$Chdrace+males$M3_CD4+males$M3_CD8+males$M3_CD14+males$M3_CD19+males$M3_CD56) summary(a) boxplot(males$ILMN_1809543~males$InterpTr, names=c("0","1"), ylab="BDNF Gene Expression",ylim=c(4,8),cex.names=2, cex.lab=1) #Female neonate analyses #Maternal fear #female neonates, bdnf methylation and maternal fear, controlled cell types and neonate race a<-lm(females$cg16257091~females$CFH+females$M3_CD4+females$M3_CD8+females$M3_CD14+females$M3_CD19+females$M3_CD56+females$Chdrace) summary(a) plot(females$CFH,females$cg16257091, ylab="Maternal Fear", xlab="BDNF cg16257091") intercept <- (a$coefficients[1] + (a$coefficients[3] * mean(females$M3_CD4, na.rm = T)) + (a$coefficients[4] * mean(females$M3_CD8, na.rm = T))+ (a$coefficients[5] * mean(females$M3_CD14, na.rm = T))+ (a$coefficients[6] * mean(females$M3_CD19, na.rm = T))+ (a$coefficients[7] * mean(females$M3_CD56, na.rm = T)+(a$coefficients[8] * mean(females$Chdrace, na.rm = T)))) abline(intercept, a$coefficients[2], col = "black") #femaile neonates, bdnf methylation probe 2, maternal fear, controlled cell types and neonate race a<-lm(females$cg27351358~females$CFH+females$M3_CD4+females$M3_CD8+females$M3_CD14+females$M3_CD19+females$M3_CD56+females$Chdrace) summary(a) plot(females$CFH,females$cg27351358, ylab="Maternal Fear", xlab="BDNF cg27351358") intercept <- (a$coefficients[1] + (a$coefficients[3] * mean(females$M3_CD4, na.rm = T)) + (a$coefficients[4] * mean(females$M3_CD8, na.rm = T))+ (a$coefficients[5] * mean(females$M3_CD14, na.rm = T))+ (a$coefficients[6] * mean(females$M3_CD19, na.rm = T))+ (a$coefficients[7] * mean(females$M3_CD56, na.rm = T)+(a$coefficients[8] * mean(females$Chdrace, na.rm = T)))) abline(intercept, a$coefficients[2], col = "black") #Association between bdnf expression and maternal fear in female neonates while controlling cell type and neonate race a<-lm(females$ILMN_1809543~females$CFH + females$Chdrace + females$M3_CD4 + females$M3_CD8 + females$M3_CD14 + females$M3_CD19 + females$M3_CD56) summary(a) plot(females$CFH,females$ILMN_1809543, xlab="Maternal Fear", ylab="BDNF Expression") intercept <- (a$coefficients[1] + (a$coefficients[3] * mean(females$Chdrace, na.rm = T)) + (a$coefficients[4] * mean(females$M3_CD4, na.rm = T))+ (a$coefficients[5] * mean(females$M3_CD8, na.rm = T)) + (a$coefficients[6] * mean(females$M3_CD14, na.rm = T)) + (a$coefficients[7] * mean(females$M3_CD19, na.rm = T)) +(a$coefficients[8]* mean(females$M3_CD56, na.rm = T))) abline(intercept, a$coefficients[2], col = "black") #Maternal child abuse #bdnf methylation probe 1 and maternal child abuse, female neonates, controlled cell types and neonate race a<-lm(females$cg16257091~females$ChAb+females$M3_CD4+females$M3_CD8+females$M3_CD14+females$M3_CD19+females$M3_CD56+females$Chdrace) summary(a) boxplot(females$cg162570918~females$ChAb, names=c("0","1"), ylab="BDNF Methylation",ylim=c(4,8),cex.names=2, cex.lab=1) #bdnf methylation probe 2 and maternal child abuse, female neonates, controlled cell types and neonate race a<-lm(females$cg27351358~females$ChAb+females$M3_CD4+females$M3_CD8+females$M3_CD14+females$M3_CD19+females$M3_CD56+females$Chdrace) summary(a) boxplot(females$cg27351358~females$ChAb, names=c("0","1"), ylab="BDNF Methylation",ylim=c(4,8),cex.names=2, cex.lab=1) #Association between bdnf expression and maternal child abuse in female neonates while controlling cell type and neonate race a<-lm(females$ILMN_1809543~females$ChAb + females$Chdrace + females$M3_CD4 + females$M3_CD8 + females$M3_CD14 + females$M3_CD19 + females$M3_CD56) summary(a) boxplot(females$ILMN_1809543~females$ChAb, names=c("0","1"), ylab="BDNF Expression",ylim=c(4,8),cex.names=2, cex.lab=1) #Maternal interpersonal trauma #bdnf methylation probe 1 and maternal interpersonal trauma, female neonates, controlled cell types and neonate race a<-lm(females$cg16257091~females$InterpTr+females$M3_CD4+females$M3_CD8+females$M3_CD14+females$M3_CD19+females$M3_CD56+females$Chdrace) summary(a) boxplot(females$cg162570918~females$InterpTr, names=c("0","1"), ylab="BDNF Methylation",ylim=c(4,8),cex.names=2, cex.lab=1) #bdnf methylation probe 2 and maternal interpersonal trauma, female neonates, controlled cell types and neonate race a<-lm(females$cg27351358~females$InterpTr+females$M3_CD4+females$M3_CD8+females$M3_CD14+females$M3_CD19+females$M3_CD56+females$Chdrace) summary(a) boxplot(females$cg27351358~females$InterpTr, names=c("0","1"), ylab="BDNF Methylation",ylim=c(4,8),cex.names=2, cex.lab=1) #Association between bdnf expression and maternal interpersonal trauma in female neonates while controlling cell type and neonate race a<-lm(females$ILMN_1809543~females$InterpTr + females$Chdrace + females$M3_CD4 + females$M3_CD8 + females$M3_CD14 + females$M3_CD19 + females$M3_CD56) summary(a) boxplot(females$ILMN_1809543~females$InterpTr, names=c("0","1"), ylab="BDNF Expression",ylim=c(4,8),cex.names=2, cex.lab=1) #loading psych for mediation analyses library(psych) #mediation in psych #child abuse and bdnf methylation probe 1 mediated by fear in full cohort data(merged1) describe(merged1) #descriptive statistics mod4.4 <- mediate(cg16257091 ~ ChAb + (CFH), data =merged1) mod4.4 print(mod4.4, digits = 4) #child abuse and bdnf methylation probe 2 mediated by fear in full cohort data(merged1) describe(merged1) #descriptive statistics mod4.5 <- mediate(cg27351358 ~ ChAb + (CFH), data =merged1) mod4.5 print(mod4.5, digits = 4) #child abuse and bdnf expression mediated by fear in full cohort data(merged1) describe(merged1) #descriptive statistics mod4.6 <- mediate(ILMN_1809543 ~ ChAb + (CFH), data =merged1) mod4.6 print(mod4.6, digits = 4) #mediation analyses for males #child abuse and bdnf methylation probe 1 mediated by fear in males data(males) describe(males) #descriptive statistics mod4.7 <- mediate(cg16257091 ~ ChAb + (CFH), data =males) mod4.7 print(mod4.7, digits = 4) #child abuse and bdnf methylation probe 2 mediated by fear in males data(males) describe(males) #descriptive statistics mod4.8 <- mediate(cg27351358 ~ ChAb + (CFH), data =males) mod4.8 print(mod4.8, digits = 4) #child abuse and bdnf expression mediated by fear in males data(males) describe(males) #descriptive statistics mod4.9 <- mediate(ILMN_1809543 ~ ChAb + (CFH), data =males) mod4.9 print(mod4.9, digits = 4) #mediation analyses for females #child abuse and bdnf methylation probe 1 mediated by fear in females data(females) describe(females) #descriptive statistics mod4.1 <- mediate(cg16257091 ~ ChAb + (CFH), data =females) mod4.1 print(mod4.1, digits = 4) #child abuse and bdnf methylation probe 2 mediated by fear in females data(females) describe(females) #descriptive statistics mod4.2 <- mediate(cg27351358 ~ ChAb + (CFH), data =females) mod4.2 print(mod4.2, digits = 4) #child abuse and bdnf expression mediated by fear in females data(females) describe(females) #descriptive statistics mod4.3 <- mediate(ILMN_1809543 ~ ChAb + (CFH), data =females) mod4.3 print(mod4.3, digits = 4)