genoClusterPlot: SNP cluster plots

View source: R/genoClusterPlot.R

genoClusterPlotR Documentation

SNP cluster plots

Description

Generates either X,Y or R,Theta cluster plots for specified SNP's.

Usage

genoClusterPlot(intenData, genoData, plot.type = c("RTheta", "XY"), 
                snpID, main.txt = NULL, by.sex = FALSE,
                scan.sel = NULL, scan.hilite = NULL,
                start.axis.at.0 = FALSE,
		colors = c("default", "neon", "primary"),
                verbose = TRUE, ...)

genoClusterPlotByBatch(intenData, genoData, plot.type = c("RTheta", "XY"), 
                       snpID, batchVar, main.txt = NULL, scan.sel = NULL, 
                       colors = c("default", "neon", "primary"),
                       verbose = TRUE, ...)

Arguments

intenData

IntensityData object containing 'X' and 'Y' values.

genoData

GenotypeData object

plot.type

The type of plots to generate. Possible values are "RTheta" (default) or "XY".

snpID

A numerical vector containing the SNP number for each plot.

batchVar

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

main.txt

A character vector containing the title to give to each plot.

by.sex

Logical value specifying whether to indicate sex on the plot. If TRUE, sex must be present in intenData or genoData.

scan.sel

integer vector of scans to include in the plot. If NULL, all scans will be included.

scan.hilite

integer vector of scans to highlight in the plot with different colors. If NULL, all scans will be plotted with the same colors.

start.axis.at.0

Logical for whether the min value of each axis should be 0.

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.

verbose

Logical value specifying whether to show progress.

...

Other parameters to be passed directly to plot.

Details

Either 'RTheta' (default) or 'XY' plots can be generated. R and Theta values are computed from X and Y using the formulas r <- x+y and theta <- atan(y/x)*(2/pi).

If by.sex==TRUE, females are indicated with circles and males with crosses.

Author(s)

Caitlin McHugh

See Also

IntensityData, GenotypeData

Examples

# create data object
library(GWASdata)
data(illuminaScanADF, illuminaSnpADF)

xyfile <- system.file("extdata", "illumina_qxy.gds", package="GWASdata")
xy <- GdsIntensityReader(xyfile)
xyData <-  IntensityData(xy, scanAnnot=illuminaScanADF, snpAnnot=illuminaSnpADF)

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

# select first 9 snps
snpID <- illuminaSnpADF$snpID[1:9]
rsID <- illuminaSnpADF$rsID[1:9]

par(mfrow=c(3,3)) # plot 3x3
genoClusterPlot(xyData, genoData, snpID=snpID, main.txt=rsID)

# select samples
scan.sel <- illuminaScanADF$scanID[illuminaScanADF$race == "CEU"]
genoClusterPlot(xyData, genoData, snpID=snpID, main.txt=rsID,
                scan.sel=scan.sel, by.sex=TRUE)

genoClusterPlot(xyData, genoData, snpID=snpID, main.txt=rsID,
                scan.hilite=scan.sel)
close(xyData)
close(genoData)

## affy data - cluster plots by plate
data(affyScanADF, affySnpADF)

xyfile <- system.file("extdata", "affy_qxy.nc", package="GWASdata")
xy <- NcdfIntensityReader(xyfile)
xyData <-  IntensityData(xy, scanAnnot=affyScanADF, snpAnnot=affySnpADF)

genofile <- system.file("extdata", "affy_geno.nc", package="GWASdata")
geno <- NcdfGenotypeReader(genofile)
genoData <-  GenotypeData(geno, scanAnnot=affyScanADF, snpAnnot=affySnpADF)

# select first 9 snps
snpID <- affySnpADF$snpID[1:9]
rsID <- affySnpADF$rsID[1:9]

genoClusterPlotByBatch(xyData, genoData, snpID=snpID, main.txt=rsID,
                       batchVar="plate")
close(xyData)
close(genoData)


smgogarten/GWASTools documentation built on Nov. 10, 2024, 9:54 p.m.