anomSegStats(intenData, genoData, snp.ids, anom, centromere, lrr.cut = -2, verbose = TRUE)
anomStatsPlot(intenData, genoData, anom.stats, snp.ineligible, plot.ineligible = FALSE, centromere = NULL, brackets = c("none", "bases", "markers"), brkpt.pct = 10, whole.chrom = FALSE, win = 5, win.calc = FALSE, win.fixed = 1, zoom = c("both", "left", "right"), main = NULL, info = NULL, ideogram = TRUE, ideo.zoom = FALSE, ideo.rect = TRUE, mult.anom = FALSE, cex = 0.5, cex.leg = 1.5,
colors = c("default", "neon", "primary"), ...)IntensityData object containing BAlleleFreq and LogRRatio.
The order of the rows of intenData and the snp annotation
are expected to be by chromosome and then by position within chromosome.
GenotypeData object. The order of the rows of intenData and the snp annotation
are expected to be by chromosome and then by position within chromosome.
HLA and pseudoautosomal.
If there are SNPs annotated in the centromere gap, exclude these as
well (see centromeres).
xanomDetectBAF) or by LOH method
(anomDetectLOH).
Here "left.index" and "right.index" are row indices of intenData with left.index < right.index.
centromeres.
lrr.cut
anomSegStats. Names must include "anom.id", "scanID", "chromosome",
"left.index", "right.index", "method", "nmark.all", "nmark.elig", "left.base", "right.base",
"nbase", "non.anom.baf.med", "non.anom.lrr.med", "anom.baf.dev.med",
"anom.baf.dev.5", "anom.lrr.med", "nmark.baf", "nmark.lrr". Left and right refer
to start and end, respectively, of the anomaly, in position order.
HLA and pseudoautosomal.
brkpt.pct, to assess general accuracy of end points of the anomaly
win and zoom)
win and gives window of fixed length given by win.fixed
win.calc=TRUE
NULL, titles will
include anom.id, scanID, sex, chromosome, and detection method. FALSE
(default), each anomaly is shown on a separate plot.plot.anomSegStats produces a data.frame with the variables for anom plus the following columns:
Left and right refer to position order with left < right.snp.ids for definition of eligible SNP markers.non.anom.baf.med of points used to detect anomaly (eligible and heterozygous or missing)
non.anom.baf.med, using eligible heterozygous or missing SNP markers in anomaly non.anom.baf.med, using eligible heterozygous or missing SNP markers in anomalynon.anom.baf.med, using eligible heterozygous or missing SNP markers in anomaly left.term.lrr.medright.term.lrr.medintenDataanomDetectBAF for definition of BAF-metriclrr.cutanomSegStats computes various statistics of the input anomalies.
Some of these are basic statistics for the characteristics of the anomaly and for measuring deviation of LRR or BAF from expected.
Other statistics are used in downstrean quality control analysis, including detecting
terminal anomalies and investigating centromere-spanning anomalies.
anomStatsPlot produces separate png images of each anomaly in anom.stats. Each image consists of
an upper plot of LogRRatio values and a lower plot of BAlleleFrequency values for
a zoomed region around the anomaly or whole chromosome (depending up parameter
choices). Each plot has vertical lines demarcating the anomaly and horizontal lines
displaying certain statistics from anomSegStats. The upper plot title
includes sample number and chromosome. Further plot annotation describes which
anomaly statistics are represented.
anomDetectBAF, anomDetectLOH
library(GWASdata)
data(illuminaScanADF, illuminaSnpADF)
blfile <- system.file("extdata", "illumina_bl.gds", package="GWASdata")
bl <- GdsIntensityReader(blfile)
blData <- IntensityData(bl, scanAnnot=illuminaScanADF, snpAnnot=illuminaSnpADF)
genofile <- system.file("extdata", "illumina_geno.gds", package="GWASdata")
geno <- GdsGenotypeReader(genofile)
genoData <- GenotypeData(geno, scanAnnot=illuminaScanADF, snpAnnot=illuminaSnpADF)
scan.ids <- illuminaScanADF$scanID[1:2]
chrom.ids <- unique(illuminaSnpADF$chromosome)
snp.ids <- illuminaSnpADF$snpID[illuminaSnpADF$missing.n1 < 1]
snp.failed <- illuminaSnpADF$snpID[illuminaSnpADF$missing.n1 == 1]
# example results from anomDetectBAF
baf.anoms <- data.frame("scanID"=rep(scan.ids[1],2), "chromosome"=rep(21,2),
"left.index"=c(100,300), "right.index"=c(200,400), sex=rep("M",2),
method=rep("BAF",2), anom.id=1:2, stringsAsFactors=FALSE)
# example results from anomDetectLOH
loh.anoms <- data.frame("scanID"=scan.ids[2],"chromosome"=22,
"left.index"=400,"right.index"=500, sex="F", method="LOH",
anom.id=3, stringsAsFactors=FALSE)
anoms <- rbind(baf.anoms, loh.anoms)
data(centromeres.hg18)
stats <- anomSegStats(blData, genoData, snp.ids=snp.ids, anom=anoms,
centromere=centromeres.hg18)
anomStatsPlot(blData, genoData, anom.stats=stats,
snp.ineligible=snp.failed, centromere=centromeres.hg18)
close(blData)
close(genoData)
Run the code above in your browser using DataLab