DiffBind Analysis for Unsupervised PCA plots in Untreated vs Resistant PRAD Patient Tumors

Christopher Terranova May 2019

Load necessary programs

library(DiffBind)

Unsupervised PCA analysis of H3K4me1 or H3K27ac genomic loci in Untreated vs Resistant Tumors

#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 Plots for H3K4me1 and H3K27ac

#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.