Title: | Automated Analysis of Multiplex Digital PCR Data |
---|---|
Description: | The automated clustering and quantification of the digital PCR data is based on the combination of 'DBSCAN' (Hahsler et al. (2019) <doi:10.18637/jss.v091.i01>) and 'c-means' (Bezdek et al. (1981) <doi:10.1007/978-1-4757-0450-1>) algorithms. The analysis is independent of multiplexing geometry, dPCR system, and input amount. The details about input data and parameters are available in the vignette. |
Authors: | Alfonso De Falco [aut, cre] |
Maintainer: | Alfonso De Falco <[email protected]> |
License: | MIT + file LICENSE |
Version: | 2.0.1 |
Built: | 2025-02-05 05:13:12 UTC |
Source: | https://github.com/alfodefalco/dpcp |
This function calculates the coodintaes of all clusters centroid.
centers_data(sample.subquality, sample.table, referenceDB) ## S3 method for class 'centers_data' plot(x, ..., sample = "all")
centers_data(sample.subquality, sample.table, referenceDB) ## S3 method for class 'centers_data' plot(x, ..., sample = "all")
sample.subquality |
an object of class |
sample.table |
object of class |
referenceDB |
an object of class |
x |
an object of class |
... |
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. |
An object of class centers_data
containing a sublist for
each sample. Each sublist has the following components:
quality |
quality threshold used in |
reference |
reference ID. |
centers |
a data frame with the centroids coordinates. |
data |
a data frame with the fluorescence intensities. |
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) plot(cent, sample = "all")
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) plot(cent, sample = "all")
This function carries out the c-means cluster analysis, using the centroids position as initial values for cluster centers.
cmeans_clus(centers.data) ## S3 method for class 'cmeans_clus' plot(x, ..., sample = "all", color.blind = FALSE)
cmeans_clus(centers.data) ## S3 method for class 'cmeans_clus' plot(x, ..., sample = "all", color.blind = FALSE)
centers.data |
an object of class |
x |
an object of class |
... |
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. |
An object of class cmeans_clus
containing a sublist for
each sample. Each sublist has the following components:
quality |
quality threshold used in |
reference |
reference ID. |
centers |
a data frame with the centroids coordinates. |
data |
a data frame with the fluorescence intensities and clusters name. |
membership |
a matrix with the membership values of the data elements
to the clusters. See also |
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) plot(cmclus, sample = "all")
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) plot(cmclus, sample = "all")
This function tests all combinations of eps and minPts for DBSCAN analysis of reference samples indicated in refID. The results are represented in scatterplots exported to a pdf file.
dbscan_combination( refID, system = NULL, file.location = ".", reference.quality = 0.5, eps = c(120, 150, 180, 200), minPts = c(20, 50, 80, 100) )
dbscan_combination( refID, system = NULL, file.location = ".", reference.quality = 0.5, eps = c(120, 150, 180, 200), minPts = c(20, 50, 80, 100) )
refID |
a string or a character vector of chipID (Thermo Fisher) or the complete file name with the extension (Bio-Rad) of reference sample(s) to be analysed. |
system |
character. The name of digital PCR system used to generate the data. It must be either Thermo Fisher or Bio-Rad. Abbreviations are also accepted. |
file.location |
character. Full path name to reference and sample
files location. The default corresponds to the working directory,
( |
reference.quality |
numeric. Between 0 and 1. Quality threshold
to subset the data (just for Thermo Fisher). If different thresholds have
to be applied to various reference samples, a vectror of the same length
of |
eps |
a numeric vector of values to be tested. Maximum distance
between elements within a cluster in a DBSCAN analysis.
See also |
minPts |
a numeric vector of values to be tested. Number of minimum
elements to assemble a cluster in a DBSCAN analysis.
See also |
A pdf file containing the scatterplots of DBSCAN analysis performed with all combinations of eps and minPts. Each reference generates a different pdf file.
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") dbscan_combination("dilution20200313_B01_Amplitude.csv", file.location = fileLoc, system = "bio-rad", eps = c(150, 160, 180, 190), minPts = c(80, 100, 120)) unlink("dilution20200313_B01_Amplitude.pdf")
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") dbscan_combination("dilution20200313_B01_Amplitude.csv", file.location = fileLoc, system = "bio-rad", eps = c(150, 160, 180, 190), minPts = c(80, 100, 120)) unlink("dilution20200313_B01_Amplitude.pdf")
This function carries out the autometed clustering of digital PCR data.
dPCP( file, system = NULL, file.location = ".", reference.quality = 0.5, sample.quality = 0.5, eps = 200, minPts = 50, save.template = FALSE, rain = TRUE, QC.reference = FALSE, partition.volume = NULL ) ## S3 method for class 'dPCP' plot( x, ..., sample = "all", reference = "all", type = "dPCP", color.blind = FALSE )
dPCP( file, system = NULL, file.location = ".", reference.quality = 0.5, sample.quality = 0.5, eps = 200, minPts = 50, save.template = FALSE, rain = TRUE, QC.reference = FALSE, partition.volume = NULL ) ## S3 method for class 'dPCP' plot( x, ..., sample = "all", reference = "all", type = "dPCP", color.blind = FALSE )
file |
character. The name or the path of csv file to be read. If it
does not contain an absolute path, the file name is relative to the current
working directory, ( |
system |
character. The name of digital PCR system used to generate the data. It must be either Thermo Fisher or Bio-Rad. Abbreviations are also accepted. |
file.location |
character. Full path name to reference and sample
files location. The default corresponds to the working directory,
( |
reference.quality |
numeric. Between 0 and 1. Quality threshold to
subset the data. If different thresholds have to be applied to various
reference samples, a vectror of the same length of number of reference
samples has to be provided. Used only when the |
sample.quality |
numeric. Between 0 and 1. Quality threshold to subset
data. If different thresholds have to be applied to various samples, a
vectror of the same length of number of samples has to be provided. Used
only when the |
eps |
numeric. Input parameter for the DBSCAN algorithm.
It represents the maximum distance between the elements within a cluster.
See also |
minPts |
numeric. Input parameter for the DBSCAN algorithm.
It represents the number of minimum elements to assemble a cluster. See
also |
save.template |
logical. If TRUE a template of DBSCAN analysis of
reference samples is saved. When |
rain |
logical. If TRUE the rain analysis is carried out. |
QC.reference |
logical. If TRUE the fraction of rain elements in the reference samples is carried out. Warning messages are displayed when the percentage of rain is high. |
partition.volume |
numeric. This parameters is taken into account when the parameter 'system' is set on Other. Indicate the partion volume in microliters spcific to the digital PCR system. |
x |
an object of class |
... |
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. |
reference |
'all' to show all reference samples, or a character vector with chip ID (Thermo Fisher) or the file name (Bio-rad) of reference samples to be showed. |
type |
string. Type of plot to be showed. Available plots: 'reference dbscan', 'centers', 'cmeans', 'rain', 'dPCP'. @param color.blind logical. If TRUE colors optimized for colorblind readers are used. |
color.blind |
logical. If TRUE colors optimized for colorblind readers are used. |
An object of class dPCP
containing the following components:
referenceDB |
an object of class |
samples |
a list of samples. Each sample sublist contains the information about the cluster analysis. |
results |
an object of class |
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") #dPCP analysis results <- dPCP(sampleTable, system = "bio-rad", file.location = fileLoc, eps = 200, minPts = 50, save.template = FALSE, rain = TRUE, QC.reference = FALSE) plot(results, sample = 1, type = "dPCP")
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") #dPCP analysis results <- dPCP(sampleTable, system = "bio-rad", file.location = fileLoc, eps = 200, minPts = 50, save.template = FALSE, rain = TRUE, QC.reference = FALSE) plot(results, sample = 1, type = "dPCP")
This function exports dPCP analysis results to a csv file.
export_csv(data, filename)
export_csv(data, filename)
data |
an object of class |
filename |
character. File name (no extension) for csv and pdf files to create on disk. |
A csv file with the information and results of dPCP analysis.
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") #dPCP analysis results <- dPCP(sampleTable, system = "bio-rad", file.location = fileLoc, eps = 200, minPts = 50, save.template = FALSE, rain = TRUE) export_csv(results, filename = "dPCRproject_1")
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") #dPCP analysis results <- dPCP(sampleTable, system = "bio-rad", file.location = fileLoc, eps = 200, minPts = 50, save.template = FALSE, rain = TRUE) export_csv(results, filename = "dPCRproject_1")
This function builds an interactive app to manually correct the dPCP cluster analysis.
manual_correction( data, filename, save.plot = FALSE, format = "png", dpi = 300, color.blind = FALSE )
manual_correction( data, filename, save.plot = FALSE, format = "png", dpi = 300, color.blind = FALSE )
data |
an object of class |
filename |
character. File name (no extension) for csv and pdf files to create on disk. |
save.plot |
logical. If TRUE the plots are exported to a file. |
format |
a string indicating the file format for the export. Available formats: 'eps', 'ps', 'tex', 'pdf', 'jpeg', 'tiff', 'png', 'bmp', 'svg', 'wmf'. |
dpi |
numeric. Image resolution. |
color.blind |
logical. If TRUE colors optimized for colorblind readers are used. |
A Shiny session.
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") #dPCP analysis results <- dPCP(sampleTable, system = "bio-rad", file.location = fileLoc, eps = 200, minPts = 50, save.template = FALSE, rain = TRUE) manual_correction(results, filename = "manual_dPCR", save.plot = FALSE)
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") #dPCP analysis results <- dPCP(sampleTable, system = "bio-rad", file.location = fileLoc, eps = 200, minPts = 50, save.template = FALSE, rain = TRUE) manual_correction(results, filename = "manual_dPCR", save.plot = FALSE)
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.
rain_reclus(cmeans.cluster) ## S3 method for class 'rain_reclus' plot(x, ..., sample = "all", color.blind = FALSE)
rain_reclus(cmeans.cluster) ## S3 method for class 'rain_reclus' plot(x, ..., sample = "all", color.blind = FALSE)
cmeans.cluster |
an object of class |
x |
an object of class |
... |
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. |
An object of class rain_reclus
containing a sublist for
each sample. Each sublist has the following components:
quality |
quality threshold used in |
reference |
reference ID. |
centers |
a data frame with the centroids coordinates. |
data |
a data frame with the fluorescence intensities and clusters name. |
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")
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")
This function reads the results files of reference samples listed in the
sample table. Fluoresce intensity and quality value (just for Thermo Fisher)
are collected.
If a reference_dbscan
template file with the same input
paramters (reference ID, eps, minPts) is available, fluorescence data,
quality value and dbscan analysis results are retrived from the template
file.
read_reference( sample.table, system = NULL, file.location = ".", reference.quality = 0.5, eps = NULL, minPts = NULL )
read_reference( sample.table, system = NULL, file.location = ".", reference.quality = 0.5, eps = NULL, minPts = NULL )
sample.table |
object of class |
system |
character. The name of digital PCR system used to generate the data. It must be either Thermo Fisher or Bio-Rad. Abbreviations are also accepted. |
file.location |
character. Full path name to reference and sample
files location. The default corresponds to the working directory,
( |
reference.quality |
numeric. Between 0 and 1. Quality threshold to
subset the data. If different thresholds have to be applied to various
reference samples, a vectror of the same length of number of reference
samples has to be provided. Used only when the |
eps , minPts
|
numeric. Input parameters for the DBSCAN algorithm. If
they match the paramters of |
An object of class read_reference
containing a sublist for
each reference. Each sublist has the following components:
quality |
value of the |
data |
a matrix with the fluorescence intensities and quality values. |
dbscan |
an object of class |
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)
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)
This function reads the results files of samples listed in the sample table. Fluoresce intensity and quality value (just for Thermo Fisher) are collected.
read_sample( sample.table, system = NULL, file.location = ".", sample.quality = 0.5, partition.volume = NULL )
read_sample( sample.table, system = NULL, file.location = ".", sample.quality = 0.5, partition.volume = NULL )
sample.table |
object of class |
system |
character. The name of digital PCR system used to generate the data. It must be either Thermo Fisher or Bio-Rad. Abbreviations are also accepted. |
file.location |
character. Full path name to reference and sample
files location. The default corresponds to the working directory,
( |
sample.quality |
numeric. Between 0 and 1. Quality threshold to subset
data. If different thresholds have to be applied to various samples, a
vectror of the same length of number of samples has to be provided. Used
only when the |
partition.volume |
numeric. This parameters is taken into account when the parameter 'system' is set on Other. Indicate the partion volume in microliters spcific to the digital PCR system. |
An object of class read_sample
containing a sublist for each
sample. Each sublist has the following components:
quality |
value of the |
data |
a matrix with the fluorescence intensities and quality values. |
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)
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)
This function reads a file containing the essential information about the samples and experimental settings. The file has to be filled out by the user and formatted as described in the vignette.
read_sampleTable(file, system = NULL, file.location = ".")
read_sampleTable(file, system = NULL, file.location = ".")
file |
character. The name or the path of csv file to be read. If it
does not contain an absolute path, the file name is relative to the current
working directory, ( |
system |
character. The name of digital PCR system used to generate the data. It must be either Thermo Fisher or Bio-Rad. Abbreviations are also accepted. |
file.location |
character. Full path name to reference and sample
files location. The default corresponds to the working directory,
( |
An object of class sample_table
.
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)
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)
This function computes a DBSCAN analysis to identify single target clusters
in the reference samples listed in the sample table.
If a reference_dbscan
template file with the same input
paramters (reference ID, eps, minPts) is available, data are retrived
from the template file.
reference_dbscan( reference.subquality, sample.table, eps = 200, minPts = 50, save.template = FALSE ) ## S3 method for class 'reference_dbscan' plot(x, ..., reference = "all")
reference_dbscan( reference.subquality, sample.table, eps = 200, minPts = 50, save.template = FALSE ) ## S3 method for class 'reference_dbscan' plot(x, ..., reference = "all")
reference.subquality |
an object of class |
sample.table |
object of class |
eps , minPts
|
numeric. Input parameters for the DBSCAN algorithm. If
they match the paramters of |
save.template |
logical. If TRUE a template of DBSCAN analysis of
reference samples is saved. When |
x |
an object of class |
... |
Arguments to be passed to methods |
reference |
'all' to show all reference samples, or a character vector with chip ID (Thermo Fisher) or the file name (Bio-rad) of reference samples to be showed. |
An object of class reference_dbscan
containing a sublist for
each reference. Each sublist has the following components:
quality |
quality threshold used in |
data |
a matrix with the fluorescence intensities and quality values. |
dbscan |
an object of class |
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) plot(dbref, reference = "all")
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) plot(dbref, reference = "all")
This function calculates the concentration of the targets, combining the results of the replicates of each sample.
replicates_quant(raw.results, sample.table)
replicates_quant(raw.results, sample.table)
raw.results |
an object of class |
sample.table |
object of class |
An object of class replicates_quant
containing a sublist for
every sample. Each sublist has the following components:
quality |
quality threshold used in |
reference |
reference ID. |
raw results |
a data frame with the results of quantification. |
replicates results |
a data frame with the results of quantification of pooled replicates. |
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) #Quantification quantcm <- target_quant(cmclus, sample.table) quant <- target_quant(rainclus, sample.table) #Replicates pooling rep.quant <- replicates_quant(quant, sample.table)
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) #Quantification quantcm <- target_quant(cmclus, sample.table) quant <- target_quant(rainclus, sample.table) #Replicates pooling rep.quant <- replicates_quant(quant, sample.table)
This function generates a pdf report of the dPCP analysis.
report_dPCP(data, filename, sample = "all", color.blind = FALSE)
report_dPCP(data, filename, sample = "all", color.blind = FALSE)
data |
an object of class |
filename |
character. File name (no extension) for csv and pdf files to create on disk. |
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. |
A pdf file with the information and results of the dPCP analysis.
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") #dPCP analysis results <- dPCP(sampleTable, system = "bio-rad", file.location = fileLoc, eps = 200, minPts = 50, save.template = FALSE, rain = TRUE) report_dPCP(results, filename = "dPCRproject_1")
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") #dPCP analysis results <- dPCP(sampleTable, system = "bio-rad", file.location = fileLoc, eps = 200, minPts = 50, save.template = FALSE, rain = TRUE) report_dPCP(results, filename = "dPCRproject_1")
This function calculates the concentration of the targets according to the Poisson distribution.
target_quant(data.cluster, sample.table)
target_quant(data.cluster, sample.table)
data.cluster |
an object of class |
sample.table |
object of class |
An object of class target_quant
containing a sublist for
each sample. Each sublist has the following components:
quality |
quality threshold used in |
reference |
reference ID. |
raw results |
a data frame with the results of the quantification. |
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) #Quantification quantcm <- target_quant(cmclus, sample.table) quant <- target_quant(rainclus, sample.table)
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) #Quantification quantcm <- target_quant(cmclus, sample.table) quant <- target_quant(rainclus, sample.table)