Title: | Thermal Shift Analysis in R |
---|---|
Description: | This package automates analysis workflow for Thermal Shift Analysis (TSA) data. Processing, analyzing, and visualizing data through both shiny applications and command lines. Package aims to simplify data analysis and offer front to end workflow, from raw data to multiple trial analysis. |
Authors: | Xinlin Gao [aut, cre] , William M. McFadden [aut, fnd] , Stefan G. Sarafianos [fnd, aut, ths] |
Maintainer: | Xinlin Gao <[email protected]> |
License: | AGPL-3 |
Version: | 1.5.0 |
Built: | 2024-11-27 05:12:47 UTC |
Source: | https://github.com/bioc/TSAR |
The analyze_norm function allows users to process analysis through an UI interface. Function wraps together all functions with in TSA_analysis family and read_write_analysis family.
analyze_norm(raw_data)
analyze_norm(raw_data)
raw_data |
The raw data for analysis. |
shiny application
gam_analysis
, read_tsar
,
write_tsar
, join_well_info
if (interactive()) { data("qPCR_data1") shiny::runApp(analyze_norm(qPCR_data1)) }
if (interactive()) { data("qPCR_data1") shiny::runApp(analyze_norm(qPCR_data1)) }
This function is used to extract information of the condition IDs from a loaded TSA Analysis Data file. Condition IDs are automatically generated by the read_analysis function in the automated workflow. This returns either a character vector of unique IDs present or a numeric value of the number of unique IDs.
condition_IDs(analysis_data, n = FALSE)
condition_IDs(analysis_data, n = FALSE)
analysis_data |
a data frame that is unmerged and generated by TSAR::read_analysis() or a merged TSA data frame generated by TSAR::merge_TSA(). Data frames require a column named 'condition_ID'. |
n |
logical value; |
Either a character vector of condition_IDs or a numeric value.
merge_TSA
and read_analysis
for preparing input.
Other TSA Summary Functions:
TSA_ligands()
,
TSA_proteins()
,
well_IDs()
data("example_tsar_data") condition_IDs(example_tsar_data)
data("example_tsar_data") condition_IDs(example_tsar_data)
Dataset Description: This is an example dataset of the tsar_data strucutre. The data frame contains well ID, conditions, and experimental details.
data(example_tsar_data)
data(example_tsar_data)
A data frame with the following columns:
Well position
Temperature in degrees
Fluorescence reading
Normalized value
Calculated first derivative
Tm value
Protein information
Ligand information
Experiment file name
Well ID
Condition ID
example tsar_data in data frame
experimentally obtained
Function pipeline that combines separated functions and iterate through each well to estimate the Tm.
gam_analysis( raw_data, keep = TRUE, fit = FALSE, smoothed = FALSE, boltzmann = FALSE, fluo_col = NA, selections = c("Well.Position", "Temperature", "Fluorescence", "Normalized") )
gam_analysis( raw_data, keep = TRUE, fit = FALSE, smoothed = FALSE, boltzmann = FALSE, fluo_col = NA, selections = c("Well.Position", "Temperature", "Fluorescence", "Normalized") )
raw_data |
data frame; raw data frame |
keep |
Boolean; set to |
fit |
Boolean; set to |
smoothed |
Boolean; set to |
boltzmann |
Boolean; set to |
fluo_col |
integer; the Fluorescence variable column id (e.g. fluo = 5 when 5th column of data frame is the Fluorescence value) if fluorescence variable is named exactly as "Fluorescence", fluo does not need to be specified. |
selections |
list of characters; the variables in raw data user intends
to keep. It is set, by default, to |
List of data frames, list of three data frame outputs, Tm estimation by well, data set, fit of model by well.
Other tsa_analysis:
Tm_est()
data("qPCR_data1") gam_analysis(qPCR_data1, smoothed = TRUE, boltzmann = FALSE, fluo_col = 5, selections = c( "Well.Position", "Temperature", "Fluorescence", "Normalized" ) ) model <- gam_analysis(qPCR_data1, smoothed = FALSE, boltzmann = TRUE)
data("qPCR_data1") gam_analysis(qPCR_data1, smoothed = TRUE, boltzmann = FALSE, fluo_col = 5, selections = c( "Well.Position", "Temperature", "Fluorescence", "Normalized" ) ) model <- gam_analysis(qPCR_data1, smoothed = FALSE, boltzmann = TRUE)
Function enables separation of legends from plots within the TSAR package.
get_legend(input_plot)
get_legend(input_plot)
input_plot |
a ggplot2 object |
two ggplots, one containing the legend and another containing all else.
Other TSA Plots:
TSA_boxplot()
,
TSA_compare_plot()
,
TSA_wells_plot()
,
graph_tsar()
,
view_deriv()
data("example_tsar_data") boxplot <- TSA_boxplot(example_tsar_data, color_by = "Protein", label_by = "Ligand", separate_legend = FALSE ) get_legend(boxplot)
data("example_tsar_data") boxplot <- TSA_boxplot(example_tsar_data, color_by = "Protein", label_by = "Ligand", separate_legend = FALSE ) get_legend(boxplot)
Function allows users to graph out tsar_data, building boxplot, compare plots, and curves by condition. Input of data as parameter is optional. graph_tsar wraps together all graphing functions and relative helper functions.
graph_tsar(tsar_data = data.frame())
graph_tsar(tsar_data = data.frame())
tsar_data |
tsar data outputted by merge_norm or merge_tsa. Parameter is optional. If no data is passed, access the merge panel to merge norm_data into tsar_data. |
prompts separate app window for user interaction, does not return specific value; generates boxplot and compare plots according to user input
TSA_boxplot
, TSA_compare_plot
,
condition_IDs
, well_IDs
,
merge_norm
, TSA_Tms
,
Tm_difference
Other TSA Plots:
TSA_boxplot()
,
TSA_compare_plot()
,
TSA_wells_plot()
,
get_legend()
,
view_deriv()
if (interactive()) { data("example_tsar_data") shiny::runApp(graph_tsar(example_tsar_data)) }
if (interactive()) { data("example_tsar_data") shiny::runApp(graph_tsar(example_tsar_data)) }
Reads in the ligand and protein information and joins them accordingly to the big data frame for graphing purposes.
join_well_info( file_path, file = NULL, analysis_file, skips = 0, nrows = 96, type )
join_well_info( file_path, file = NULL, analysis_file, skips = 0, nrows = 96, type )
file_path |
string; file path to read in the file |
file |
object; use file to override the need of file_path if information is already read in |
analysis_file |
data frame; data frame containing smoothed fluorescence data and tm values |
skips |
integer; number indicating the number of headers present in input file, default set to 0 when file input is "by_well" If the input follows the excel template, this parameter does not apply. |
nrows |
integer; number indicating the number of rows the data is. Default set to 96 assuming analysis on 96 well plate. Parameter is only applicable when file input is "by_well". If inputting by excel template, this parameter does not apply, please ignore. |
type |
string; variable specifies the type of input read in. type = "by_well" requires input of csv or txt files of three variables: Well, Protein, Ligand. type = "by_template" requires input of excel file following the template format provided |
outputs data frame joining data information with well information
Other read_write_analysis:
read_tsar()
,
write_tsar()
data("qPCR_data1") result <- gam_analysis(qPCR_data1, smoothed = TRUE, fluo = 5) data("well_information") join_well_info( file_path = NULL, file = well_information, read_tsar(result, output_content = 2), type = "by_template" )
data("qPCR_data1") result <- gam_analysis(qPCR_data1, smoothed = TRUE, fluo = 5) data("well_information") join_well_info( file_path = NULL, file = well_information, read_tsar(result, output_content = 2), type = "by_template" )
This function merges data of experiment replicates across different dates. It merges and produces information variables used to group wells of same set up.
merge_norm(data, name, date)
merge_norm(data, name, date)
data |
list, a character vector specifying the file paths of the data
files or data frame objects of analysis data set. For example, given data
frames named "data1" and "data2", specify parameter as
|
name |
list, character vector specifying the experiment names. |
date |
list, character vector specifying the dates. Does not require any date format restrictions. |
This function merges and normalizes test data from multiple files.
The lengths of the data
, name
, and date
vectors
must match, otherwise an error is thrown.
data frame in the format of tsar_data
Other TSAR Formatting:
TSA_Tms()
,
TSA_average()
,
Tm_difference()
,
merge_TSA()
,
normalize_fluorescence()
,
rescale()
data("qPCR_data1") result <- gam_analysis(qPCR_data1, smoothed = TRUE, fluo = 5) data("well_information") norm_data <- join_well_info( file_path = NULL, file = well_information, read_tsar(result, output_content = 2), type = "by_template" ) norm_data <- na.omit(norm_data) data("qPCR_data2") result2 <- gam_analysis(qPCR_data1, smoothed = TRUE, fluo = 5) norm_data2 <- join_well_info( file_path = NULL, file = well_information, read_tsar(result2, output_content = 2), type = "by_template" ) norm_data2 <- na.omit(norm_data2) tsar_data <- merge_norm( data = list(norm_data, norm_data2), name = c("Thermal Shift_162.eds.csv", "Thermal Shift_168.eds.csv"), date = c("20230203", "20230209") )
data("qPCR_data1") result <- gam_analysis(qPCR_data1, smoothed = TRUE, fluo = 5) data("well_information") norm_data <- join_well_info( file_path = NULL, file = well_information, read_tsar(result, output_content = 2), type = "by_template" ) norm_data <- na.omit(norm_data) data("qPCR_data2") result2 <- gam_analysis(qPCR_data1, smoothed = TRUE, fluo = 5) norm_data2 <- join_well_info( file_path = NULL, file = well_information, read_tsar(result2, output_content = 2), type = "by_template" ) norm_data2 <- na.omit(norm_data2) tsar_data <- merge_norm( data = list(norm_data, norm_data2), name = c("Thermal Shift_162.eds.csv", "Thermal Shift_168.eds.csv"), date = c("20230203", "20230209") )
This function is used to load both the Raw Data and the Analysis Results which are returned by the TSA software. Both output files have unique information regarding the experiment, and these need reunited for downstream analysis. Automatically generated Well IDs are use to merge similar data within the same experiment from the different files. Both Raw Data and the Analysis Results files must be specified. The returned, merged results from this function are required for downstream analysis as the format is set up for the automated workflow.
merge_TSA(analysis_file_path, raw_data_path, protein = NA, ligand = NA)
merge_TSA(analysis_file_path, raw_data_path, protein = NA, ligand = NA)
raw_data_path , analysis_file_path
|
a character string or vector of
character strings; the path or the name of the file which the
'RawData' or "AnalysisData' are to be read from. Raw data and Analysis
Data are to be loaded as a pair of results from the same experiment.
When loading multiple files, the index/position of the pairs are
merged where the first file specified by raw_data_path is to be merged
with the first file specified by analysis_file_path. The same is done
for the second, third, .. etc. raw_data_path path must contain the term RawData and
analysis_file_path must contain the term AnalysisResults as the
TSA software automatically assigns this when exporting data. Data is
loaded from the |
protein |
can be used to select for an individual or multiple protein(s) as a character string matching protein names assigned in the TSA software. NA by default. |
ligand |
can be used to select for an individual or multiple ligand(s) as a character string matching ligand names assigned in the TSA software. NA by default. |
A data frame of merged TSA data.
The TSAR package relies on matching conditions and file names for each
well and for each set of conditions between multiple files output by
the TSA software. Conditions are assigned to individual wells within
the TSA software; these assigned values are detected by
read_analysis
and
read_raw_data
then are converted into IDs.
Ensure your labeling of values within the TSA software is consistent
so that similar values can be merged - typos or varying terms will be
treated as distinct values within TSAR unless the values
are manually specified by the user.
Automatically generated well IDs within a TSA file can be found using the
well_IDs
function; condition IDs can be found using the
condition_IDs
function.
Condition IDs are generated only in the
read_analysis
, see that function's documentation for
more details. Condition IDs are assigned to raw data in the
merge_TSA
function.
Well IDs are similar to Condition IDs, as they are
generated from columns in TSA output. Well IDs are used to match
the analysis and raw data files for the same experiment, as both files
contain unique, useful information for each well.
The well ID includes the .eds file name saved from the
PCR machine to match equivalent wells between files of the same
experiment. Each well on all plates should have a unique well ID.
If you wish to change or specify the file name used for the well ID,
a new name can be manually assigned with the "manual_file" argument.
read_raw_data
and read_analysis
for loading data.
Other TSAR Formatting:
TSA_Tms()
,
TSA_average()
,
Tm_difference()
,
merge_norm()
,
normalize_fluorescence()
,
rescale()
# note: example does not contain example data to run # merge_TSA(analysis_file_path, raw_data_path)
# note: example does not contain example data to run # merge_TSA(analysis_file_path, raw_data_path)
Function finds fitted fluorescence values by imposing Boltzmann function.
model_boltzmann(norm_data)
model_boltzmann(norm_data)
norm_data |
data frame input, preferably normalized using
|
dtaa frame containing gam model fitted values
Other data_preprocess:
model_fit()
,
model_gam()
,
normalize()
,
remove_raw()
,
run_boltzmann()
,
screen()
,
view_model()
,
weed_raw()
data("qPCR_data1") A01 <- subset(qPCR_data1, Well.Position == "A01") A01 <- normalize(A01) model_boltzmann(A01)
data("qPCR_data1") A01 <- subset(qPCR_data1, Well.Position == "A01") A01 <- normalize(A01) model_boltzmann(A01)
Model_fit calculates derivatives by refitting model onto data. Only runs on data of a single well.
model_fit(norm_data, model, smoothed)
model_fit(norm_data, model, smoothed)
norm_data |
data frame; the raw data set input |
model |
fitted model containing fitted values |
smoothed |
inform whether data already contains a smoothed model; Input
the column name of the smoothed data to override values of gam model
fitting. For example, existing "Fluorescence" column contains data
already smoothed, set |
data frame; with calculated derivative columns
Other data_preprocess:
model_boltzmann()
,
model_gam()
,
normalize()
,
remove_raw()
,
run_boltzmann()
,
screen()
,
view_model()
,
weed_raw()
data("qPCR_data1") test <- subset(qPCR_data1, Well.Position == "A01") test <- normalize(test, fluo = 5, selected = c( "Well.Position", "Temperature", "Fluorescence", "Normalized" )) gammodel <- model_gam(test, x = test$Temperature, y = test$Normalized) model_fit(test, model = gammodel) # if data come smoothed, run ... model_fit(test, smoothed = "Fluorescence")
data("qPCR_data1") test <- subset(qPCR_data1, Well.Position == "A01") test <- normalize(test, fluo = 5, selected = c( "Well.Position", "Temperature", "Fluorescence", "Normalized" )) gammodel <- model_gam(test, x = test$Temperature, y = test$Normalized) model_fit(test, model = gammodel) # if data come smoothed, run ... model_fit(test, smoothed = "Fluorescence")
Function finds fitted fluorescence values by imposing generalized
additive model on fluorescence data by temperature. Model assumes
method = "GACV.Cp" and sets to formula = y ~ s(x, bs = "ad")
.
Function inherits function from gam package, gam
().
model_gam(norm_data, x, y)
model_gam(norm_data, x, y)
norm_data |
data frame input of only one well's reading, preferably
normalized using |
x |
temperature column |
y |
normalized fluorescence column |
data frame containing gam model fitted values
Other data_preprocess:
model_boltzmann()
,
model_fit()
,
normalize()
,
remove_raw()
,
run_boltzmann()
,
screen()
,
view_model()
,
weed_raw()
data("qPCR_data1") test <- subset(qPCR_data1, Well.Position == "A01") test <- normalize(test, fluo = 5, selected = c( "Well.Position", "Temperature", "Fluorescence", "Normalized" )) model_gam(test, x = test$Temperature, y = test$Normalized)
data("qPCR_data1") test <- subset(qPCR_data1, Well.Position == "A01") test <- normalize(test, fluo = 5, selected = c( "Well.Position", "Temperature", "Fluorescence", "Normalized" )) model_gam(test, x = test$Temperature, y = test$Normalized)
normalize() reads in raw_data. This function normalizes data by standardizing them according to maximum and minimum fluorescence per well, with maximum set to 1 and minimum set to 0. It also reformats data types by checking for potential error. i.e. a string specifying 100,000 will be read in as number, 100000, without issue. Function is applicable only to data of a single well, do not call on an entire data frame of all 96 well data. It is intended for single well screening purposes.
normalize( raw_data, fluo = NA, selected = c("Well.Position", "Temperature", "Fluorescence", "Normalized") )
normalize( raw_data, fluo = NA, selected = c("Well.Position", "Temperature", "Fluorescence", "Normalized") )
raw_data |
data frame; raw dataset input, should be of only one well.
If multiple wells need to be normalized, use |
fluo |
integer; the Fluorescence variable column id (e.g. fluo = 5 when 5th column of the data frame is the Fluorescence value) if fluorescence variable is named exactly as "Fluorescence", fluo does not need to be specified. i.e. fluo is set to NA by default, suggesting the variable is named "Fluorescence". |
selected |
list of character strings; variables from the original data set users intend to keep. Variable default set to c("Well.Position", "Temperature", "Fluorescence", "Normalized") if not otherwise specified. If data frame variables are named differently, user needs to specify what column variables to keep. |
cleaned up data framed with selected columns
Other data_preprocess:
model_boltzmann()
,
model_fit()
,
model_gam()
,
remove_raw()
,
run_boltzmann()
,
screen()
,
view_model()
,
weed_raw()
data("qPCR_data1") test <- subset(qPCR_data1, Well.Position == "A01") normalize(test)
data("qPCR_data1") test <- subset(qPCR_data1, Well.Position == "A01") normalize(test)
This function will take the TSA data and normalize the arbitrary fluorescence
measurements based on the specified method. Each well, determined by a
unique well ID, is normalized independently.
All measurements can be normalized to the minimum or maximum value.
Alternatively, setting by = "rescale"
(the default) will cause
all values to be normalized between the minimum and
maximum values, with the maximum = 1 and the minimum = 0 and all other
values normalized in-between. Finally, the user can supply a single
value or vector of values to normalize the data to. The returned data
frame will be the input tsa data frame with a new column named "RFU"
containing the normalized TSA data.
normalize_fluorescence(tsa_data = tsa_data, by = "rescale", control_vect = NA)
normalize_fluorescence(tsa_data = tsa_data, by = "rescale", control_vect = NA)
tsa_data |
a data frame that is unmerged and generated by TSAR::read_raw_data() or a merged TSA data frame generated by TSAR::merge_TSA(). Data frames require a column named "Fluorescence" containing numeric values for normalizing. |
by |
character string; either c("rescale", "min", "max", "control").
|
control_vect |
numeric vector to normalize the column "Fluorescence"
to. An individual number will normalize all measurements to be normalized
to it. The vector will need to align with tsa_data$Fluorescence. Ensure
|
a data frame identical to the tsa_data input with a new column named "RFU" containing the normalized values
read_raw_data
and merge_TSA
for loading data.
Other TSAR Formatting:
TSA_Tms()
,
TSA_average()
,
Tm_difference()
,
merge_TSA()
,
merge_norm()
,
rescale()
# examples not ran without example dataset # raw_data <- read_raw_data(raw_data_path) # normalize_fluorescence(raw_data, by == "control)
# examples not ran without example dataset # raw_data <- read_raw_data(raw_data_path) # normalize_fluorescence(raw_data, by == "control)
Dataset Description: This dataset contains qPCR data for the CA121 protein and common vitamins. It provides fluorescence measurements obtained using QuantStudio3. Dataset is experimentally obtained by author of this package.
data(qPCR_data1)
data(qPCR_data1)
A data frame with the following columns:
Well Count, not required for user
Well Label, i.e. A01; required input
reading count in time series, not required for user
temperature reading, required input
fluorescence reading, required input
qPCR_data1 data frame
experimentally obtained
Dataset Description: This dataset contains qPCR data for the CA121 protein and common vitamins. It provides fluorescence measurements obtained using QuantStudio3. A different experiemnt trial containing data of similar property as data, qPCR_data1. Dataset is experimentally obtained by author of this package.
data(qPCR_data2)
data(qPCR_data2)
A data frame with the following columns:
Well Count, not required for user
Well Label, i.e. A01; required input
reading count in time series, not required for user
temperature reading, required input
fluorescence reading, required input
qPCR_data2 data frame
Open TSA Analysis files. This function is used to load data output from the thermal shift software analysis tab. Can be either .txt or .csv file with a path / file name including the string "AnalysisResults" due to its automatic naming from the software. The values assigned to wells within the TSA software are automatically extracted from the loaded file; values must be assigned within the TSA software for the automated workflow (See IDs Section Below). Note: Wells that do not have an Analysis Group assigned are removed. The TSA software automatically assigns all wells to Analysis Group 1 by default, and can be changed but not removed by the software.
read_analysis( path, type = "derivative", conditions = c("Protein", "Ligand"), manual_conditions = NA, manual_wells = NA, skip_flags = FALSE, manual_file = NA )
read_analysis( path, type = "derivative", conditions = c("Protein", "Ligand"), manual_conditions = NA, manual_wells = NA, skip_flags = FALSE, manual_file = NA )
path |
a character string; the path or the name of the file which the 'AnalysisResults' data are to be read from. Either a .txt or .csv file. The path must contain the term AnalysisResults as the TSA software automatically assigns this when exporting data. |
type |
either c("boltzmann", "derivative"); |
conditions |
A character vector of condition types assigned within the
TSA software to load.
|
manual_conditions , manual_wells
|
NA by default, enabling automated analysis. A character vector of Condition IDs and Well IDs to manually assign each row of the read data. |
skip_flags |
logical value; |
manual_file |
NA by default. User can specify .eds for merging if needed for Well IDs if needed with a character string. |
A data frame of TSA analysis data.
The TSAR package relies on matching conditions and file names for each
well and for each set of conditions between multiple files output by
the TSA software. Conditions are
assigned to individual wells within the TSA software; these assigned
values are detected by
read_analysis
and
read_raw_data
then are converted into IDs.
Ensure your labeling of values within the TSA software is consistent
so that similar values can be merged - typos or varying terms will be
treated as distinct values within TSAR unless the values
are manually specified by the user.
Automatically generated well IDs within a TSA file can be found using the
well_IDs
function; condition IDs can be found using the
condition_IDs
function.
Condition IDs are generated from columns in TSA output
specified by the 'conditions' argument.
Protein and Ligand values, the default conditions within the TSA
software, are the values used to create these IDs. You can manually
specify the
condition categories from the TSA software, including user-made
conditions. Condition IDs are used to match equivalent observations
between technical and biological replicates. Wells with identical
condition IDs, specified by the 'conditions' argument, will be
aggregated in down-stream analysis; user-specified conditions must
remain consistent in use and order to create compatible IDs between TSA
files from the same experiment and between replicates.
Well IDs are similar to Condition IDs, as they are
generated from columns in TSA output that are
specified by the 'conditions' argument. Well IDs are used to match
the analysis and raw data files for the same experiment, as both files
contain unique, useful information for each well. In addition to the
condition ID, the well ID includes the .eds file name saved from the
PCR machine to match equivalent wells between files of the same
experiment. Each well on all plates should have a unique well ID.
If you wish to change or specify the file name used for the well ID,
a new name can be manually assigned with the "manual_file" argument.
The user may manually assign condition IDs using the 'manual_conditions' argument rather than using the automatically generated IDs. The same is true for well IDs, which can be manually assigned with 'manual_wells'. This is not suggested, as there may be issues with matching if well/conditions are not properly matching. This gives the potential for errors in downstream applications as well.
read_raw_data
for loading accompanying data.
merge_TSA
for joining Analysis Results and Raw Data files
from the TSA software.
Other Read TSA Data:
read_raw_data()
path <- "~/Desktop/analysis_data" # note: example does not contain example data to run # read_analysis(path)
path <- "~/Desktop/analysis_data" # note: example does not contain example data to run # read_analysis(path)
Open TSA Raw Data files. This function is used to load data output from the thermal shift software Raw Data tab. Can be either .txt or .csv file with a path / file name including the string "RawData" due to its automatic naming from the software. The values assigned to wells within the TSA software are automatically extracted from the loaded file; values must be assigned within the TSA software for the automated workflow (See IDs Section Below).
read_raw_data(path, manual_file = NA, type = "fluorescence")
read_raw_data(path, manual_file = NA, type = "fluorescence")
path |
a character string; the path or the name of the file which the 'RawData' data are to be read from. Either a .txt or .csv file. The path must contain the term RawData as the TSA software automatically assigns this when exporting data. |
manual_file |
NA by default. User can specify .eds for merging if needed for Well IDs with a character string. |
type |
either c("boltzmann", "derivative", "fluorescence");
|
A data frame of TSA raw data.
The TSAR package relies on matching conditions and file names for each
well and for each set of conditions between multiple files output by
the TSA software. Conditions are
assigned to individual wells within the TSA software; these assigned
values are detected by
read_analysis
and
read_raw_data
then are converted into IDs.
Ensure your labeling of values within the TSA software is consistent
so that similar values can be merged - typos or varying terms will be
treated as distinct values within TSAR unless the values
are manually specified by the user.
Automatically generated well IDs within a TSA file can be found using the
well_IDs
function; condition IDs can be found using the
condition_IDs
function.
Condition IDs are generated only in the
read_analysis
, see that function's documentation for
more details. Condition IDs are assigned to raw data in the
merge_TSA
function.
Well IDs are similar to Condition IDs, as they are
generated from columns in TSA output. Well IDs are used to match
the analysis and raw data files for the same experiment, as both files
contain unique, useful information for each well.
The well ID includes the .eds file name saved from the
PCR machine to match equivalent wells between files of the same
experiment. Each well on all plates should have a unique well ID.
If you wish to change or specify the file name used for the well ID,
a new name can be manually assigned with the "manual_file" argument.
read_analysis
for loading accompanying data.
merge_TSA
for joining Analysis Results and Raw Data files
from the TSA software.
Other Read TSA Data:
read_analysis()
path <- "~/Desktop/raw_data" # note: example does not contain example data to run # read_raw_data(path)
path <- "~/Desktop/raw_data" # note: example does not contain example data to run # read_raw_data(path)
reads previous pipeline output lists from gam_analysis
()
and organizes them into separate data frames.
read_tsar(gam_result, output_content)
read_tsar(gam_result, output_content)
gam_result |
list; input uses resulting output of
|
output_content |
integer;
|
output files with select dataset
Other read_write_analysis:
join_well_info()
,
write_tsar()
data("qPCR_data1") result <- gam_analysis(qPCR_data1, smoothed = TRUE, fluo_col = 5, selections = c( "Well.Position", "Temperature", "Fluorescence", "Normalized" ) ) read_tsar(result, output_content = 0) output_data <- read_tsar(result, output_content = 2)
data("qPCR_data1") result <- gam_analysis(qPCR_data1, smoothed = TRUE, fluo_col = 5, selections = c( "Well.Position", "Temperature", "Fluorescence", "Normalized" ) ) read_tsar(result, output_content = 0) output_data <- read_tsar(result, output_content = 2)
Removes selected curves with specified wells and range.
remove_raw(raw_data, removerange = NULL, removelist = NULL)
remove_raw(raw_data, removerange = NULL, removelist = NULL)
raw_data |
dataframe; to be processed data |
removerange |
list type input identifying range of wells to select.
For example, if removing all 12 wells from row D to H is needed, one can
specify the row letters and column numbers like this:
|
removelist |
use this parameter to remove selected Wells with full
Well names. For example, |
dataframe; data frame with specified well removed
Other data_preprocess:
model_boltzmann()
,
model_fit()
,
model_gam()
,
normalize()
,
run_boltzmann()
,
screen()
,
view_model()
,
weed_raw()
data("qPCR_data1") remove_raw(qPCR_data1, removelist = c("A01", "D11"))
data("qPCR_data1") remove_raw(qPCR_data1, removelist = c("A01", "D11"))
For a vector of numeric values, the minimum and maximum values are determined and each value of the vector is rescaled between 0 and 1. Values near 0 are close to the minimum, values near 1 are close to the max. This function is utilized by other TSAR functions.
rescale(x)
rescale(x)
x |
a numeric vector to be rescaled |
A numeric vector of rescaled values.
Other TSAR Formatting:
TSA_Tms()
,
TSA_average()
,
Tm_difference()
,
merge_TSA()
,
merge_norm()
,
normalize_fluorescence()
x <- c(0, 1, 3) rescale(x)
x <- c(0, 1, 3) rescale(x)
Function runs function model_boltzmann()
and raises warning when
modeling generates error or warnings.
run_boltzmann(norm_data)
run_boltzmann(norm_data)
norm_data |
data frame input, preferably normalized using
|
data frame containing gam model fitted values
Other data_preprocess:
model_boltzmann()
,
model_fit()
,
model_gam()
,
normalize()
,
remove_raw()
,
screen()
,
view_model()
,
weed_raw()
data("qPCR_data1") A01 <- subset(qPCR_data1, Well.Position == "A01") A01 <- normalize(A01) run_boltzmann(A01)
data("qPCR_data1") A01 <- subset(qPCR_data1, Well.Position == "A01") A01 <- normalize(A01) run_boltzmann(A01)
screens multiple wells of data and prepares to assist identification of corrupted wells and odd out behaviors
screen(raw_data, checkrange = NULL, checklist = NULL)
screen(raw_data, checkrange = NULL, checklist = NULL)
raw_data |
input raw_data |
checkrange |
list type input identifying range of wells to select.
For example, if viewing first 8 wells from row A to C is needed, one can
specify the row letters and column numbers like this:
|
checklist |
use this parameter to view selected Wells with full
Well names. For example, |
returns a ggplot graph colors by well IDs
Other data_preprocess:
model_boltzmann()
,
model_fit()
,
model_gam()
,
normalize()
,
remove_raw()
,
run_boltzmann()
,
view_model()
,
weed_raw()
data("qPCR_data1") screen(qPCR_data1, checkrange = c("A", "C", "1", "12"))
data("qPCR_data1") screen(qPCR_data1, checkrange = c("A", "C", "1", "12"))
From a specified control condition, the change in Tm is calculated for
each condition in the tsa_data. Specifically,
. Individual Tm values are averaged by
condition, see
TSA_average
for details.
To see all conditions use condition_IDs(tsa_data)
.
Tm_difference(tsa_data, control_condition)
Tm_difference(tsa_data, control_condition)
tsa_data |
a data frame that is merged and generated by
TSAR::merge_TSA(). If |
control_condition |
character string matching a Condition ID. Must be
equal to a value within tsa_data$condition_ID. See unique condition IDs
with |
a data frame of reformatted data with the TSA_average
data and the Tm.
merge_TSA
for preparing data.
TSA_average
for more information on the output data.
condition_IDs
to get unique Condition IDs within the
input.
TSA_boxplot
for application.
Other TSAR Formatting:
TSA_Tms()
,
TSA_average()
,
merge_TSA()
,
merge_norm()
,
normalize_fluorescence()
,
rescale()
data("example_tsar_data") control <- condition_IDs(example_tsar_data)[1] Tm_difference(example_tsar_data, control_condition = control)
data("example_tsar_data") control <- condition_IDs(example_tsar_data)[1] Tm_difference(example_tsar_data, control_condition = control)
Looks for Tm temperature values by finding the inflection point in the fluorescence data. The inflection point is approximated by locating the maximum first derivative stored in "norm_deriv" column.
Tm_est(norm_data, min, max)
Tm_est(norm_data, min, max)
norm_data |
data frame; data frame input containing derivative values can only be data frames for one well; finding inflections points across multiple wells require iteration through individual wells |
min |
restricts finding to be above the given minimum temperature |
max |
restricts finding to be below the given maximum temperature parameter min and max can be used to remove messy or undesired data for better accuracy in tm estimation; removing data is before fitting the model is more recommended than removing here |
integer; tm estimation
Other tsa_analysis:
gam_analysis()
data("qPCR_data1") test <- subset(qPCR_data1, Well.Position == "A01") test <- normalize(test, fluo = 5, selected = c( "Well.Position", "Temperature", "Fluorescence", "Normalized" )) gammodel <- model_gam(test, x = test$Temperature, y = test$Normalized) fit <- model_fit(test, model = gammodel) Tm_est(fit)
data("qPCR_data1") test <- subset(qPCR_data1, Well.Position == "A01") test <- normalize(test, fluo = 5, selected = c( "Well.Position", "Temperature", "Fluorescence", "Normalized" )) gammodel <- model_gam(test, x = test$Temperature, y = test$Normalized) fit <- model_fit(test, model = gammodel) Tm_est(fit)
This function will take either Fluorescence or Normalized Fluorescence
curves from the submitted data frame and find the average (mean) and
standard deviation (sd) for each temperature measured in the TSA curve.
Mean and sd are smoothened by default to generate cleaner curves.
The function gam
from the mgcv package is used for
regression to smoothen lines. Smoothing can be turned off and the true
average for each point can be given, however, plots will look messier.
The qPCR machine may return temperatures with many decimal places,
and TSAR only merges identical values, therefore rounding is necessary.
Data is rounded to one decimal place to improve regression smoothing.
Note: All submitted data is averaged, regardless of condition or
well ID.
If you wish to average by condition, you will need to sort the data frame
and run this function on subsets.
TSA_average( tsa_data, y = "Fluorescence", digits = 1, avg_smooth = TRUE, sd_smooth = TRUE )
TSA_average( tsa_data, y = "Fluorescence", digits = 1, avg_smooth = TRUE, sd_smooth = TRUE )
tsa_data |
a data frame that is merged and generated by
TSAR::merge_TSA(). If |
y |
character string; c('Fluorescence', 'RFU').
When |
digits |
an integer; |
avg_smooth , sd_smooth
|
logical; TRUE by default. Decides if the average (avg_smooth) or standard deviation (sd_smooth) will be smoothened by regression via mgcv::gam() |
a data frame of each temperature measured with the average, sd, and n(# of averaged values) calculated. Depending on avg_smooth and sd_smooth, the smoothened lines for the maximum and mimimum sd and the average will also be returned.
merge_TSA
and merge_TSA
for
preparing data.
Other TSAR Formatting:
TSA_Tms()
,
Tm_difference()
,
merge_TSA()
,
merge_norm()
,
normalize_fluorescence()
,
rescale()
data("example_tsar_data") TSA_average(example_tsar_data, y = "Fluorescence", digits = 1, avg_smooth = TRUE, sd_smooth = TRUE )
data("example_tsar_data") TSA_average(example_tsar_data, y = "Fluorescence", digits = 1, avg_smooth = TRUE, sd_smooth = TRUE )
Generates a box and whiskers plot for each condition specified. This
is used to compare Tm values between the data set.
See Tm_difference
for details.
TSA_boxplot( tsa_data, control_condition = NA, color_by = "Protein", label_by = "Ligand", separate_legend = TRUE )
TSA_boxplot( tsa_data, control_condition = NA, color_by = "Protein", label_by = "Ligand", separate_legend = TRUE )
tsa_data |
a data frame that is merged and generated by
TSAR::merge_TSA(). If |
control_condition |
Either a condition_ID or NA; NA by default. When a valid Condition ID is provided, a vertical line appears at the average Tm for the specified condition. When NA, this is skipped. |
color_by |
character string, either c("Ligand", "Protein"). The condition category to color the boxes within the box plot for comparison. This is represented in the legend. Set to NA to skip. |
label_by |
character string, either c("Ligand", "Protein"). The condition category to group the boxes within the box plot. This is represented in the axis. Set to NA to skip. |
separate_legend |
logical; |
by default, two ggplots are returned: one TSA curve and one key.
When separate_legend = FALSE
one ggplot is returned.
merge_TSA
for preparing data. See Tm_difference
and
get_legend
for details on function parameters.
Other TSA Plots:
TSA_compare_plot()
,
TSA_wells_plot()
,
get_legend()
,
graph_tsar()
,
view_deriv()
data("example_tsar_data") TSA_boxplot(example_tsar_data, color_by = "Protein", label_by = "Ligand", separate_legend = FALSE )
data("example_tsar_data") TSA_boxplot(example_tsar_data, color_by = "Protein", label_by = "Ligand", separate_legend = FALSE )
Generate a number of plots based on the input data to compare the average
and standard deviation (sd) of each unique condition to a specified
control condition. To see all conditions use condition_IDs(tsa_data)
.
TSA_compare_plot( tsa_data, control_condition, y = "Fluorescence", show_Tm = FALSE, title_by = "both", digits = 1 )
TSA_compare_plot( tsa_data, control_condition, y = "Fluorescence", show_Tm = FALSE, title_by = "both", digits = 1 )
tsa_data |
a data frame that is merged and generated by
TSAR::merge_TSA(). If |
control_condition |
character string matching a Condition ID. Must be
equal to a value within tsa_data$condition_ID. See unique condition IDs
with |
y |
character string; c('Fluorescence', 'RFU').
When |
show_Tm |
logical; |
title_by |
character string; c("ligand", "protein", "both"). Automatically names the plots by the specified condition category. |
digits |
integer; the number of decimal places to round for change in Tm calculations displayed in the subtitle of each plot.. |
Generates a number of ggplot objects equal to the number of unique Condition IDs present in the input data.
merge_TSA
and normalize_fluorescence
for preparing data. See TSA_average
and
get_legend
for details on function parameters.
See TSA_wells_plot
for individual curves of the averaged
conditions shown.
Other TSA Plots:
TSA_boxplot()
,
TSA_wells_plot()
,
get_legend()
,
graph_tsar()
,
view_deriv()
data("example_tsar_data") TSA_compare_plot(example_tsar_data, y = "RFU", control_condition = "CA FL_DMSO" )
data("example_tsar_data") TSA_compare_plot(example_tsar_data, y = "RFU", control_condition = "CA FL_DMSO" )
This function is used to extract information from a data frame of TSA data. The Ligand values should be assigned in the TSA software.
TSA_ligands(tsa_data, n = FALSE)
TSA_ligands(tsa_data, n = FALSE)
tsa_data |
a data frame that is merged and generated by TSAR::merge_TSA(), or an unmerged data frame read by TSAR::read_analysis() or TSAR::read_raw_data(). The data frame must have a column named 'Ligand'. |
n |
logical value; |
Either a character vector of unique well_IDs or a numeric value.
merge_TSA
, read_raw_data
,
and read_analysis
for preparing input.
Other TSA Summary Functions:
TSA_proteins()
,
condition_IDs()
,
well_IDs()
data("example_tsar_data") TSA_ligands(example_tsar_data)
data("example_tsar_data") TSA_ligands(example_tsar_data)
This function is used to extract information from a data frame of TSA data. The Protein values should be assigned in the TSA software.
TSA_proteins(tsa_data, n = FALSE)
TSA_proteins(tsa_data, n = FALSE)
tsa_data |
a data frame that is merged and generated by TSAR::merge_TSA(), or an unmerged data frame read by TSAR::read_analysis() or TSAR::read_raw_data(). The data frame must have a column named 'Protein'. |
n |
logical value; |
Either a character vector of unique well_IDs or a numeric value.
merge_TSA
, read_raw_data
,
and read_analysis
for preparing input.
Other TSA Summary Functions:
TSA_ligands()
,
condition_IDs()
,
well_IDs()
data("example_tsar_data") TSA_proteins(example_tsar_data)
data("example_tsar_data") TSA_proteins(example_tsar_data)
This function is used to output calculated Tm data from TSA analysis. The input data frame will be transformed into a new format that is helpful for user reading and automated analysis. The Tm values can be listed as a data frame of individual wells or the Tms from identical conditions can be averaged. When condition_average is TRUE (the default), samples with identical condition IDs will be aggregated and the average / standard deviation will be calculated where appropriate. To analyze multiple TSA experiments, use merge_TSA() to make a single data frame for analysis.
TSA_Tms(analysis_data, condition_average = TRUE)
TSA_Tms(analysis_data, condition_average = TRUE)
analysis_data |
a data frame that is unmerged and generated by TSAR::read_analysis() or a merged TSA data frame generated by TSAR::merge_TSA(). Data frames require a column named 'condition_ID' for averaging. |
condition_average |
logical value; |
A data frame of Tm values.
merge_TSA
, read_raw_data
,
and read_analysis
for preparing input.
Other TSAR Formatting:
TSA_average()
,
Tm_difference()
,
merge_TSA()
,
merge_norm()
,
normalize_fluorescence()
,
rescale()
data("example_tsar_data") TSA_Tms(example_tsar_data)
data("example_tsar_data") TSA_Tms(example_tsar_data)
Generates the individual curves for each well in the merged tsa data input.
Options to create an average and standard deviation sd of the plot
in addition to the individual curves. The average and sd will be
smoothened by linear regression; see TSA_average
for
details.
TSA_wells_plot( tsa_data, y = "RFU", show_Tm = TRUE, Tm_label_nudge = 7.5, show_average = TRUE, plot_title = NA, plot_subtitle = NA, smooth = TRUE, separate_legend = TRUE )
TSA_wells_plot( tsa_data, y = "RFU", show_Tm = TRUE, Tm_label_nudge = 7.5, show_average = TRUE, plot_title = NA, plot_subtitle = NA, smooth = TRUE, separate_legend = TRUE )
tsa_data |
a data frame that is merged and generated by
TSAR::merge_TSA(). If |
y |
character string; c('Fluorescence', 'RFU').
When |
show_Tm |
logical; |
Tm_label_nudge |
numeric; |
show_average |
logical; |
plot_title , plot_subtitle
|
characer string, NA by default. User-specified plots to overright automatic naming. |
smooth |
logical; |
separate_legend |
logical; |
by default, two ggplots are returned: one TSA curve and one key.
When separate_legend = FALSE
one ggplot is returned.
merge_TSA
and normalize_fluorescence
for preparing data. See TSA_average
and
get_legend
for details on function parameters.
Other TSA Plots:
TSA_boxplot()
,
TSA_compare_plot()
,
get_legend()
,
graph_tsar()
,
view_deriv()
data("example_tsar_data") check <- subset(example_tsar_data, condition_ID == "CA FL_PyxINE HCl") TSA_wells_plot(check, separate_legend = FALSE)
data("example_tsar_data") check <- subset(example_tsar_data, condition_ID == "CA FL_PyxINE HCl") TSA_wells_plot(check, separate_legend = FALSE)
Function reviews data by well and output a graph of the all derivatives wanted. Function called within graph_tsar function but also runnable outside.
view_deriv(tsar_data, frame_by = "Well")
view_deriv(tsar_data, frame_by = "Well")
tsar_data |
dataset input, analyzed must have norm_deriv as a variable; dataset qualifying norm_data or tsar_data both fulfills this parameter, although tsar_data is more recommended given more data options. |
frame_by |
builds plotly by specified frame variable. To graph by a
concentration gradient, well position, or other specified variable,
simple specify |
plotly object of derivative curves
Other TSA Plots:
TSA_boxplot()
,
TSA_compare_plot()
,
TSA_wells_plot()
,
get_legend()
,
graph_tsar()
data("example_tsar_data") view_deriv(example_tsar_data, frame_by = "condition_ID")
data("example_tsar_data") view_deriv(example_tsar_data, frame_by = "condition_ID")
Function reviews data by well and output a graph of the fit and a graph of derivative. Function called within analyze_norm function.
view_model(raw_data)
view_model(raw_data)
raw_data |
dataset input, not processing needed |
list of two ggplot graphs
Other data_preprocess:
model_boltzmann()
,
model_fit()
,
model_gam()
,
normalize()
,
remove_raw()
,
run_boltzmann()
,
screen()
,
weed_raw()
data("qPCR_data1") test <- subset(qPCR_data1, Well.Position == "A01") test <- normalize(test) gammodel <- model_gam(test, x = test$Temperature, y = test$Normalized) test <- model_fit(test, model = gammodel) view_model(test)
data("qPCR_data1") test <- subset(qPCR_data1, Well.Position == "A01") test <- normalize(test) gammodel <- model_gam(test, x = test$Temperature, y = test$Normalized) test <- model_fit(test, model = gammodel) view_model(test)
The weed_raw function allows users to interact with a screening graph
and select curves to weed out before entering analysis. Function wraps
together screen
and remove_raw
.
weed_raw(raw_data, checkrange = NULL, checklist = NULL)
weed_raw(raw_data, checkrange = NULL, checklist = NULL)
raw_data |
The raw data for screening. |
checkrange |
list type input identifying range of wells to select.
For example, if viewing first 8 wells from row A to C is needed, one can
specify the row letters and column numbers like this:
|
checklist |
use this parameter to view selected Wells with full
Well names. For example, |
prompts separate app window for user interaction, does not return specific value
screen
and remove_raw
Other data_preprocess:
model_boltzmann()
,
model_fit()
,
model_gam()
,
normalize()
,
remove_raw()
,
run_boltzmann()
,
screen()
,
view_model()
data("qPCR_data1") if (interactive()) { runApp(weed_raw(qPCR_data1, checkrange = c("A", "B", "1", "12"))) }
data("qPCR_data1") if (interactive()) { runApp(weed_raw(qPCR_data1, checkrange = c("A", "B", "1", "12"))) }
This function is used to extract information of the well IDs from a merged TSA data frame. Well IDs are automatically generated by the read_analysis and read_raw_data functions in the automated workflow. This function returns either a character vector of unique IDs present or a numeric value of the number of unique IDs.
well_IDs(tsa_data, n = FALSE)
well_IDs(tsa_data, n = FALSE)
tsa_data |
a data frame that is merged and generated by TSAR::merge_TSA(), or an unmerged data frame read by TSAR::read_analysis() or TSAR::read_raw_data(). Data frames require a column named 'well_ID'. |
n |
logical value; |
Either a character vector of unique well IDs or a numeric value.
merge_TSA
, read_raw_data
,
and read_analysis
for preparing input.
Other TSA Summary Functions:
TSA_ligands()
,
TSA_proteins()
,
condition_IDs()
data("example_tsar_data") well_IDs(example_tsar_data)
data("example_tsar_data") well_IDs(example_tsar_data)
Dataset Description: This file is a readin using well_information_template. File contains the conditions of well, specifying protein and ligand content in well. All experimental setup and relevant information are determined and manually put in by the author of this package.
data(well_information)
data(well_information)
A data frame with the following columns:
n/a
Protein in Well 1
Ligand in Well 1
Protein in Well 2
Ligand in Well 2
Protein in Well 3
Ligand in Well 3
Protein in Well 4
Ligand in Well 4
Protein in Well 5
Ligand in Well 5
Protein in Well 6
Ligand in Well 6
Protein in Well 7
Ligand in Well 7
Protein in Well 8
Ligand in Well 8
Protein in Well 9
Ligand in Well 9
Protein in Well 10
Ligand in Well 10
Protein in Well 11
Ligand in Well 11
Protein in Well 12
Ligand in Well 12
well information data frame
Dataset Description: Template specifies the way condition information will be read in as, specifying protein and ligand content in well.
data(well_information_template)
data(well_information_template)
A data frame with the following columns:
n/a
Protein in Well 1
Ligand in Well 1
Protein in Well 2
Ligand in Well 2
Protein in Well 3
Ligand in Well 3
Protein in Well 4
Ligand in Well 4
Protein in Well 5
Ligand in Well 5
Protein in Well 6
Ligand in Well 6
Protein in Well 7
Ligand in Well 7
Protein in Well 8
Ligand in Well 8
Protein in Well 9
Ligand in Well 9
Protein in Well 10
Ligand in Well 10
Protein in Well 11
Ligand in Well 11
Protein in Well 12
Ligand in Well 12
well information template in data frame
writes output into csv or txt files
write_tsar(data, name, file = "txt")
write_tsar(data, name, file = "txt")
data |
input data frame |
name |
string, name file to be saved as. Final name will be appended "tsar_output" |
file |
|
file output on the working directory where data was read in
Other read_write_analysis:
join_well_info()
,
read_tsar()
data("qPCR_data1") result <- gam_analysis(qPCR_data1, smoothed = TRUE, fluo_col = 5, selections = c( "Well.Position", "Temperature", "Fluorescence", "Normalized" ) ) output_data <- read_tsar(result, output_content = 2) # example does not run, will build excessive file in package # write_tsar(output_data, name = "2022_03_18_test", file = "txt")
data("qPCR_data1") result <- gam_analysis(qPCR_data1, smoothed = TRUE, fluo_col = 5, selections = c( "Well.Position", "Temperature", "Fluorescence", "Normalized" ) ) output_data <- read_tsar(result, output_content = 2) # example does not run, will build excessive file in package # write_tsar(output_data, name = "2022_03_18_test", file = "txt")