findClusters: Suggest clusters based on histograms

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/beadarrayMSV.R

Description

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

Usage

1
2
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

clPeaks

Suggested cluster centres

clSizes

Estimated number of samples in each cluster

nCl

Number of clusters

Note

This is a “quick and dirty” way of estimating cluster centres. The function getCenters is used as a wrapper to findClusters and returns interpreted output after calling the latter function several times with different arguments

Author(s)

Lars Gidskehaug

See Also

getCenters, getSpecificCenters, createAlleleSet

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
#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))

## End(Not run)

beadarrayMSV documentation built on May 1, 2019, 6:33 p.m.