Commit c4a2af29 authored by Sterken, Mark's avatar Sterken, Mark
Browse files

Kammenga 2007 is based on fine-mapping; not currently supported

parent 5a4bc8b2
################################################################################
###Data Kammenga 2007
################################################################################
###Set your work directory
setwd("E:/Nemawork/Projects/WormQTL_III/phenotype_studies/Kammenga_2007/Raw")
workwd <- getwd()
###Load pre-made functions
#uses eQTL pipeline functions https://git.wur.nl/mark_sterken/eQTL_pipeline
# transcriptomics functions https://git.wur.nl/mark_sterken/Transcriptomics.workbench
# genetic map functions https://git.wur.nl/mark_sterken/genetic.map
git_dir <- "E:/Nemawork/Projects_R_zone/Git"
source(paste(git_dir,"/Loader_git.R",sep=""))
###Set data locations
support_git_dir <- paste(git_dir,"/Kammenga_lab_experiments/Wetsus/supporting_files/",sep="")
################################################################################
###Dependencies
################################################################################
install <- FALSE
#.libPaths(.libPaths("C:/Program Files/R/R-3.3.3/library"))
if(install){
install.packages("tidyverse")
install.packages("colorspace")
install.packages("RColorBrewer")
install.packages("BiocInstaller",repos="http://bioconductor.org/packages/3.3/bioc")
source("http://www.bioconductor.org/biocLite.R") ; biocLite("limma") ; biocLite("statmod")
install.packages("gridExtra")
install.packages("VennDiagram")
install.packages("openxlsx")
install.packages("rmarkdown")
}
###load
library("colorspace")
library("RColorBrewer")
library(limma)
library(gridExtra)
library("VennDiagram")
library(openxlsx)
library("rmarkdown")
library(tidyverse)
################################################################################
###Plotting theme, colours
################################################################################
###Set plotting theme
presentation <- theme(axis.text.x = element_text(size=16, face="bold", color="black"),
axis.text.y = element_text(size=16, face="bold", color="black"),
axis.title.x = element_text(size=20, face="bold", color="black"),
axis.title.y = element_text(size=20, face="bold", color="black"),
strip.text.x = element_text(size=20, face="bold", color="black"),
strip.text.y = element_text(size=20, face="bold", color="black"),
plot.title = element_text(size=24, face="bold"),
panel.grid.minor = element_blank(),
panel.grid.major = element_blank(),
legend.position = "right")
blank_theme <- theme(plot.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank(),
panel.background = element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
axis.text.x = element_blank(),
axis.text.y = element_blank(),
axis.ticks = element_blank())
###Here you can set colours for plotting in theme using ggplot2
#display.brewer.all()
myColors <- c("black",brewer.pal(9,"Set1")[c(3,9)])
names(myColors) <- c("Cis","Trans","none")
colScale <- scale_colour_manual(name = "Condition",values = myColors)
fillScale <- scale_fill_manual(name = "Condition",values = myColors)
########################################################################################################
### load stuff #########################################################################################
########################################################################################################
data_all <- read.xlsx("Data_GxE_Evert.xlsx")
data.clean <- data_all[,-2]
data.clean[,2] <- data.clean[,2]/-12
data.clean <- filter(data.clean,!strain %in% c("CB4856","N2"))
data.clean <- separate(data_all,replicate,into=c("Block","Group","Experiment","measurement","dish"),sep=":") %>%
filter(censor=="no",!strain %in% c("CB4856","N2")) %>%
#group_by(Block,Group,Experiment,trait,treatment,strain,study) %>%
#summarise(value=mean(value,na.rm=T)) %>%
group_by(study,strain,trait) %>%
summarise(GxE=mean(value[treatment=="temperature_24"],na.rm=T)-mean(value[treatment=="temperature_12"],na.rm=T)) %>%
filter(!is.na(strain),trait=="Area") %>%
group_by(strain) %>%
summarise(value=mean(GxE,na.rm=T)) %>%
data.frame()
Snoek_2019.QTL <- QTL.data.prep(t(data.matrix(data.clean[,2])),strain.trait=data.clean[,1],strain.map=wur.pop.map,strain.marker=wur.pop.marker)
lapply(Snoek_2019.QTL,head)
Snoek_2019.QTL <- map.1(Snoek_2019.QTL[[1]],Snoek_2019.QTL[[2]],Snoek_2019.QTL[[3]])
plot(Snoek_2019.QTL$LOD[1,])
Snoek_2019.QTL$Trait <-Snoek_2019.QTL$Trait - 2*Snoek_2019.QTL$Effect[which.max(Snoek_2019.QTL$LOD)]*Snoek_2019.QTL$Map[which.max(Snoek_2019.QTL$LOD),]
Snoek_2019.QTL <- map.1(Snoek_2019.QTL[[3]],Snoek_2019.QTL[[4]],Snoek_2019.QTL[[5]])
plot(Snoek_2019.QTL$LOD[1,])
\ No newline at end of file
......@@ -919,6 +919,10 @@ if(install){
popmap <- data.matrix(read.delim(file=paste(support_git_dir,"current/",currents[grepl("N2xLSJ2",currents) & grepl("map",currents)],sep=""),row.names=1))
popmrk <- read.delim(file=paste(support_git_dir,"current/",currents[grepl("N2xLSJ2",currents) & grepl("marker",currents)],sep=""))
###WormQTL cannot handle MtDNA at the moment
popmrk <- popmrk[-1,]
popmap <- popmap[-1,]
if(remap){source(paste(data_git_dir,"Loader_Large_2016.R",sep=""))}
if(!remap){
load(paste(data_dir,"/QTL/obj_Large_2016.QTL.Rdata",sep=""))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment