--- title: "Salmon_feeding study" author: "Y.Wang" date: "December, 2018" ```{r, warning=FALSE, message=FALSE,Cache=TRUE,echo=FALSE} # Note: salmon_CSIA_complete_AA11a has two labels, this is the difference from salmon_CSIA_complete_AA11 ####################################################################### library(readxl) library(dplyr) ####################################################################### ``` ```{r} # MANOVA test among diet and fish for palmaria and control experiment AA_offset<-read.csv("salmon_muscle_all.csv") #read the file, this file can be extracted from the supplement data df1<-AA_offset%>%select(Thr,Lys,His, Ile, Met, Val, Phe, Leu) # extract EAA files df2<-AA_offset%>%select(Ser,Gly,Ala, Glx,Asx, Pro,Tyr) # extract NEAA files ANI.manova<-manova(as.matrix(df1)~as.matrix(AA_offset$Diet)) # Manova test summary(ANI.manova,test="Pillai") print(ANI.manova) library(stats) summary.aov(ANI.manova) # check which ones are signicantly different between the palamaria & control expriment p<-c(0.4373, 0.006234, 0.0009938, 0.9517, 5.031e-06, 0.2018, 0.6262, 0.8196) p.adjust(p,"fdr") # Manova test among NEAAs NEAA.manova<-manova(as.matrix(df2)~as.matrix(AA_offset$Diet)) # Manova test summary(NEAA.manova,test="Pillai") print(NEAA.manova) library(stats) summary.aov(NEAA.manova) p1<-c(0.000555, 1.959e-05, 0.0008238, 0.0238, 0.1314, 0.2497, 0.001578) p.adjust(p1,"fdr") # calculated p-adjusted values using methods "fdr" (see main text-Methods section) ##make one-sample t-test to see if mean value of all EAAs is significantly difference from zero for both treatments fish_AA<-read.csv("fish_diet_diff_R.csv") #read the file, this file can be extracted from the attached supplementary data t.test(fish_AA$P15_Add_EAA, mu=0, conf.level = 0.99) # t-test for Palamaria group t.test(fish_AA$controlP_EAA, mu=0, conf.level = 0.99) # t-test for control group ```