Skip to Content

SegmentPlotWrite {ADaCGH}

Segment aCGH data, plot, and write out results
Package: 
ADaCGH
Version: 
1.5-3

Description

Wrapper to do in a single call the segmentation, plotting, and writing out of results from segmentation.

Usage

SegmentPlotWrite(data, chrom, mergeSegs, Pos, idtype,
                 organism, method, geneNames, commondata,
                 colors = c("orange", "red", "green", "blue", "black"),
                 html_js = FALSE,
                 superimp = FALSE,
                 genomewide_plot = FALSE,
                 imgheight = 500,
                 ...)

Arguments

data
The aCGH data; genes in rows, subjects or arrays in columns. Data should be ordered by chromosome and position within chromosome.
chrom
The (numeric) vector with the chromosome indicator
mergeSegs
Merge (genome-wide) the resulting segments using mergeLevels?
Pos
The location (e.g., position in kbases) of each probe in the chromosome. A vector of the same length as the number of rows in data
idtype
The type of id of the gene name; one of ('None', 'cnio', 'affy', 'clone', 'acc', 'ensembl', 'entrez', 'ug') corresponding, respectively to None, CNIO ID, Affymetrix, Clone ID, Accession Number, Ensembl ID, Entrez ID, UniGene.
organism
The organism; one of ('None', 'Hs', 'Mm', 'Rn') corresponding, respectively, to None, Homo sapiens, Mus musculus (mouse) and Rattus norvegicus (rat).
method
The segmentation method. One of "ACE", "HMM", "BioHMM", "GLAD", "DNAcopy", "CGHseg", "PSW", "Wavelets", "HaarSeg".
geneNames
A vector with the names of the genes or probes, as you want to use them to label figures and output.
commondata
A data frame with columns that contain the common information about the clones/genes. We do nothing with this, except it is part of the output. It is common practice that this data frame contains columns ID, Chrosome (need not be numeric, can be a factor), Start (the initial position of a clone or gene), End (the final position of a clone or gene) and MidPoint (often, the mid point or whatever you regard as appropriate representative of the "center" of the clone). But you can use something else.
colors
Colors used for plotting: a five element vector denoting colors for non-altered points, gained, lost, the smoothed line and the horizontal line at 0.
html_js
Produce the html figures including lots of Javascript? Default is FALSE.
superimp
Produce the figures that superimpose all arrays into a single plot? Default is FALSE. Superimposed plots will soon NOT be available!
imgheight
The image height when generating png. Default is 500.
genomewide_plot
Do a genomewide plot. Default is FALSE. Genomewide plots will soon NOT be available.
...
Additional arguments passed to the underlying pSegment* and segmentPlot functions.

Details

Just a convenience wrapper.

Values

This function is used for its side effects. Produce plots and write out results to a file. See writeResults and segmentPlot.

References

Diaz-Uriarte, R. and Rueda, O.M. (2006). ADaCGH: an R package and web-based application for the analysis of aCGH data. Tech. report. http://www.ligarto.org/rdiaz/Papers/adacgh.pdf, http://adacgh.bioinfo.cnio.es.

See Also

writeResults, segmentPlot, pSegment

Examples

## Not run:
## This will not work unless you have a working Python installation
 
##setwd("/tmp/o3") ## all slaves need a common dir to read and write.
## all slaves need a common dir to read and write.
dir.to.create <- tempdir2()
setwd(dir.to.create)
dir.to.create
mpiInit()
 
data(cghE1)
tmpchr <- sub("chr", "", cghE1$Chromosome)
chrom.numeric <- as.numeric(as.character(tmpchr))
chrom.numeric[tmpchr == "X"] <- 23
chrom.numeric[tmpchr == "Y"] <- 24
rm(tmpchr)
reorder <- order(chrom.numeric,
                 cghE1$UG.Start,
                 cghE1$UG.End,
                 cghE1$Name)
cghE1 <- cghE1[reorder, ]
chrom.numeric <- chrom.numeric[reorder]
 
 
## to make it run fuster, use just the first two chromosomes
si <- cumsum(table(chrom.numeric))[2]
cghE1 <- cghE1[1:si, ]
chrom.numeric <- chrom.numeric[1:si]
 
 
## one example
SegmentPlotWrite(cghE1[, 5:7], chrom.numeric,
                 merge = FALSE, Pos = cghE1$UG.Start,
                 idtype = "ug", organism = "Hs",
                 method = "Wavelets",
                 geneNames = cghE1[, 1],
                 commondata = cghE1[, 1:4])
 
 
 
## all other methods except PSW and ACE and BioHMM (this fails because
## of a problem in the library)
for(mm in c("DNAcopy", "GLAD", "HMM", "CGHseg", "HaarSeg")) {
 
    cat("
 
 mm is ", mm, "
 
")
    SegmentPlotWrite(cghE1[, 5:6], chrom.numeric,
                     merge = TRUE, Pos = cghE1$UG.Start,
                     idtype = "ug", organism = "Hs",
                     method = mm,
                     geneNames = cghE1[, 1],
                     commondata = cghE1[, 1:4])
}
 
## Now try BioHMM
 
try(SegmentPlotWrite(cghE1[, 5:6], chrom.numeric,
                     merge = TRUE, Pos = cghE1$UG.Start,
                     idtype = "ug", organism = "Hs",
                     method = "BioHMM",
                     geneNames = cghE1[, 1],
                     commondata = cghE1[, 1:4]))
## End(Not run)

Author(s)

Ramon Diaz-Uriarte rdiaz02@gmail.com

Documentation reproduced from package ADaCGH, version 1.5-3. License: GPL (>= 3)