expected_observed_haplotype
This is an old revision of the document!
expected/observed haplotype
- file: bar2_HaplotypeFreq.r
- document page: 6
code:
read.table("D:/Heidi/Master/R_Daten/HaplotypeFrequency/ObsHaplotypeFreq_mt.txt”,
skip=5, row.names=1, fill=TRUE )-> Observed
nrow(Observed) -> rObs
ncol(Observed) -> cObs
newObserved <- Observed[1:(rObs-1),1:(cObs-1)]
read.table("D:/Heidi/Master/R_Daten/HaplotypeFrequency/ExpHaplotypeFreq_mt.txt",
skip=6, row.names=1, fill=TRUE) -> Expected
nrow(Expected) -> rExp
ncol(Expected) -> cExp
newExpected <- Expected[,1:(cExp-3)]
HaplotypeFreq <- as.matrix(newExpected)
HaplotypeFreq <- cbind(HaplotypeFreq, as.matrix(newObserved))
tHaplotypeFreq <- t(HaplotypeFreq)
null <- matrix(0, ncol=1, nrow=rExp)
ExpSd <- cbind((Expected[,2]), as.matrix(null))
sdpos <- tHaplotypeFreq + t(ExpSd)
sdneg <- tHaplotypeFreq - t(ExpSd)
library(gplots)
mp <- barplot2(tHaplotypeFreq ,beside=TRUE, main="Haplotype Frequency",
legend = c("Expected", "Observed"), xlab="Allel",
ylab="relative Frequenci", ylim=c(0,(max(tHaplotypeFreq)+(max(HaplotypeFreq)/4))),
plot.ci = TRUE, ci.l =sdneg, ci.u =sdpos,
plot.grid = TRUE , col=c( gray(0.8), gray(0.2)))
mtext(side = 1, at = colMeans(mp), line = 0.5, text = c(1:rExp), cex=0.7)
box()
expected_observed_haplotype.1198235887.txt.gz · Last modified: 2008/07/22 13:30 (external edit)