## CD-1 PFOA/GenX gestational exposure and latent health outcomes study ## Week 18 Liver Pathology Severity Scores ## HAC 05/16/2020 (w/ QC data) ## Load packages (needs to be done every time R is opened) library(dplyr) library(lme4) library(ggplot2) library(multcomp) library(tidyverse) library(RVAideMemoire) setwd("/Users/harliecope/Desktop/GenX:PFOA Study/GenX PFOA Mouse Study/GenXPFOA Study") # Read in your files x<- read_csv("~/Desktop/GenX:PFOA Study/GenX PFOA Mouse Study/QC Data Files/csv for R/Week18Pathyn.csv") x$ID <-as.factor(x$ID) x$Group<-as.factor(x$Group) str(x) w18path<-x highfat<-subset(w18path, Diet=="H") lowfat<-subset(w18path, Diet=="L") w18m<-subset(w18path, Sex=="M") w18f<-subset(w18path, Sex=="F") w18mhf<-subset(w18m, Diet=="H") w18mlf<-subset(w18m, Diet=="L") w18fhf<-subset(w18f, Diet=="H") w18flf<-subset(w18f, Diet=="L") ##mixed cell infiltrate fisher.test(table(w18mhf$Group,w18mhf$MCI)) ##not sig fisher.test(table(w18mlf$Group,w18mlf$MCI)) ##not sig fisher.test(table(w18fhf$Group,w18fhf$MCI)) ##not sig fisher.test(table(w18flf$Group,w18flf$MCI)) ##not sig ##no differences ##hepatocyte single cell necrosis fisher.test(table(w18mhf$Group,w18mhf$HSCN)) ##not sig fisher.test(table(w18mlf$Group,w18mlf$HSCN)) ##not sig fisher.test(table(w18fhf$Group,w18fhf$HSCN)) fisher.multcomp(table(w18fhf$Group,w18fhf$HSCN), p.method = "none") pvalues<-c(1, 0.0128205, 0.2848297, 0.5459236, 0.0009228) p.adjust(pvalues, method = "holm") ##adjusted values 1.0000000 0.0512820 0.8544891 1.0000000 0.0046140* fisher.test(table(w18flf$Group,w18flf$HSCN)) ##not sig ##female high fat control vs 1.0 mg/kg PFOA 0.0046140 ## fat micro fisher.test(table(w18mhf$Group,w18mhf$FATmicro)) ##not sig fisher.test(table(w18mlf$Group,w18mlf$FATmicro)) fisher.multcomp(table(w18mlf$Group,w18mlf$FATmicro), p.method = "none") pvalues<-c(1, 0.205882, 0.004721, 0.082353, 0.205882) p.adjust(pvalues, method = "holm") ##adjustedvalues 1.000000 0.617646 0.023605* 0.329412 0.617646 fisher.test(table(w18fhf$Group,w18fhf$FATmicro)) ##not sig fisher.test(table(w18flf$Group,w18flf$FATmicro)) ##not sig ## increase in fat micro for GenX2.0 mg/kg males p=0.023605 ##Fat macro fisher.test(table(w18mhf$Group,w18mhf$FATmacro)) ##not sig fisher.test(table(w18mlf$Group,w18mlf$FATmacro)) ##not sig fisher.test(table(w18fhf$Group,w18fhf$FATmacro)) ##not sig fisher.test(table(w18flf$Group,w18flf$FATmacro)) ##not sig ##no differences ##subset by diet no sex ##MCI fisher.test(table(lowfat$Group,lowfat$MCI)) fisher.test(table(highfat$Group,highfat$MCI)) ##no differences ##HSCN fisher.test(table(lowfat$Group,lowfat$HSCN)) fisher.test(table(highfat$Group,highfat$HSCN)) fisher.multcomp(table(highfat$Group,highfat$HSCN), p.method = "none") pvalues<-c(1, 0.0057246, 0.3430672, 1, 0.0006583) p.adjust(pvalues, method="holm") ## adjusted pvalues 1.0000000 0.0228984* 1.0000000 1.0000000 0.0032915 ## high fat control vs 1.0 mg/kg GenX p=0.0229, 1.0 mg/kg PFOA p=0.00329 ##Fatmicro fisher.test(table(lowfat$Group,lowfat$FATmicro)) fisher.multcomp(table(lowfat$Group,lowfat$FATmicro), p.method = "none") pvalues<-c(0.045455, 0.015698, 0.003091, 0.019062, 0.046332) p.adjust(pvalues, method="holm") ##adjusted p values 0.090910 0.062792 0.015455 0.062792 0.090910 ##difference between control and 2.0 mg/kg GenX p=0.015455 fisher.test(table(highfat$Group,highfat$FATmicro)) ## not sig ##fat macro fisher.test(table(lowfat$Group,lowfat$FATmacro)) fisher.test(table(highfat$Group,highfat$FATmacro)) ##no differences