library(methylKit)
install.packages("data.table")
source("http://www.bioconductor.org/biocLite.R")
library(data.table)
library(GenomicRanges)
file.list <- list("T3D3.txt", "M3.txt",'gonad_methylkit.txt'.'gonad_methylkit_QC.txt','BiGo_lar_T1D5_methylkit', 'BiGo_lar_T1D3_methylkit','BiGo_lar_T3D5_methylkit.txt','BiGo_lar_M1_methylkit.txt','BiGo_lar_M3_methylkit_oner.txt')
myobj<-read( file.list,pipeline=list(fraction=TRUE,chr.col=1,start.col=2,end.col=2,
coverage.col=4,strand.col=3,freqC.col=5 ),
sample.id=list("T3D3","M3",'gonad','gonadQC','T1D5','T1D3','T3D5','M1','M3QC'),assembly="v9",treatment=c(1,0,0,0,0,0,0,0,0))
file.list <- list("T3D3.txt", "M3.txt",'gonad_methylkit.txt'.'gonad_methylkit_QC.txt','BiGo_lar_T1D5_methylkit', 'BiGo_lar_T1D3_methylkit','BiGo_lar_T3D5_methylkit.txt','BiGo_lar_M1_methylkit.txt','BiGo_lar_M3_methylkit_oner.txt')
file.list <- list("T3D3.txt", "M3.txt",'gonad_methylkit.txt','gonad_methylkit_QC.txt','BiGo_lar_T1D5_methylkit', 'BiGo_lar_T1D3_methylkit','BiGo_lar_T3D5_methylkit.txt','BiGo_lar_M1_methylkit.txt','BiGo_lar_M3_methylkit_oner.txt')
myobj<-read( file.list,pipeline=list(fraction=TRUE,chr.col=1,start.col=2,end.col=2,
coverage.col=4,strand.col=3,freqC.col=5 ),
sample.id=list("T3D3","M3",'gonad','gonadQC','T1D5','T1D3','T3D5','M1','M3QC'),assembly="v9",treatment=c(1,0,0,0,0,0,0,0,0))
file.list <- list("T3D3.txt", "M3.txt",'gonad_methylkit.txt','gonad_methylkit_QC.txt','BiGo_lar_T1D5_methylkit', 'BiGo_lar_T1D3_methylkit.txt','BiGo_lar_T3D5_methylkit.txt','BiGo_lar_M1_methylkit.txt','BiGo_lar_M3_methylkit_oner.txt')
myobj<-read( file.list,pipeline=list(fraction=TRUE,chr.col=1,start.col=2,end.col=2,
coverage.col=4,strand.col=3,freqC.col=5 ),
sample.id=list("T3D3","M3",'gonad','gonadQC','T1D5','T1D3','T3D5','M1','M3QC'),assembly="v9",treatment=c(1,0,0,0,0,0,0,0,0))
file.list <- list("T3D3.txt", "M3.txt",'gonad_methylkit.txt','gonad_methylkit_QC.txt','BiGo_lar_T1D5_methylkit.txt', 'BiGo_lar_T1D3_methylkit.txt','BiGo_lar_T3D5_methylkit.txt','BiGo_lar_M1_methylkit.txt','BiGo_lar_M3_methylkit_oner.txt')
myobj<-read( file.list,pipeline=list(fraction=TRUE,chr.col=1,start.col=2,end.col=2,
coverage.col=4,strand.col=3,freqC.col=5 ),
sample.id=list("T3D3","M3",'gonad','gonadQC','T1D5','T1D3','T3D5','M1','M3QC'),assembly="v9",treatment=c(1,0,0,0,0,0,0,0,0))
meth<-unite(myobj,destrand=FALSE)
nrow(meth)
getCorrelation(meth,plot=T)
file.list <- list("T3D3.txt", "M3.txt",'gonad_methylkit.txt','BiGo_lar_T1D5_methylkit.txt', 'BiGo_lar_T1D3_methylkit.txt','BiGo_lar_T3D5_methylkit.txt','BiGo_lar_M1_methylkit.txt','BiGo_lar_M3_methylkit_oner.txt')
myobj<-read( file.list,pipeline=list(fraction=TRUE,chr.col=1,start.col=2,end.col=2,
coverage.col=4,strand.col=3,freqC.col=5 ),
sample.id=list("T3D3","M3",'gonad','T1D5','T1D3','T3D5','M1','M3QC'),assembly="v9",treatment=c(1,0,0,0,0,0,0,0))
meth<-unite(myobj,destrand=FALSE)
nrow(meth)
getCorrelation(meth,plot=T)
pdf(file="graph_all.pdf")
getCorrelation(meth,plot=T)
dev.off()
file.list <- list('BiGo_lar_M1_methylkit.txt','BiGo_lar_T1D3_methylkit.txt','BiGo_lar_T1D5_methylkit.txt','BiGo_lar_T3D5_methylkit.txt',"T3D3.txt","M3.txt",'gonad_methylkit.txt')
myobj<-read( file.list,pipeline=list(fraction=TRUE,chr.col=1,start.col=2,end.col=2,
coverage.col=4,strand.col=3,freqC.col=5 ),
sample.id=list("M1","T1D3",'T1D5','T3D5','T3D3','M3','gonad'),assembly="v9",treatment=c(1,0,0,0,0,0,0))
meth<-unite(myobj,destrand=FALSE)
nrow(meth)
getCorrelation(meth,plot=T)
pdf(file="graph_all_noQC.pdf")
getCorrelation(meth,plot=T)
dev.off()
head(meth)
write.table(meth,'methunite.txt')
methnew<-read.table('methunite_modified.txt')
head(methnew)
getCorrelation(methnew,plot=T)
