#load lymphoma data
data(lymphoma)
#Run pcf
pcf.res <- pcf(data=lymphoma,gamma=12)
plotCircle(segments=pcf.res,thres.gain=0.1)
#Use alpha to view the frequencies in more detail:
plotCircle(segments=pcf.res,thres.gain=0.1,alpha=1/5)
#An example of how to specify arcs
#Using multipcf, we compute the correlation between all segments and then
#retrieve those that have absolute inter-chromosomal correlation > 0.7
multiseg <- multipcf(lymphoma)
nseg = nrow(multiseg)
cormat = cor(t(multiseg[,-c(1:5)]))
chr.from <- c()
pos.from <- c()
chr.to <- c()
pos.to <- c()
cl <- c()
thresh = 0.7
for (i in 1:(nseg-1)) {
for (j in (i+1):nseg) {
#Check if segment-correlation is larger than threshold and that the two
#segments are located on different chromosomes
if (abs(cormat[i,j]) > thresh && multiseg$chrom[i] != multiseg$chrom[j]) {
chr.from = c(chr.from,multiseg$chrom[i])
chr.to = c(chr.to,multiseg$chrom[j])
pos.from = c(pos.from,(multiseg$start.pos[i] + multiseg$end.pos[i])/2)
pos.to = c(pos.to,(multiseg$start.pos[j] + multiseg$end.pos[j])/2)
if(cormat[i,j] > thresh){
cl <- c(cl,1) #class 1 for those with positive correlation
}else{
cl <- c(cl,2) #class 2 for those with negative correlation
}
}
}
}
arcs <- cbind(chr.from,pos.from,chr.to,pos.to,cl)
#Plot arcs between segment with high correlations; positive correlation in
#orange, negative correlation in blue:
plotCircle(segments=pcf.res,thres.gain=0.15,arcs=arcs,d=0)
Run the code above in your browser using DataLab