################################################### ### chunk number 1: ################################################### #line 54 "vignettes/SMAP/inst/doc/SMAP.Rnw" library(SMAP) ################################################### ### chunk number 2: ################################################### #line 80 "vignettes/SMAP/inst/doc/SMAP.Rnw" data(GBM) obs <- SMAPObservations(value=as.numeric(GBM[,2]), chromosome=as.character(GBM[,3]), startPosition=as.numeric(GBM[,4]), endPosition=as.numeric(GBM[,5]), name="G24460", reporterId=as.character(GBM[,1])) ################################################### ### chunk number 3: ################################################### #line 94 "vignettes/SMAP/inst/doc/SMAP.Rnw" plot(obs, ylab="ratio", ylim=c(0,2)) ################################################### ### chunk number 4: ################################################### #line 101 "vignettes/SMAP/inst/doc/SMAP.Rnw" ids <- which(chromosome(obs) == "9") plot(obs[ids], ylab="ratio", ylim=c(0,2), main=paste(name(obs), "chromosome 9")) ################################################### ### chunk number 5: ################################################### #line 137 "vignettes/SMAP/inst/doc/SMAP.Rnw" init.means <- c(0.4, 0.7, 1, 1.3, 1.6, 3) init.sds <- rep(0.1, 6) phi <- cbind(init.means, init.sds) hmm <- SMAPHMM(noStates=6, Phi=phi, initTrans=0.02) hmm ################################################### ### chunk number 6: ################################################### #line 202 "vignettes/SMAP/inst/doc/SMAP.Rnw" profile <- smap(hmm, obs, verbose=2) ################################################### ### chunk number 7: ################################################### #line 209 "vignettes/SMAP/inst/doc/SMAP.Rnw" Q(profile) ################################################### ### chunk number 8: ################################################### #line 216 "vignettes/SMAP/inst/doc/SMAP.Rnw" Phi(HMM(profile)) ################################################### ### chunk number 9: ################################################### #line 226 "vignettes/SMAP/inst/doc/SMAP.Rnw" ## Plot results of all data: plot(profile, ylab="ratio", ylim=c(0,2)) ################################################### ### chunk number 10: ################################################### #line 232 "vignettes/SMAP/inst/doc/SMAP.Rnw" ## Plot chromosomes with aberrations: chrom.selection <- as.character(c(1, 6, 7, 8, 9, 10, 15, 19, 20)) selection <- which(chromosome(obs) %in% chrom.selection) plot(profile[selection], ylab="ratio", ylim=c(0, 2)) ################################################### ### chunk number 11: ################################################### #line 240 "vignettes/SMAP/inst/doc/SMAP.Rnw" ## Plot all chromosomes separately: par(mfrow=c(3, 3)) for (c in chrom.selection) { ids <- which(chromosome(obs) == c) plot(profile[ids], ylab="ratio", ylim=c(0, 2), main=c) }