library(tidyverse) raw_rwd <- read_csv("https://denvirlab.marshall.edu/BMR617-2023/data/RawRenalWesternData.csv") raw_rwd <- raw_rwd %>% mutate(NormSGK1 = SGK1/`Beta actin`) t.test(NormSGK1 ~ TissueType, paired=T, data=raw_rwd) ggplot(raw_rwd, aes(x=TissueType, y=NormSGK1)) + geom_point() + geom_line(aes(group=Patient)) # Another way to normalize to loading controls: refBetaActin <- raw_rwd[1, "Beta actin"] # Beta actin value from first row raw_rwd <- raw_rwd %>% mutate(NormalizationFactor = `Beta actin`/refBetaActin) raw_rwd <- raw_rwd %>% mutate(SGK1_Norm_By_Factor = SGK1/NormalizationFactor) t.test(SGK1_Norm_By_Factor ~ TissueType, paired=T, data=raw_rwd) ggplot(raw_rwd, aes(x=TissueType, y=SGK1_Norm_By_Factor)) + geom_point() + geom_line(aes(group=Patient)) meanNormalSGKNorm <- raw_rwd %>% group_by(TissueType) %>% summarise(MeanNormSGK1 = mean(NormSGK1)) %>% # Get the mean normalized SGK1 for each tissue type filter(TissueType == "Normal") %>% # Get only the normal tissue pull(MeanNormSGK1) # Extract the mean normalized SGK1 quantification raw_rwd <- raw_rwd %>% mutate(RelativeSGK1 = NormSGK1 / meanNormalSGKNorm) raw_rwd %>% group_by(TissueType) %>% summarise(MeanRelativeSGK1 = mean(RelativeSGK1)) t.test(RelativeSGK1 ~ TissueType, paired=T, data=raw_rwd) ggplot(raw_rwd, aes(x=TissueType, y=RelativeSGK1)) + geom_point() + geom_line(aes(group=Patient)) + ylab("Relative SGK1 Expresison")