Description Usage Arguments Details See Also Examples
A graphical representation of depth ratio, allele frequency and mutation frequency in multiple panels allineated by the coordinate of the same chromosome.
1 2 3 4 5 6 | chromosome.view(baf.windows, ratio.windows, mut.tab = NULL,
segments = NULL, min.N.baf = 1, min.N.ratio = 10000, main = "",
vlines = FALSE, legend.inset = c(-20 * strwidth("a", units = "figure"),
0), CNn = 2, cellularity = NULL, ploidy = NULL, avg.depth.ratio = NULL,
model.lwd = 1, model.lty = "24", model.col = 1, x.chr.space = 10)
genome.view(seg.cn, info.type = "AB", ...)
|
baf.windows |
matrix containing the windowed B-allele frequency values for one chromosome. |
ratio.windows |
matrix containing the windowed depth ratio values for one chromosome. |
mut.tab |
mutation table of one chromosome. If specified, the
mutations will be drawn in a top panel. |
segments |
segmentation for one chromosome. If specified, the segmented B-allele frequency and depth ratio values will be shown as red lines. |
min.N.baf |
minimum number of observations required in a BAF window for plotting. |
min.N.ratio |
minimum number of observations required in a depth ratio window for plotting. |
CNn |
copy number of the germline genome. |
vlines |
logical, if TRUE the plot will include dotted vertical lines corresponding to segment breaks. |
cellularity |
fraction of tumor cells in the sample. |
ploidy |
value of the estimated |
avg.depth.ratio |
the average value of the normalized depth ratio. |
main |
main title of the plot. |
legend.inset |
the inset argument to pass to the |
model.lwd |
width of the theoretical lines, if the segments matrix contains the columns A, B and CNt. |
model.lty |
line type of the theoretical lines, if the segments matrix contains the columns A, B and CNt. |
model.col |
color of the theoretical lines, if the segments matrix contains the columns A, B and CNt. |
x.chr.space |
step in megabase on the positions to visualize on the x-axis. |
seg.cn |
genome wide segments, with the columns A, B and CNt. |
info.type |
information to plot in |
... |
optional arguments passed to |
chromosome.view
is a plotting function based on the default
plot
function and par
to display multiple
panels. The plotting function plotWindows
is used to plot
the binned data of depth-ratio
and b-allele frequency
.
The function displays the observations reulting from the sequencing
post-procssing as well the results of the model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | ## Not run:
data.file <- system.file("extdata", "example.seqz.txt.gz",
package = "sequenza")
# read all the chromosomes:
seqz.data <- read.seqz(data.file)
# Gather genome wide GC-stats from raw file:
gc.stats <- gc.sample.stats(data.file)
gc.vect <- setNames(gc.stats$raw.mean, gc.stats$gc.values)
# Read only one chromosome:
seqz.data <- read.seqz(data.file, chr.name = 1)
# Correct the coverage of the loaded chromosome:
seqz.data$adjusted.ratio <- seqz.data$depth.ratio /
gc.vect[as.character(seqz.data$GC.percent)]
# Select the heterozygous positions
seqz.hom <- seqz.data$zygosity.normal == 'hom'
seqz.het <- seqz.data[!seqz.hom, ]
# Detect breakpoints
breaks <- find.breaks(seqz.het, gamma = 80, kmin = 10, baf.thres = c(0, 0.5))
# use heterozygous and homozygous position to measure segment values
seg.s1 <- segment.breaks(seqz.data, breaks = breaks)
# Binning the values of depth ratio and B allele frequency
seqz.r.win <- windowValues(x = seqz.data$adjusted.ratio,
positions = seqz.data$position, chromosomes = seqz.data$chromosome,
window = 1e6, overlap = 1, weight = seqz.data$depth.normal)
seqz.b.win <- windowValues(x = seqz.het$Bf,
positions = seqz.het$position, chromosomes = seqz.het$chromosome,
window = 1e6, overlap = 1, weight = round(x = seqz.het$good.reads,
digits = 0))
# create mutation table:
mut.tab <- mutation.table(seqz.data, mufreq.treshold = 0.15,
min.reads = 40, max.mut.types = 1, min.type.freq = 0.9,
segments = seg.s1)
# chromosome view without parametes:
chromosome.view(mut.tab = mut.tab[mut.tab$chromosome == "1",],
baf.windows = seqz.b.win[[1]], ratio.windows = seqz.r.win[[1]],
min.N.ratio = 1, segments = seg.s1[seg.s1$chromosome == "1",],
main = "Chromosome 1")
# filter out small ambiguous segments, and weight the segments by size:
seg.filtered <- seg.s1[(seg.s1$end.pos - seg.s1$start.pos) > 10e6, ]
weights.seg <- 150 + round((seg.filtered$end.pos -
seg.filtered$start.pos) / 1e6, 0)
# get the genome wide mean of the normalized depth ratio:
avg.depth.ratio <- mean(gc.stats$adj[,2])
# run the BAF model fit
CP <- baf.model.fit(Bf = seg.filtered$Bf, depth.ratio = seg.filtered$depth.ratio,
weight.ratio = weights.seg, weight.Bf = weights.seg,
avg.depth.ratio = avg.depth.ratio, cellularity = seq(0.1,1,0.01),
ploidy = seq(0.5,3,0.05))
confint <- get.ci(CP)
ploidy <- confint$max.ploidy
cellularity <- confint$max.cellularity
#detect copy number alteration on the segments:
cn.alleles <- baf.bayes(Bf = seg.s1$Bf, depth.ratio = seg.s1$depth.ratio,
cellularity = cellularity, ploidy = ploidy, avg.depth.ratio = 1)
seg.s1 <- cbind(seg.s1, cn.alleles)
# Chromosome view with estimated paramenters:
chromosome.view(mut.tab = mut.tab[mut.tab$chromosome == "1",],
baf.windows = seqz.b.win[[1]], ratio.windows = seqz.r.win[[1]],
min.N.ratio = 1, segments = seg.s1[seg.s1$chromosome == "1",],
main = "Chromosome 1", cellularity = cellularity, ploidy = ploidy,
avg.depth.ratio = 1, BAF.style = "lines")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.