Description Usage Arguments Value See Also Examples
Basically a wrapper around set_read()
, set_calc_concentrations()
and
set_calc_variability()
.
For a gentler introduction see examples and Vignette "Introduction".
May write the processed data into two files: data_samples.csv
,
data_all.csv
.
1 2 3 4 5 6 | sets_read(sets, cal_names, cal_values, exclude_cals = list(),
additional_vars = c("name"), additional_sep = "_", sep = ",",
dec = ".", path = ".", file_name = "set_#NUM#.csv",
model_func = fit_linear, plot_func = plot_linear,
interpolate_func = interpolate_linear, write_data = TRUE,
use_written_data = FALSE)
|
sets |
The number of sets (e.g. |
cal_names |
A vector of strings containing the names of the samples used as calibrators. |
cal_values |
A numeric vector with the known concentrations of those samples (must be in the same order). |
exclude_cals |
A list of calibrators to exclude, e.g.:
|
additional_vars |
Vector of strings containing the names for the additional columns. |
additional_sep |
String / RegExp that separates additional vars, e.g.:
|
sep |
Separator used in the csv-file, either "," or ";" (see
|
dec |
The character used for decimal points (see |
path |
The path to the file (no trailing "/" or "\" !). |
file_name |
Name of the file from which to read the data. May contain "#NUM#" as a placeholder if you have multiple files. |
model_func |
A function generating a model to fit the calibrators,
e.g. |
plot_func |
Function used to display the fitted line. |
interpolate_func |
A function used to interpolate the concentrations of
the other samples, based on the model, e.g.
|
write_data |
Write the calculated data into |
use_written_data |
Try to read |
A list:
$all
: here you will find all the data , including calibrators,
duplicates, ... (saved in data_all.csv
if write_data = TRUE
)
$samples
: only one row per distinct sample here - no calibrators, no
duplicates -> most often you will work with this data
(saved in data_samples.csv
if write_data = TRUE
)
$set1
: a list
$plot
: a plot showing you the function used to calculate the
concentrations for this set. The points represent the calibrators.
$model
: the model as returned by model_func
($set2
- $setN
): the same information for every set you have
Other set functions: set_calc_concentrations
,
set_calc_variability
,
set_read
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | # files "set_1.csv" and "set_2.csv" containing raw values and the
# corresponding lables (consisting of ID and point in time like
# "ID_TIME")
read.csv(
file = system.file("extdata", "set_1.csv", package = "bioset"),
header = FALSE,
colClasses = "character"
)
read.csv(
file = system.file("extdata", "set_2.csv", package = "bioset"),
header = FALSE,
colClasses = "character"
)
# the known concentration of the calibrators contained in these plates
cals <- c(10, 20, 30, 40) # ng / ml
names(cals) <- c("CAL1", "CAL2", "CAL3", "CAL4")
# read both files into a tibble
# columns "ID" and "time" separated by "_"
# and calculate concentrations using the calibrators
result <- sets_read(
sets = 2, # expect 2 plates
path = system.file("extdata", package = "bioset"),
additional_vars = c("ID", "time"), # expect the labels to contain ID and
# point in time
additional_sep = "_", # separated by "_"
cal_names = names(cals), # that's what they're called in the files
cal_values = cals, # the concentration has to be known
write_data = FALSE # do not store the results in csv-files
)
# inspect results (all values contained in the two original files)
result$all
# (all values except CAL1-4)
result$samples
# inspect goodness of fit
# for plate 1
result$set_1$plot
result$set_1$model
# for plate 2
result$set_2$plot
result$set_2$model
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.