@@ -213,8 +213,6 @@ PlotSegment <- function(cur.ratio, cur.ratio.good, sample.name) {
213213 chr.text <- c(1 : 22 , " X" , " Y" )
214214 vlines.shift <- c(vlines [- 1 ], 4 * 10 ^ 9 )
215215 chr.at <- vlines + (vlines.shift - vlines ) / 2
216- x.at <- c(0 , 0.5 , 1 , 1.5 , 2 , 2.5 , 3 ) * 10 ^ 9
217- x.labels <- c(" 0" , " 0.5" , " 1.0" , " 1.5" , " 2.0" , " 2.5" , " 3.0" )
218216 y.at <- c(0.005 , 0.020 , 0.100 , 0.500 , 1.000 , 2.000 , 10 , 100 )
219217 y.labels <- c(" 0.005" , " 0.020" , " 0.100" , " 0.5" , " 1" , " 2" , " 10" , " 100" )
220218
@@ -224,12 +222,13 @@ PlotSegment <- function(cur.ratio, cur.ratio.good, sample.name) {
224222 plot(x = cur.ratio.good $ abspos ,
225223 y = cur.ratio.good $ lowratio ,
226224 log = " y" , main = sample.name ,
227- xaxt = " n" , xlab = " Genome Position Gb " ,
225+ xaxt = " n" , xlab = " Genome Position" ,
228226 yaxt = " n" , ylab = " Ratio" , col = " #517FFF" , cex = 0.01 )
229227
230- axis(2 , at = y.at , labels = y.labels )
231228 lines(x = cur.ratio.good $ abspos , y = cur.ratio.good $ seg.mean.LOWESS ,
232229 col = " red" , cex = 1.0 )
230+ axis(2 , at = y.at , labels = y.labels )
231+ mtext(chr.text , at = chr.at , side = 1 , cex = 0.4 )
233232 abline(v = vlines , lwd = 0.1 , col = " grey" )
234233 dev.off()
235234}
@@ -254,7 +253,9 @@ CBSSegment01 <- function(varbin.gc, bad.bins.file,
254253 # # positions. The "ratio" column present in the input file will be
255254 # # over-written shortly.
256255 cur.ratio <- read.table(varbin.data , header = F )
257- names(cur.ratio ) <- c(" chrom" , " chrompos" , " abspos" , " bincount" , " ratio" )
256+ names(cur.ratio ) <- c(" chrom" , " chrompos" , " chromendpos" , " bincount" , " ratio" )
257+ cur.ratio $ abspos <- cumsum(c(0 ,
258+ head(cur.ratio $ chromendpos - cur.ratio $ chrompos , - 1 )))
258259 cur.ratio $ chrom <- chrom.numeric
259260
260261 # # Take the fractional counts after using Laplaces correction
0 commit comments