Learn R Programming

beadarrayMSV (version 1.0.3)

findClusters: Suggest clusters based on histograms

Description

Initial cluster centres are suggested based on the theta values of a single marker. Usually called by getCenters or getSpecificCenters

Usage

findClusters(theta, breaks = seq(-0.25, 1.25, 0.05), minBin = 2,
    plot = FALSE)

Arguments

theta
Numeric vector of polar coordinates angles for a single marker, as given in the assayData slot theta of objects of class "AlleleSetIllumina"
breaks
Histogram breakpoints. See hist
minBin
The minimum peak height below which peaks are set to zero
plot
If TRUE, histogram is plotted (for testing)

Value

  • A list containing
  • clPeaksSuggested cluster centres
  • clSizesEstimated number of samples in each cluster
  • nClNumber of clusters

See Also

getCenters, getSpecificCenters, createAlleleSet

Examples

Run this code
#Read pre-processed data directly into AlleleSetIllumina object
rPath <- system.file("extdata", package="beadarrayMSV")
dataFiles <- makeFilenames('testdata',normOpts,rPath)
beadFile <- paste(rPath,'beadData_testdata.txt',sep='/')
beadInfo <- read.table(beadFile,sep='\t',header=TRUE,as.is=TRUE)
BSRed <- createAlleleSetFromFiles(dataFiles[1:4],markers=1:10,beadInfo=beadInfo)

#Tune resolution or filter to achieve monomorphic marker
print(findClusters(assayData(BSRed)$theta[1,],plot=TRUE))
print(findClusters(assayData(BSRed)$theta[1,],breaks=seq(-0.25,1.25,0.1),plot=TRUE))
print(findClusters(assayData(BSRed)$theta[1,],minBin=5,plot=TRUE))

#Tune resolution to achieve MSV-5 call
par(mfrow=c(3,1),mai=c(.5,.5,.5,.1))
plot(assayData(BSRed)$theta[2,],assayData(BSRed)$intensity[2,],pch='o')
print(findClusters(assayData(BSRed)$theta[2,],plot=TRUE))
print(findClusters(assayData(BSRed)$theta[2,],breaks=seq(-0.25,1.25,0.04),plot=TRUE))

Run the code above in your browser using DataLab