Last data update: 2014.03.03

R: Plot B Allele Frequency and/or Log R Ratio, R or Theta values...
chromIntensityPlotR Documentation

Plot B Allele Frequency and/or Log R Ratio, R or Theta values for samples by probe position on a chromosome

Description

This function creates plots for one or more of the 'B AlleleFreq', 'Log R Ratio', 'R' or 'Theta' values for given sample by chromosome combinations.

Usage

chromIntensityPlot(intenData, scan.ids, chrom.ids, 
  type = c("BAF/LRR", "BAF", "LRR", "R", "Theta", "R/Theta"), 
  main = NULL, info = NULL, abln = NULL,
  horizln = c(1/2, 1/3, 2/3), 
  colorGenotypes = FALSE, genoData = NULL,
  colorBatch = FALSE, batch.column = NULL,
  snp.exclude = NULL,
  ideogram=TRUE, ideo.zoom=TRUE, ideo.rect=FALSE,
  cex=0.5, cex.leg=1.5, 
  colors = c("default", "neon", "primary"), ...)

Arguments

intenData

IntensityData object, must contain at least one of 'BAlleleFreq', 'LogRRatio', 'X', 'Y'.

scan.ids

A vector containing the scan IDs to plot.

chrom.ids

A vector containing the chromosomes to plot for each scanID (should have same length as scan.ids).

type

The type of plot to be created. 'BAF/LRR' creates both 'B Allele Freq' and 'Log R Ratio' plots. 'R/Theta' creates both 'R' and 'Theta' plots.

main

Vector of plot titles. If NULL then the title will include scanID, sex, and chromosome.

info

A character vector containing extra information to include in the main title.

abln

A vector of values that is of length 2*length(scan.ids). Each pair of entries specifies where vertical lines will be drawn in each plot. This is especially useful when drawing the start & end breakpoints for anomalies, for example. Use -1 as one pair value for plots that warrant only one line. By default, no lines will be drawn.

horizln

A vector containing the y-axis values at which a horizontal line will be drawn in B Allele Frequency plots.

colorGenotypes

A logical value specifying whether to color-code the points by called genotype. if TRUE, genoData must be given also.

genoData

GenotypeData object, required if colorGenotypes=TRUE.

colorBatch

A logical value specifying whether to color-code the points by sample batch (e.g, plate). If TRUE, batch.column must also be specified.

batch.column

A character string indicating which annotation variable in intenData should be used as the batch.

snp.exclude

An integer vector giving the IDs of SNPs to exclude from the plot.

ideogram

logical for whether to plot a chromosome ideogram under the BAF and LRR plots.

ideo.zoom

logical for whether to zoom in on the ideogram to match the range of the BAF/LRR plots.

ideo.rect

logical for whether to draw a rectangle on the ideogram indicating the range of the BAF/LRR plots.

cex

cex value for points on the plots.

cex.leg

cex value for the ideogram legend.

colors

Color scheme to use for genotypes. "default" is colorblind safe (colorbrewer Set2), "neon" is bright orange/green/fuschia, and "primary" is red/green/blue.

...

Other parameters to be passed directly to plot.

Details

For all plots, a vertical line is drawn every one eigth of the chromosome. For the Log R Ratio plot, the y-axis has been given the range of (-2,2).

Author(s)

Caitlin McHugh, Cathy Laurie

See Also

IntensityData, GenotypeData, BAFfromGenotypes

Examples

library(GWASdata)
data(illuminaScanADF)

blfile <- system.file("extdata", "illumina_bl.gds", package="GWASdata")
bl <- GdsIntensityReader(blfile)
intenData <-  IntensityData(bl, scanAnnot=illuminaScanADF)

genofile <- system.file("extdata", "illumina_geno.gds", package="GWASdata")
geno <- GdsGenotypeReader(genofile)
genoData <-  GenotypeData(geno, scanAnnot=illuminaScanADF)

scanID <- getScanID(illuminaScanADF, index=1)
chromIntensityPlot(intenData=intenData, scan.ids=scanID,
                   chrom.ids=22, type="BAF/LRR", info="interesting sample",
                   colorGenotypes=TRUE, genoData=genoData)
close(genoData)
close(intenData)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(GWASTools)
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/GWASTools/chromIntensityPlot.Rd_%03d_medium.png", width=480, height=480)
> ### Name: chromIntensityPlot
> ### Title: Plot B Allele Frequency and/or Log R Ratio, R or Theta values
> ###   for samples by probe position on a chromosome
> ### Aliases: chromIntensityPlot
> ### Keywords: hplot
> 
> ### ** Examples
> 
> library(GWASdata)
> data(illuminaScanADF)
> 
> blfile <- system.file("extdata", "illumina_bl.gds", package="GWASdata")
> bl <- GdsIntensityReader(blfile)
> intenData <-  IntensityData(bl, scanAnnot=illuminaScanADF)
> 
> genofile <- system.file("extdata", "illumina_geno.gds", package="GWASdata")
> geno <- GdsGenotypeReader(genofile)
> genoData <-  GenotypeData(geno, scanAnnot=illuminaScanADF)
> 
> scanID <- getScanID(illuminaScanADF, index=1)
> chromIntensityPlot(intenData=intenData, scan.ids=scanID,
+                    chrom.ids=22, type="BAF/LRR", info="interesting sample",
+                    colorGenotypes=TRUE, genoData=genoData)
> close(genoData)
> close(intenData)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>