library(DiffBind)#set working directory and place sample.csv file in directory
setwd("/Volumes/Terranova2/PROSTATE_12-19-16/PRAD_FINAL_Analysis_June2018/PRAD_Tumors_Normals/04aln_downsample/")
#create a dba.object#
H3K4me1 <- dba(sampleSheet = "PRAD_H3K4me1_DiffBind.csv", minOverlap = 2)
H3K27ac <- dba(sampleSheet = "PRAD_H3K27ac_DiffBind.csv", minOverlap = 2)
#count reads in binding site intervals: Scoring metric can be changed and does not influence differential analysis#
H3K4me1_counts_READS_MINUS <- dba.count(H3K4me1, minOverlap = 2, score = DBA_SCORE_READS_MINUS, fragmentSize = 200)
H3K27ac_counts_READS_MINUS <- dba.count(H3K27ac, minOverlap = 2, score = DBA_SCORE_READS_MINUS, fragmentSize = 200)#PCA plot from H3K4me1_counts_READS_MINUS or H3K27ac_counts_READS_MINUS
dba.plotPCA(H3K4me1_counts_READS_MINUS)dba.plotPCA(H3K27ac_counts_READS_MINUS)Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.