Title: | Pharmacokinetic Bioanalysis Experiments Design and Exploration |
---|---|
Description: | Automate pharmacokinetic/pharmacodynamic bioanalytical procedures based on best practices and regulatory recommendations. The package impose regulatory constrains and sanity checking for common bioanalytical procedures. Additionally, 'PKbioanalysis' provides a relational infrastructure for plate management and injection sequence. |
Authors: | Omar Elashkar [aut, cre] |
Maintainer: | Omar Elashkar <[email protected]> |
License: | AGPL (>= 3) |
Version: | 0.2.0 |
Built: | 2024-11-02 05:44:54 UTC |
Source: | https://github.com/omarashkar/pkbioanalysis |
Add blank to the plate Can be either double blank (DB), CS0IS+ or CS1IS-
add_blank(plate, IS = TRUE, analyte = FALSE)
add_blank(plate, IS = TRUE, analyte = FALSE)
plate |
PlateObj object |
IS |
logical. If TRUE, add IS to the well. |
analyte |
logical. If TRUE, add analyte to the well. |
PlateObj
Add calibration curve to the plate
add_cs_curve(plate, plate_std)
add_cs_curve(plate, plate_std)
plate |
PlateObj |
plate_std |
character |
PlateObj
plate <- generate_96() |> add_cs_curve(c(1, 3, 5, 10, 50, 100, 200)) plot(plate)
plate <- generate_96() |> add_cs_curve(c(1, 3, 5, 10, 50, 100, 200)) plot(plate)
Add double blank (DB) to a plate
add_DB(plate)
add_DB(plate)
plate |
PlateObj object |
PlateObj
plate <- generate_96() |> add_DB()
plate <- generate_96() |> add_DB()
Add quality control samples to the plate
add_qcs(plate, lqc_conc, mqc_conc, hqc_conc, n_qc = 3, qc_serial = TRUE)
add_qcs(plate, lqc_conc, mqc_conc, hqc_conc, n_qc = 3, qc_serial = TRUE)
plate |
PlateObj object |
lqc_conc |
low quality control concentration |
mqc_conc |
medium quality control concentration |
hqc_conc |
high quality control concentration |
n_qc |
number of QC sets. Default is 3 |
qc_serial |
logical. If TRUE, QCs are placed serially |
PlateObj
Add unknown samples to a plate
add_samples(plate, samples, time = NA, conc = NA, factor = NA, prefix = "S")
add_samples(plate, samples, time = NA, conc = NA, factor = NA, prefix = "S")
plate |
PlateObj |
samples |
A vector representing samples names |
time |
A vector representing time points |
conc |
A vector representing concentration |
factor |
A vector representing factor |
prefix |
A prefix to be added before samples names. Default is "S" |
final name will be of form. Prefix-SampleName-Time-Concentration-Factor
PlateObj
plate <- generate_96() |> add_samples(paste0("T", 1:12))
plate <- generate_96() |> add_samples(paste0("T", 1:12))
Cartesian product of sample factors to a plate
add_samples_c(plate, samples, time = NA, conc = NA, factor = NA, prefix = "S")
add_samples_c(plate, samples, time = NA, conc = NA, factor = NA, prefix = "S")
plate |
PlateObj |
samples |
A vector representing samples names |
time |
A vector representing time points |
conc |
A vector representing concentration |
factor |
A vector representing factor |
prefix |
A prefix to be added before samples names. Default is "S" |
This function is a variation of 'add_samples()' where size of inputs does not matter. The function will automatically create a combination of all sample names with time, concentration and factor. final name will be of form. Prefix-SampleName-Time-Concentration-Factor
PlateObj
Add suitability sample to the plate
add_suitability(plate, conc, label = "suitability")
add_suitability(plate, conc, label = "suitability")
plate |
PlateObj object. |
conc |
numeric. Concentration of the suitability well. |
label |
character. Label for the suitability well. Default is "suitability". |
PlateObj
Create Injection Sequence
build_injec_seq( plate, method, repeat_std = 1, repeat_qc = 1, repeat_analyte = 1, blank_after_top_conc = TRUE, blank_at_end = TRUE, system_suitability = 0, blank_every_n = NULL, inject_vol, descr = "", prefix = Sys.Date(), suffix = "1", tray = 1, explore_mode = FALSE, conc_df = NULL )
build_injec_seq( plate, method, repeat_std = 1, repeat_qc = 1, repeat_analyte = 1, blank_after_top_conc = TRUE, blank_at_end = TRUE, system_suitability = 0, blank_every_n = NULL, inject_vol, descr = "", prefix = Sys.Date(), suffix = "1", tray = 1, explore_mode = FALSE, conc_df = NULL )
plate |
PlateObj object |
method |
choose method from database |
repeat_std |
number of re-injections for calibration standards. Default is 1. |
repeat_qc |
number of re-injections for QC wells. Default is 1 |
repeat_analyte |
number of re-injections for unknown samples. Default is 1 |
blank_after_top_conc |
If TRUE, adding blank after high concentrations of standards and QCS. |
blank_at_end |
If True, adding blank at the end of queue. |
system_suitability |
Number of re-injections for suitability vial. |
blank_every_n |
If no QCs, frequency of injecting blanks between analytes. |
inject_vol |
volume of injection in micro liters. |
descr |
Run description. |
prefix |
string at the beginning of the filename. Default is today's date. |
suffix |
string to be added to the end of the filename. Default is "1". |
tray |
Location in sample manager. |
explore_mode |
options either TRUE or FALSE. Default if FALSE. |
conc_df |
data.frame matching compound name to a scaling factor. Maximum 20 compounds allowed. |
explore_mode controls if exploratory samples are to be injected. A random sample from each CS and QC group will be sampled along with 1 blank sample.
InjecListObj object
Create Sample List with rigorous design
combine_injec_lists( sample_lists, n_equi = 10, equi_pos, equi_prefix = Sys.Date(), equi_suffix = "equi", equi_injec_vol = 0.5 )
combine_injec_lists( sample_lists, n_equi = 10, equi_pos, equi_prefix = Sys.Date(), equi_suffix = "equi", equi_injec_vol = 0.5 )
sample_lists |
a list of sample lists |
n_equi |
number of equilibriation injections |
equi_pos |
position of equilibriation injections. For format check details |
equi_prefix |
prefix for equilibriation injections |
equi_suffix |
suffix for equilibriation injections |
equi_injec_vol |
volume of equilibriation injection |
The equi_pos format will be Row:Column format. E.g: "A,1"
InjecListObj object
Combine plates in MultiPlate object
combine_plates(plates)
combine_plates(plates)
plates |
list of PlateObj objects |
MultiPlate object
Download sample list from database to local spreadsheet
download_sample_list(sample_list, vendor)
download_sample_list(sample_list, vendor)
sample_list |
dataframe of sample list either from db or from write_injec_seq |
vendor |
currently only 'masslynx', 'masshunter' and 'analyst' are supported |
For all current vendors, the exported format will be in csv format, compatible with the respective software.
dataframe
Generate 96 Plate Generate a typical 96 well plate. User need to specify the empty rows which a going to be used across the experiment.
generate_96(descr = "", empty_rows = NULL, extra_fill = 0)
generate_96(descr = "", empty_rows = NULL, extra_fill = 0)
descr |
plate description. |
empty_rows |
vector of letters corresponding to empty rows in a 96 well plate. |
extra_fill |
additional spots to be ignored from the first empty row. |
PlateObj
plate <- generate_96() plot(plate) plate <- generate_96("calibration", empty_rows = c("C", "D", "E"), extra_fill = 11) plot(plate)
plate <- generate_96() plot(plate) plate <- generate_96("calibration", empty_rows = c("C", "D", "E"), extra_fill = 11) plot(plate)
Create a calibration study with calibration standards and QCs
make_calibration_study( plate, plate_std, lqc_conc = NULL, mqc_conc = NULL, hqc_conc = NULL, n_qc = NULL, qc_serial = FALSE, n_CS0IS0 = 1, n_CS0IS1 = 2, n_CS1IS0 = 1 )
make_calibration_study( plate, plate_std, lqc_conc = NULL, mqc_conc = NULL, hqc_conc = NULL, n_qc = NULL, qc_serial = FALSE, n_CS0IS0 = 1, n_CS0IS1 = 2, n_CS1IS0 = 1 )
plate |
PlateObj object |
plate_std |
vector of calibration standards |
lqc_conc |
LQC concentration |
mqc_conc |
MQC concentration |
hqc_conc |
HQC concentration |
n_qc |
number of QC sets |
qc_serial |
logical. If TRUE, QCs are placed serially |
n_CS0IS0 |
number of CS0IS0 (double) blanks |
n_CS0IS1 |
number of CS0IS1 blanks |
n_CS1IS0 |
number of CS1IS0 blanks |
PlateObj
Create a metabolic study layout
make_metabolic_study( cmpds, time_points = c(0, 5, 10, 15, 30, 45, 60, 75, 90, 120), n_NAD = 3, n_noNAD = 2 )
make_metabolic_study( cmpds, time_points = c(0, 5, 10, 15, 30, 45, 60, 75, 90, 120), n_NAD = 3, n_noNAD = 2 )
cmpds |
vector of compounds, including any standards |
time_points |
vector of time points |
n_NAD |
number of NAD positive samples. Default is 3 |
n_noNAD |
number of NAD negative samples. Default is 2 |
Note that this function does not require plate object. It will create a plate object automatically and return MultiPlate object
MultiPlate object
This function creates a shiny app for plate management
plate_app()
plate_app()
A shiny app. No default return value. Can return a PlateObj if reuse_plate_button is clicked
Set plate description
plate_metadata(plate, descr)
plate_metadata(plate, descr)
plate |
PlateObj |
descr |
character. Description of the plate |
PlateObj
Plotting 96 well plate
## S3 method for class 'PlateObj' plot( x, color = "conc", Instrument = "", caption = "", label_size = 15, path = NULL, ... )
## S3 method for class 'PlateObj' plot( x, color = "conc", Instrument = "", caption = "", label_size = 15, path = NULL, ... )
x |
PlateObj |
color |
character. Coloring variable. Either "conc", "time", "factor", "samples", "TYPE" |
Instrument |
A string placed at subtitle |
caption |
A string place at plate caption |
label_size |
numeric. Size of the label. Default is 15 |
path |
Default is NULL, if not null, must be a path to save plate image |
... |
additional arguments passed to ggplot2::ggsave |
ggplot object
plate <- generate_96("new_plate", c("C", "D", "E"), 11) |> add_blank(IS = FALSE, analyte = FALSE) |> add_blank(IS = TRUE, analyte = FALSE) |> add_samples(c( "RD_per1", "RD_in1", "RD_T30", "RD_T60", "RD_T90", "RD_per2", "RD_in2", "EE_in0", "EE_T30", "EE_in30", "EE_T60", "EE_in60", "EE_T90", "EE_in90" )) plot(plate)
plate <- generate_96("new_plate", c("C", "D", "E"), 11) |> add_blank(IS = FALSE, analyte = FALSE) |> add_blank(IS = TRUE, analyte = FALSE) |> add_samples(c( "RD_per1", "RD_in1", "RD_T30", "RD_T60", "RD_T90", "RD_per2", "RD_in2", "EE_in0", "EE_T30", "EE_in30", "EE_T60", "EE_in60", "EE_T90", "EE_in90" )) plot(plate)
Register a plate This will save the plate to the database
register_plate(plate)
register_plate(plate)
plate |
PlateObj object or MultiPlate object |
PlateObj object or list of PlateObj objects
Export injection sequence to vendor specific format
write_injec_seq(injec_seq)
write_injec_seq(injec_seq)
injec_seq |
InjecListObj object |
dataframe