Title: | Positive Droplet Calling for DNA Methylation Droplet Digital PCR |
---|---|
Description: | Reads files exported from 'QX Manager or QuantaSoft' containing amplitude values from a run of ddPCR (96 well plate) and robustly sets thresholds to determine positive droplets for each channel of each individual well. Concentration and normalized concentration in addition to other metrics is then calculated for each well. Results are returned as a table, optionally written to file, as well as optional plots (scatterplot and histogram) for both channels per well written to file. The package includes a shiny application which provides an interactive and user-friendly interface to the full functionality of PoDCall. |
Authors: | Hans Petter Brodal [aut, cre], Marine Jeanmougin [aut], Guro Elisabeth Lind [aut] |
Maintainer: | Hans Petter Brodal <[email protected]> |
License: | GPL-3 |
Version: | 1.15.0 |
Built: | 2024-10-31 03:32:21 UTC |
Source: | https://github.com/bioc/PoDCall |
importAmplitudeData
importAmplitudeData( dataDirectory, skipLines = c(0, 4), nrChannels = c(1, 2)[2], targetChannel = c(1, 2, 3, 4, 5, 6)[1], controlChannel = c(1, 2, 3, 4, 5, 6)[2] )
importAmplitudeData( dataDirectory, skipLines = c(0, 4), nrChannels = c(1, 2)[2], targetChannel = c(1, 2, 3, 4, 5, 6)[1], controlChannel = c(1, 2, 3, 4, 5, 6)[2] )
dataDirectory |
Path to directory containing Quantasoft amplitude files from one 96 well plate. Since well coordinates are used as identifiers, files in this directory should all be from the same 96 well plate. Furthermore, there should be no other files than the amplitude files from a well plate in the directory. |
skipLines |
Number of lines to skip in amplitude data files. Must be 0 or 4 depending on software used to export data. 0 for QuantaSoft, 4 for QXmanager. |
nrChannels |
Number of channels/dyes used. Default nrChannels=2 |
targetChannel |
The channel nr used as target channel (default=1) |
controlChannel |
The channel nr used as control channel (default=2) |
The function returns a list of dataframes named with the well ID and contains the amplitude values from the corresponding well.
# Path to example data files included in PoDCall path <- system.file("extdata", "Amplitudes/", package="PoDCall") # Read in data files dataList <- importAmplitudeData(dataDirectory=path, skipLines=0)
# Path to example data files included in PoDCall path <- system.file("extdata", "Amplitudes/", package="PoDCall") # Read in data files dataList <- importAmplitudeData(dataDirectory=path, skipLines=0)
Function that takes a path to a .csv-file containing information about the samples that correspond to the uploaded amplitude files. This file must contain the following columns: Well, Sample, TargetType and Target. A character vector with well IDs must also be provided, which is used to match rows in sample sheet to amplitude files
importSampleSheet( sampleSheet = NULL, well_id = NULL, software = c("QuantaSoft", "QX Manager")[2], targetChannel = c(1, 2, 3, 4, 5, 6)[1], controlChannel = c(1, 2, 3, 4, 5, 6)[2] )
importSampleSheet( sampleSheet = NULL, well_id = NULL, software = c("QuantaSoft", "QX Manager")[2], targetChannel = c(1, 2, 3, 4, 5, 6)[1], controlChannel = c(1, 2, 3, 4, 5, 6)[2] )
sampleSheet |
Path to sample sheet file containing information about samples. |
well_id |
Character vector with well IDs corresponding to uploaded amplitude files. |
software |
Name (character) of software data and sample sheet was exported from. Must be either 'QuantaSoft' or 'QX Manager'. Be careful to use correct spelling. |
targetChannel |
The channel nr used as target channel (default=1) |
controlChannel |
The channel nr used as control channel (default=2) |
A data.frame with columns for sample ID, target assay and control assay.
## Path to example sample sheet included in PoDCall path <- system.file("extdata", "Sample_names.csv", package="PoDCall") ## Select wells to get information for well_id <- c("A04", "B04", "D04") ## Get information for selected wells sampleSheet <- importSampleSheet(sampleSheet=path, well_id=well_id, software="QuantaSoft")
## Path to example sample sheet included in PoDCall path <- system.file("extdata", "Sample_names.csv", package="PoDCall") ## Select wells to get information for well_id <- c("A04", "B04", "D04") ## Get information for selected wells sampleSheet <- importSampleSheet(sampleSheet=path, well_id=well_id, software="QuantaSoft")
Function that calls podcallScatterplot and podcallHistogram and draws a plot with both scatter plot and histogram.
podcallChannelPlot(channelData, thr, channel, plotId = NULL)
podcallChannelPlot(channelData, thr, channel, plotId = NULL)
channelData |
Amplitude values from one channel of a well. |
thr |
The threshold set for |
channel |
The channel the amplitude values belong to. Target channel is 1, control channel is 2. |
plotId |
A character string with title for the plot. |
A gtable with scatterplot and histogram
## Get path to data path <- system.file("extdata", "Amplitudes/", package="PoDCall") ## Read in data data <- importAmplitudeData(path, skipLines=0) data("thrTable") ## Get name of first list element and use as well ID well_id <- names(data)[1] ## Set channel to plot channel <- 1 ## Get threshold for well_id and channel 1 (see ?thrTable) thr <- thrTable[well_id, "thr_target"] podcallChannelPlot(channelData=data[[well_id]][[channel]], thr, channel)
## Get path to data path <- system.file("extdata", "Amplitudes/", package="PoDCall") ## Read in data data <- importAmplitudeData(path, skipLines=0) data("thrTable") ## Get name of first list element and use as well ID well_id <- names(data)[1] ## Set channel to plot channel <- 1 ## Get threshold for well_id and channel 1 (see ?thrTable) thr <- thrTable[well_id, "thr_target"] podcallChannelPlot(channelData=data[[well_id]][[channel]], thr, channel)
Wrapper function that provide a complete workflow for the functionality of PoDCall. It takes path to amplitude files and sample sheet (optional), and parameters for setting threshold as input. Calls functions that read in data from files, sets threshold for each channel per well, calculates concentrations and optionally makes scatter plot and histogram for each channel per well. Results are returned as a table, optionally written to file. Plots will be written to file in a results directory if argument plots is set to TRUE.
podcallDdpcr(dataDirectory, sampleSheetFile=NULL, B=200, Q=9, refwell=1, targetChannel=c(1,2,3,4,5,6)[1], controlChannel=c(1,2,3,4,5,6)[2], nrChannels=c(1,2)[2], software=c("QuantaSoft", "QX Manager")[2], resultsToFile=FALSE, plots=FALSE, resPath=NULL)
podcallDdpcr(dataDirectory, sampleSheetFile=NULL, B=200, Q=9, refwell=1, targetChannel=c(1,2,3,4,5,6)[1], controlChannel=c(1,2,3,4,5,6)[2], nrChannels=c(1,2)[2], software=c("QuantaSoft", "QX Manager")[2], resultsToFile=FALSE, plots=FALSE, resPath=NULL)
dataDirectory |
Path to directory containing QuantaSoft amplitude files from one 96 well plate. Since well coordinates are used as identifiers, files in this directory should all be from the same 96 well plate. Furthermore, there can be no other files than the amplitude files from a well plate in the directory. |
sampleSheetFile |
File (optional) containing sample information from ddPCR experiment. This file must be a comma separated file containing the following columns: Well, Sample, TargetType and Target. |
B |
The number of permutations used for the Likelihood Ratio Test (default=200) |
Q |
A parameter for calling outliers (default=9) |
refwell |
reference well to calculate the shift in baseline (default=1) |
targetChannel |
The channel nr used as target channel (default=1) |
controlChannel |
The channel nr used as control channel (default=2) |
nrChannels |
If single channel target and no control channel, set to 1, if control channel is used, set to 2 (default=2) |
software |
The software data was exported from, either QuntaSoft or QXmanager. Needs to be specified to ensure correct reading of data and sample sheet due to difference in formatting. (defult="QX Manager") |
resultsToFile |
Should results be written to file(.csv)? (default=FALSE) |
plots |
Should plots be created and written to file? (default=FALSE) |
resPath |
Optional argument to provide results directory path (default=NULL) |
The function returns a table (data frame) with thresholds, droplet counts, concentration and normalized concentration. The table is optionally written to a .csv-file and plots for both channels per well can be written to files.
## Paths to data and sample sheet dataPath <- system.file("extdata", "Amplitudes/", package="PoDCall") ssPath <- system.file("extdata", "Sample_names.csv", package="PoDCall") ## Run PodCall podcallResults <- podcallDdpcr(dataDirectory=dataPath, sampleSheetFile=ssPath, B=100, software="QuantaSoft")
## Paths to data and sample sheet dataPath <- system.file("extdata", "Amplitudes/", package="PoDCall") ssPath <- system.file("extdata", "Sample_names.csv", package="PoDCall") ## Run PodCall podcallResults <- podcallDdpcr(dataDirectory=dataPath, sampleSheetFile=ssPath, B=100, software="QuantaSoft")
Function that make a histogram of amplitude values from one channel of a well with threshold indicated by a vertical line.
podcallHistogram(channelData, thr, channel, plotId = NULL)
podcallHistogram(channelData, thr, channel, plotId = NULL)
channelData |
Amplitude values from one channel of a well. |
thr |
The threshold set for |
channel |
The channel the amplitude values belong to. Target channel is 1, control channel is 2. |
plotId |
A character string with title for the plot. |
A histogram of amplitude values from a channel from a well with a line indicating the set threshold.
# Get path to data path <- system.file("extdata", "Amplitudes/", package="PoDCall") # Read in data data <- importAmplitudeData(path, skipLines=0) data("thrTable") # Get name of first list element and use as well ID well_id <- names(data)[1] # Set channel to plot channel <- 1 # Get threshold for well_id and channel 1 (see ?thrTable) thr <- thrTable[well_id, "thr_target"] histogram <- podcallHistogram(channelData=data[[well_id]][[channel]], thr, channel)
# Get path to data path <- system.file("extdata", "Amplitudes/", package="PoDCall") # Read in data data <- importAmplitudeData(path, skipLines=0) data("thrTable") # Get name of first list element and use as well ID well_id <- names(data)[1] # Set channel to plot channel <- 1 # Get threshold for well_id and channel 1 (see ?thrTable) thr <- thrTable[well_id, "thr_target"] histogram <- podcallHistogram(channelData=data[[well_id]][[channel]], thr, channel)
A function that returns faceted scatterplots for multiple wells suitable for comparison of wells.
podcallMultiplot( plateData, thresholds, channel = c("target", "control"), colCh = c(1, 2, 3, 4, 5, 6) )
podcallMultiplot( plateData, thresholds, channel = c("target", "control"), colCh = c(1, 2, 3, 4, 5, 6) )
plateData |
A list containing data frames with amplitude values from selected wells that is to be compared. One data frame per well. |
thresholds |
A vector containing the thresholds for the selected wells |
channel |
What channel to plot, 'target' channel or 'ontrol' channel. |
colCh |
The channel from the instrument to plot. Controls color of plot. |
Faceted scatterplot with line indicating threshold. One facet per selected well.
## Set path to data path <- system.file("extdata", "Amplitudes/", package="PoDCall") ## Read in data files data <- importAmplitudeData(path, skipLines=0) data("thrTable") ## Create plot using threshold from thrTable, see ?thrTable plot <- podcallMultiplot(plateData=data, thresholds=thrTable[names(data), ], channel="target")
## Set path to data path <- system.file("extdata", "Amplitudes/", package="PoDCall") ## Read in data files data <- importAmplitudeData(path, skipLines=0) data("thrTable") ## Create plot using threshold from thrTable, see ?thrTable plot <- podcallMultiplot(plateData=data, thresholds=thrTable[names(data), ], channel="target")
Function that make a scatterplot of amplitude values from one channel of a well with threshold indicated by a horizontal line.
podcallScatterplot(channelData, thr, channel, plotId = NULL)
podcallScatterplot(channelData, thr, channel, plotId = NULL)
channelData |
Amplitude values from one channel of a well. |
thr |
The threshold set for |
channel |
The channel the amplitude values belong to. Used to control plot color. |
plotId |
A character string with title for the plot. |
A scatterplot of all droplets from a channel from a well with a line indicating the set threshold.
# Get path to data path <- system.file("extdata", "Amplitudes/", package="PoDCall") # Read in data data <- importAmplitudeData(path, skipLines=0) data("thrTable") # Get name of first list element and use as well ID well_id <- names(data)[1] # Set channel to plot channel <- 1 # Get threshold for well_id and channel 1 (see ?thrTable) thr <- thrTable[well_id, "thr_target"] scatterplot <- podcallScatterplot(channelData=data[[well_id]][[channel]], thr, channel)
# Get path to data path <- system.file("extdata", "Amplitudes/", package="PoDCall") # Read in data data <- importAmplitudeData(path, skipLines=0) data("thrTable") # Get name of first list element and use as well ID well_id <- names(data)[1] # Set channel to plot channel <- 1 # Get threshold for well_id and channel 1 (see ?thrTable) thr <- thrTable[well_id, "thr_target"] scatterplot <- podcallScatterplot(channelData=data[[well_id]][[channel]], thr, channel)
This function launches the PoDCall shiny app in a web browser
podcallShiny()
podcallShiny()
Does not return anything, but launches PoDCall shiny app
## Not run: podcallShiny() ## End(Not run)
## Not run: podcallShiny() ## End(Not run)
Function sets threshold per channel per well and calculates concentrations. Results are returned as a data frame.
podcallThresholds(plateData, nrChannels=c(1,2)[2], B=200, Q=9, refWell=1, targetChannel=c(1,2,3,4,5,6)[1], controlChannel=c(1,2,3,4,5,6)[2], updateProgress=NULL)
podcallThresholds(plateData, nrChannels=c(1,2)[2], B=200, Q=9, refWell=1, targetChannel=c(1,2,3,4,5,6)[1], controlChannel=c(1,2,3,4,5,6)[2], updateProgress=NULL)
plateData |
List of data frames with amplitude data from a 96 well plate |
nrChannels |
If single channel target and no control channel, set to 1, if control channel is used, set to 2 (default=2) |
B |
Number of permutations for the Likelihood Ratio Test (LRT) (default=200) |
Q |
Parameter for outlier calling (default=9) |
refWell |
Reference well to calculate the shift in baseline (default=1) |
targetChannel |
The channel nr used as target channel (default=1) |
controlChannel |
The channel nr used as control channel (default=2) |
updateProgress |
function to update progress bar in shiny app (default=NULL) |
A table with results and metrics, one row per well.
## Path to example data dataPath <- system.file("extdata", "Amplitudes/", package="PoDCall") ## Read in example data dataList <- importAmplitudeData(dataDirectory=dataPath, skipLines=0) ## Set thresholds thresholds <- podcallThresholds(plateData=dataList, B=100)
## Path to example data dataPath <- system.file("extdata", "Amplitudes/", package="PoDCall") ## Read in example data dataList <- importAmplitudeData(dataDirectory=dataPath, skipLines=0) ## Set thresholds thresholds <- podcallThresholds(plateData=dataList, B=100)
A data.frame
that contains the results of running PodCall
with the amplitude data files included in the package. For testing and
running of examples. See vignette for more detailed description about
columns.
data("thrTable")
data("thrTable")
A data.frame
with 13 columns, which are:
Sample ID
Target channel
Threshold target channel (target assay)
Threshold control channel (control assay)
Positive droplets target
Positive droplets control
Total droplets
Concentration target
Concentration control
Normalized concentration based on 4Plex control
Normalized concentration based on single gene control
Parameter Q for calling outliers
Target assay
Control assay
Reference well used to set threshold
In-house cell-line experiment.