# load DBA objects with peak profiles
data(Cfp1Profiles)
# get normalization factors
Cfp1Norm <- getNormFactors(Cfp1Profiles)
# get all pairwise distances for the samples WT, Null and Resc i.e. WT
# vs Null, WT vs Resc and WT vs Resc: Recommended is the method 'MMD'
# [1], however, this may take a little while. Here, we compute the GMD
# distance instead [2].
Cfp1Dists <- compHistDists(Cfp1Norm, method = 'GMD',
NormMethod = 'DESeq')
# You can also specify, which pairwise distances you are interessted in,
# e.g.:
CompIDs <- cbind(c("WT.AB2", "Null.AB2"),
c("WT.AB2", "Resc.AB2"),
c("Null.AB2", "Resc.AB2"))
Cfp1Dists2 <- compHistDists(Cfp1Norm, method='GMD', CompIDs=CompIDs,
NormMethod='DESeq')
# To view pairwise distances you can use the function plotHistDists. For
# example, treating WT and Resc as control replicates and Null as a
# treatment group, you can contrast the 'within-group' distances with
# 'between-group' distances:
group1 <- c("WT.AB2","Resc.AB2")
group2 <- c("Null.AB2") #
plotHistDists(Cfp1Dists, group1=group1, group2=group2, method='GMD')
#see detPeakPvals to determine which peaks are significantly different
#between the two groups.
Run the code above in your browser using DataLab