rain_reclus {dPCP}R Documentation

Identification and clustering of "rain" data

Description

This function identifies the "rain" elements and re-clusters them using the Mahalanobis distance. Each "rain" element is assigned to the cluster whose Mahalanobis distance is the lowest.

Usage

rain_reclus(cmeans.cluster)

## S3 method for class 'rain_reclus'
plot(x, ..., sample = "all", color.blind = FALSE)

Arguments

cmeans.cluster

an object of class cmeans_clus, inherited from cmeans_clus.

x

an object of class rain_reclus

...

Arguments to be passed to methods

sample

'all' to show all samples, or a numeric vector indicating the row number of samples in the sample table.

color.blind

logical. If TRUE colors optimized for colorblind readers are used.

Value

An object of class rain_reclus containing a sublist for each sample. Each sublist has the following components:

quality

quality threshold used in read_sample.

reference

reference ID.

centers

a data frame with the centroids coordinates.

data

a data frame with the fluorescence intensities and clusters name.

Examples


library(dPCP)

#Find path of sample table and location of reference and input files
sampleTable <- system.file("extdata", "Template_sampleTable.csv",
                     package = "dPCP")

fileLoc <- system.file("extdata",package = "dPCP")

#Read sample table file
sample.table <- read_sampleTable(sampleTable, system = "bio-rad",
                                 file.location = fileLoc)

#Read reference files
ref <- read_reference(sample.table, system = "bio-rad",
                      file.location = fileLoc)

#Read samples files
samp <- read_sample(sample.table, system = "bio-rad",
                   file.location = fileLoc)

#Reference DBSCAN clustering
dbref <- reference_dbscan(ref, sample.table, save.template = FALSE)

#Predict position of clusters centroid from reference DBSCAN results
cent <- centers_data(samp, sample.table,dbref)

#Fuzzy c-means clustering
cmclus <- cmeans_clus(cent)

#Rain classification.
rainclus <- rain_reclus(cmclus)

plot(rainclus, sample = "all")


[Package dPCP version 2.0.1 Index]