Title: | Access Functions, Tests and Basic Analysis of the RRD Data from the LEEF Project |
---|---|
Description: | Provides simple access functions to read data out of the sqlite RRD database. SQL queries can be configured in a yaml config file and used. |
Authors: | Rainer M. Krug [aut, cre], SNF Project 310030_188431 [fnd] |
Maintainer: | Rainer M. Krug <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.2 |
Built: | 2024-11-09 05:24:22 UTC |
Source: | https://github.com/LEEF-UZH/LEEF.analysis |
composition
and experimetal_design
table to db.Add composition
and experimetal_design
table to db.
add_experiment_tables( db = getOption("RRDdb", "LEEF.RRD.sqlite"), composition = NULL, experimetal_design = NULL, light_decline_schedule = NULL, immigration_schedule = NULL, overwrite = FALSE )
add_experiment_tables( db = getOption("RRDdb", "LEEF.RRD.sqlite"), composition = NULL, experimetal_design = NULL, light_decline_schedule = NULL, immigration_schedule = NULL, overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
composition |
fully qualified path to the |
experimetal_design |
fully qualified path to the |
light_decline_schedule |
fully qualified path to the |
immigration_schedule |
fully qualified path to the |
overwrite |
if |
Title
add_extracted_csv_to_db( db, csv_file = "Morph_mvt_non_cropped.csv", measure = "bemovi.mag.25", tn_postfix = "non_cropped", archive_dir = "/Users/rainerkrug/Duck/LEEFSwift3", copy_locally_first = FALSE )
add_extracted_csv_to_db( db, csv_file = "Morph_mvt_non_cropped.csv", measure = "bemovi.mag.25", tn_postfix = "non_cropped", archive_dir = "/Users/rainerkrug/Duck/LEEFSwift3", copy_locally_first = FALSE )
db |
fully qualified path to the sqlite database.Must be set! |
csv_file |
name of the csv files to be imported |
measure |
measure |
tn_postfix |
postfix for the table name, |
archive_dir |
directory containes the archive. It contains the following directories: - LEEF.archived.data - LEEF.archived.data_segments - LEEF.backend.data - LEEF.backend.data_segments |
copy_locally_first |
Title
add_reclassified_to_db( path, db = getOption("RRDdb", "LEEF.RRD.sqlite"), remove_timestamps = NULL, check_timestamps = TRUE, backup_removed = TRUE, methods = NULL, DBIDriver = RSQLite::SQLite() )
add_reclassified_to_db( path, db = getOption("RRDdb", "LEEF.RRD.sqlite"), remove_timestamps = NULL, check_timestamps = TRUE, backup_removed = TRUE, methods = NULL, DBIDriver = RSQLite::SQLite() )
path |
path to the root directory of the reclassification |
db |
fully qualified path to the sqlite database. Default, read from option |
remove_timestamps |
vector of timestamps to be removed. |
check_timestamps |
If 'TRUE', the data will ony be added when timestamp does not exist in db yet. If 'FALSE', it will always be added. Usually this should **NOT** be done.#' |
backup_removed |
if |
DBIDriver |
the DBI driver to use. Default is RSQLite::SQLite() |
method |
method to be added. If |
Add data to RRD database into existing table
add_to_db( fns, db = getOption("RRDdb", "LEEF.RRD.sqlite"), tables, remove_timestamps = NULL, check_timestamps = TRUE, backup_removed = TRUE, DBIDriver = RSQLite::SQLite() )
add_to_db( fns, db = getOption("RRDdb", "LEEF.RRD.sqlite"), tables, remove_timestamps = NULL, check_timestamps = TRUE, backup_removed = TRUE, DBIDriver = RSQLite::SQLite() )
fns |
vector of |
db |
fully qualified path to the sqlite database. Default, read from option |
tables |
|
remove_timestamps |
vector of timestamps to be removed. |
backup_removed |
if 'TRUE' data which will be replaced will be backed up. |
DBIDriver |
the DBI driver to use. Default is RSQLite::SQLite() |
check_timestamps. |
If |
vector of length of fns
with TRUE
if the data has been added,
FALSE
otherwise
conductivity
table from an arrow database and return as a tibble.This function returns the actual data.
arrow_read_conductivity( db = getOption("RRDarrow", "/Volumes/RRD.Reclassification_LEEF-2/parquet/"), from_timestamp = 20221106, to_timestamp = 20230812 )
arrow_read_conductivity( db = getOption("RRDarrow", "/Volumes/RRD.Reclassification_LEEF-2/parquet/"), from_timestamp = 20221106, to_timestamp = 20230812 )
db |
fully qualified path to the folder which contains all the arrow directories,
in case of LEEF called |
from_timestamp |
|
to_timestamp |
|
tibble
containing the data
density
table from an arrow database and return as a tibble.This function returns the actual data.
arrow_read_density( db = getOption("RRDarrow", "/Volumes/RRD.Reclassification_LEEF-2/parquet/"), from_timestamp = 20221106, to_timestamp = 20230812 )
arrow_read_density( db = getOption("RRDarrow", "/Volumes/RRD.Reclassification_LEEF-2/parquet/"), from_timestamp = 20221106, to_timestamp = 20230812 )
db |
fully qualified path to the folder which contains all the arrow directories,
in case of LEEF called |
from_timestamp |
|
to_timestamp |
|
tibble
containing the data
o2
table from an arrow database and return as a tibble.This function returns the actual data.
arrow_read_o2( db = getOption("RRDarrow", "/Volumes/RRD.Reclassification_LEEF-2/parquet/"), from_timestamp = 20221106, to_timestamp = 20230812 )
arrow_read_o2( db = getOption("RRDarrow", "/Volumes/RRD.Reclassification_LEEF-2/parquet/"), from_timestamp = 20221106, to_timestamp = 20230812 )
db |
fully qualified path to the folder which contains all the arrow directories,
in case of LEEF called |
from_timestamp |
|
to_timestamp |
|
tibble
containing the data
This function does not actually fetch the data, but returns an
Dataset object which can be further processed / filtered
using dplyr
. See https://db.rstudio.com/r-packages/dplyr/ for
details. To fetch the actual data, execute collect()
.
This function is simply a convenience and consistency wrapper around open_dataset
arrow_read_table( table, db = getOption("RRDarrow", "/Volumes/RRD.Reclassification_LEEF-2/parquet/"), hive_style = TRUE, unify_schemas = FALSE, format = c("parquet") )
arrow_read_table( table, db = getOption("RRDarrow", "/Volumes/RRD.Reclassification_LEEF-2/parquet/"), hive_style = TRUE, unify_schemas = FALSE, format = c("parquet") )
table |
Directory of the data files |
db |
fully qualified path to the folder which contains all the arrow directories, Defaul: |
hive_style |
see |
unify_schemas |
see |
format |
see |
A Dataset R6 object. Use dplyr methods on it to query the data.
toc
table from an arrow database and return as a tibble.This function returns the actual data.
arrow_read_toc( db = getOption("RRDarrow", "/Volumes/RRD.Reclassification_LEEF-2/parquet/"), from_timestamp = 20221106, to_timestamp = 20230812, duplicates = mean )
arrow_read_toc( db = getOption("RRDarrow", "/Volumes/RRD.Reclassification_LEEF-2/parquet/"), from_timestamp = 20221106, to_timestamp = 20230812, duplicates = mean )
db |
fully qualified path to the folder which contains all the arrow directories,
in case of LEEF called |
from_timestamp |
|
to_timestamp |
|
duplicates |
function which will be used to combine duplicates. If |
tibble
containing the data
Re-calculate densities
CalculateDensities(morph, meas, extrapolation.factor, cropping.factor)
CalculateDensities(morph, meas, extrapolation.factor, cropping.factor)
meas |
Classify bemovi data by using the archived data
classify_bemovi_archive( archive_dir = "/Users/rainerkrug/MountainDuck/LEEFSwift3", magnification = 16, bemovi_extract_name = "bemovi_extract.yml", species_tracked = NULL, timestamps, classifier_constant_name, classifier_increasing_name, output, exclude_videos = NULL, mc.cores = 1 )
classify_bemovi_archive( archive_dir = "/Users/rainerkrug/MountainDuck/LEEFSwift3", magnification = 16, bemovi_extract_name = "bemovi_extract.yml", species_tracked = NULL, timestamps, classifier_constant_name, classifier_increasing_name, output, exclude_videos = NULL, mc.cores = 1 )
magnification |
the magnification or the bemovi videos to be reclassified |
bemovi_extract_name |
the name of the |
species_tracked |
names of the species tracked as a character vector. If |
timestamps |
|
classifier_constant_name |
|
classifier_increasing_name |
|
output |
path to which the classified data will be saved as |
exclude_videos |
file names of videos to exclude. If |
mc.cores |
number of cores to be used. Defaults to 1 |
invisible NULL
Classify algae_traits data.frame
classify_bemovi_files( datadir, bemovi_extract_name = NULL, classifier_constant_name, classifier_increasing_name, exclude_videos = NULL )
classify_bemovi_files( datadir, bemovi_extract_name = NULL, classifier_constant_name, classifier_increasing_name, exclude_videos = NULL )
datadir |
|
bemovi_extract_name |
|
classifier_constant_name |
|
classifier_increasing_name |
|
exclude_videos |
file names of videos to exclude. If |
list
containing three objects:
- mean_density_per_ml
- morph_mvt
- trajectory_data
Classify algae_traits data.frame
classify_flowcam_archive( archive_dir = "/Users/rainerkrug/MountainDuck/LEEFSwift3", timestamps, algae_traits_name = "algae_traits_filtered.rds", classifier_constant_name, classifier_increasing_name, species_tracked = NULL, output, mc.cores = 1, bottle = NULL )
classify_flowcam_archive( archive_dir = "/Users/rainerkrug/MountainDuck/LEEFSwift3", timestamps, algae_traits_name = "algae_traits_filtered.rds", classifier_constant_name, classifier_increasing_name, species_tracked = NULL, output, mc.cores = 1, bottle = NULL )
timestamps |
|
classifier_constant_name |
the classifier for temperature treatment constant |
classifier_increasing_name |
the classifier for temperature treatment increasing |
species_tracked |
names of the species tracked as a character vector. If |
output |
path to which the classified data will be saved as |
mc.cores |
number of cores to be used. Defaults to 1 |
bottle |
if not 'NULL' (default) only classify this bottle. Needs to be a single bottle! |
invisible NULL
Classify algae_traits data.frame
classify_flowcam_files( datadir, algae_traits_name = "algae_traits_filtered.rds", classifier_constant_name, classifier_increasing_name, timestamp = "55555555", species_tracked = NULL, bottle = NULL )
classify_flowcam_files( datadir, algae_traits_name = "algae_traits_filtered.rds", classifier_constant_name, classifier_increasing_name, timestamp = "55555555", species_tracked = NULL, bottle = NULL )
datadir |
|
algae_traits_name |
|
classifier_constant_name |
|
classifier_increasing_name |
|
timestamp |
timestamp to be used to stamp the classified data |
species_tracked |
names of the species tracked as a character vector.
If |
bottle |
if not 'NULL' (default) only classify this bottle. Needs to be a single bottle! |
list
containing two objects:
- algae_traits
including species
- algae_densities
densities of the different particles identified
Return names of all configs in config file
configs(config_yml = system.file("tables.yml", package = "LEEF.analysis"))
configs(config_yml = system.file("tables.yml", package = "LEEF.analysis"))
config_yml |
the config file containing the sql queries |
ggplot
object of the plot
This function creates a trimmed down version of the database which does not contain the tables only necessary for the classification. It does not do anything with the original database.
create_rrd_trimmed( db = getOption("RRDdb", "LEEF.RRD.sqlite"), trimmed_db = gsub("\\.sqlite", ".trimmed.sqlite", db) )
create_rrd_trimmed( db = getOption("RRDdb", "LEEF.RRD.sqlite"), trimmed_db = gsub("\\.sqlite", ".trimmed.sqlite", db) )
db |
fully qualified path to the sqlite database. Default, read
from option |
trimmed_db |
fully qualified path to the trimmed sqlite database.
Defaults to the db with the extension |
the path and name of the trimmed database
tbl_SQLiteConnection
Disconnect the object returned by the db_read_...
functions.
db_disconnect(x)
db_disconnect(x)
x |
a |
invisibly NULL
condi=uctivity
from RRD database and return as an tbl_SQLiteConnection
.This function does not actually fetch the data,
but returns an tbl_SQLiteConnection
object which can be further processed / filtered
using dplyr
.
See https://db.rstudio.com/r-packages/dplyr/ for details.
To fetch the actual data, execute collect()
.
db_read_conductivity( db = getOption("RRDdb", "LEEF.RRD.sqlite"), from_timestamp = 20210920, to_timestamp = 21000101 )
db_read_conductivity( db = getOption("RRDdb", "LEEF.RRD.sqlite"), from_timestamp = 20210920, to_timestamp = 21000101 )
db |
fully qualified path to the sqlite database. Default, read from option |
from_timestamp |
|
to_timestamp |
|
Link to the table density
in the RRD to be used with dplyr
and friends
density
from RRD database and return as an tbl_SQLiteConnection
.This function does not actually fetch the data,
but returns an tbl_SQLiteConnection
object which can be further processed / filtered
using dplyr
.
See https://db.rstudio.com/r-packages/dplyr/ for details.
To fetch the actual data, execute collect()
.
db_read_density( db = getOption("RRDdb", "LEEF.RRD.sqlite"), from_timestamp = 20210920, to_timestamp = 21000101 )
db_read_density( db = getOption("RRDdb", "LEEF.RRD.sqlite"), from_timestamp = 20210920, to_timestamp = 21000101 )
db |
fully qualified path to the sqlite database. Default, read from option |
from_timestamp |
|
to_timestamp |
|
Link to the table density
in the RRD to be used with dplyr
and friends
immigration_sevent
from RRD database and return as an tbl_SQLiteConnection
.This function does not actually fetch the data,
but returns an tbl_SQLiteConnection
object which can be further processed / filtered
using dplyr
.
See https://db.rstudio.com/r-packages/dplyr/ for details.
To fetch the actual data, execute collect()
.
db_read_immigration(db = getOption("RRDdb", "LEEF.RRD.sqlite"))
db_read_immigration(db = getOption("RRDdb", "LEEF.RRD.sqlite"))
db |
fully qualified path to the sqlite database. Default, read from option |
Link to the table density
in the RRD to be used with dplyr
and friends
light_decline
from RRD database and return as an tbl_SQLiteConnection
.This function does not actually fetch the data,
but returns an tbl_SQLiteConnection
object which can be further processed / filtered
using dplyr
.
See https://db.rstudio.com/r-packages/dplyr/ for details.
To fetch the actual data, execute collect()
.
db_read_light_decline(db = getOption("RRDdb", "LEEF.RRD.sqlite"))
db_read_light_decline(db = getOption("RRDdb", "LEEF.RRD.sqlite"))
db |
fully qualified path to the sqlite database. Default, read from option |
Link to the table density
in the RRD to be used with dplyr
and friends
o2
from RRD database and return as an tbl_SQLiteConnection
.This function does not actually fetch the data,
but returns an tbl_SQLiteConnection
object which can be further processed / filtered
using dplyr
.
See https://db.rstudio.com/r-packages/dplyr/ for details.
To fetch the actual data, execute collect()
.
db_read_o2( db = getOption("RRDdb", "LEEF.RRD.sqlite"), from_timestamp = 20210920, to_timestamp = 21000101 )
db_read_o2( db = getOption("RRDdb", "LEEF.RRD.sqlite"), from_timestamp = 20210920, to_timestamp = 21000101 )
db |
fully qualified path to the sqlite database. Default, read from option |
from_timestamp |
|
to_timestamp |
|
Link to the table density
in the RRD to be used with dplyr
and friends
stressor_levels
from RRD database and return as an tbl_SQLiteConnection
.This function does not actually fetch the data,
but returns an tbl_SQLiteConnection
object which can be further processed / filtered
using dplyr
.
See https://db.rstudio.com/r-packages/dplyr/ for details.
To fetch the actual data, execute collect()
.
db_read_stressor_levels(db = getOption("RRDdb", "LEEF.RRD.sqlite"))
db_read_stressor_levels(db = getOption("RRDdb", "LEEF.RRD.sqlite"))
db |
fully qualified path to the sqlite database. Default, read from option |
Link to the table stressor_levels
in the RRD to be used with dplyr
and friends
tbl_SQLiteConnection
.This function does not actually fetch the data, but returns an
tbl_SQLiteConnection
object which can be further processed / filtered
using dplyr
. See https://db.rstudio.com/r-packages/dplyr/ for
details. To fetch the actual data, execute collect()
.
db_read_table( db = getOption("RRDdb", "LEEF.RRD.sqlite"), table = NULL, quiet = FALSE )
db_read_table( db = getOption("RRDdb", "LEEF.RRD.sqlite"), table = NULL, quiet = FALSE )
db |
fully qualified path to the sqlite database. Default, read from
option |
table |
the name of the table. If 'NULL', a list of tables in the database 'db' will be returned. |
quiet |
if |
Link to the table density
in the RRD to be used with dplyr
and friends
toc
measurements from RRD database and return as an tbl_SQLiteConnection
.This function does not actually fetch the data,
but returns an tbl_SQLiteConnection
object which can be further processed / filtered
using dplyr
.
See https://db.rstudio.com/r-packages/dplyr/ for details.
To fetch the actual data, execute collect()
.
db_read_toc( db = getOption("RRDdb", "LEEF.RRD.sqlite"), from_timestamp = 20210920, to_timestamp = 21000101, duplicates = mean )
db_read_toc( db = getOption("RRDdb", "LEEF.RRD.sqlite"), from_timestamp = 20210920, to_timestamp = 21000101, duplicates = mean )
db |
fully qualified path to the sqlite database. Default, read from option |
from_timestamp |
|
to_timestamp |
|
duplicates |
function which will be used to combine duplicates. If |
Link to the table density
in the RRD to be used with dplyr
and friends
Gate and extract densities from flowcytometer data by using the archived data
density_flowcytometer_archive( extracted_dir = "/Volumes/LEEF-1_archive/LEEF.archived.data/LEEF/3.archived.data/extracted/", gates_coordinates, timestamps, output, use_H, log10_all = FALSE, min_FSC.A = NULL, particles = NULL, mc.cores = 1 )
density_flowcytometer_archive( extracted_dir = "/Volumes/LEEF-1_archive/LEEF.archived.data/LEEF/3.archived.data/extracted/", gates_coordinates, timestamps, output, use_H, log10_all = FALSE, min_FSC.A = NULL, particles = NULL, mc.cores = 1 )
extracted_dir |
srchive directory of the extracted data |
gates_coordinates |
the |
timestamps |
|
output |
path to which the classified data will be saved as |
use_H |
if |
log10_all |
if |
min_FSC.A |
numeric. If |
particles |
particle class to extract. Mainly |
mc.cores |
number of cores to be used. Defaults to 1 |
invisible NULL
Extract data from table
matching the timestamps
.
For each timestamp
the data will be saved as an rds
file.
If delete_data == TRUE
the data will be deleted from the database.
extract_timestamps( db = getOption("RRDdb", "LEEF.RRD.sqlite"), table = NULL, timestamps, delete_data = FALSE, only_delete = FALSE )
extract_timestamps( db = getOption("RRDdb", "LEEF.RRD.sqlite"), table = NULL, timestamps, delete_data = FALSE, only_delete = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
table |
the name of the table. If |
timestamps |
timestamps which should be extracted |
delete_data |
Attention! If |
only_delete |
if |
invisibly NULL
Extract traits from flowcytometer data by using the archived data
extract_traits_flowcytometer_archive( extracted_dir = "~/Desktop/flowcytometer.FIXED/LEEF.FIXED.archived.data/LEEF/3.archived.data/extracted/", gates_coordinates, particles = "bacteria", timestamps, output, length_slope, length_intercept, use_H, min_FSC.A, log10_all = FALSE, mc.cores = 1, wellid_keyword = "$WELLID" )
extract_traits_flowcytometer_archive( extracted_dir = "~/Desktop/flowcytometer.FIXED/LEEF.FIXED.archived.data/LEEF/3.archived.data/extracted/", gates_coordinates, particles = "bacteria", timestamps, output, length_slope, length_intercept, use_H, min_FSC.A, log10_all = FALSE, mc.cores = 1, wellid_keyword = "$WELLID" )
gates_coordinates |
the |
particles |
particle class to extract. Mainly |
timestamps |
|
output |
path to which the classified data will be saved as |
length_slope |
slope of the linear regression of FSC.A and size ( lm(mean_FSC.A ~ diameter_micrometer ) |
length_intercept |
intercept of the linear regression of FSC.A and size ( lm(mean_FSC.A ~ diameter_micrometer ) |
use_H |
if |
min_FSC.A |
numeric. If |
log10_all |
if |
mc.cores |
number of cores to be used. Defaults to 1 |
wellid_keyword |
the kwyword which is used to identify the well ID. Usually "$WELLID" (default), but for the EAWAG Flowcytometer it is "$SMNO". |
invisible NULL
Just a function to update the overlays.
generate_overlays( params = list(cores = 7, pre_processed_folder = "/Volumes/LEEF-1_archive/LEEF.archived.data/LEEF/3.archived.data/pre_processed/", extracted_dir = "/Volumes/LEEF-1_archive/LEEF.archived.data/LEEF/3.archived.data/extracted/", output_dir = "./overlays/"), overwrite = FALSE )
generate_overlays( params = list(cores = 7, pre_processed_folder = "/Volumes/LEEF-1_archive/LEEF.archived.data/LEEF/3.archived.data/pre_processed/", extracted_dir = "/Volumes/LEEF-1_archive/LEEF.archived.data/LEEF/3.archived.data/extracted/", output_dir = "./overlays/"), overwrite = FALSE )
params |
list of parameter |
overwrite |
if 'TRUE', existing overlays will be ov erwritten. Default is 'FALSE' |
LEEF-1 - Add biomass to traits
LEEF_1_biomass_bemovi_16(ciliate_traits_16, ciliate_density_16)
LEEF_1_biomass_bemovi_16(ciliate_traits_16, ciliate_density_16)
ciliate_traits_16 |
traits as read from file |
ciliate_density_16 |
density as read from file |
list containing two objects, traits
containing complete traits file
as the argument algai_traits
day includinc biomass column and biomasses
per timestamp, bottle and species per milliliter.
LEEF-1 - Add biomass to traits
LEEF_1_biomass_bemovi_25(ciliate_traits_25, ciliate_density_25)
LEEF_1_biomass_bemovi_25(ciliate_traits_25, ciliate_density_25)
ciliate_traits_25 |
traits as read from file |
ciliate_density_25 |
density as read from file |
list containing two objects, traits
containing complete traits file
as the argument algai_traits
day includinc biomass column and biomasses
per timestamp, bottle and species per milliliter.
LEEF-1 - Add biomass to traits
LEEF_1_biomass_bemovi_25_cropped(ciliate_traits_25, ciliate_density_25)
LEEF_1_biomass_bemovi_25_cropped(ciliate_traits_25, ciliate_density_25)
ciliate_traits_25 |
traits as read from file |
ciliate_density_25 |
density as read from file |
list containing two objects, traits
containing complete traits file
as the argument algai_traits
day includinc biomass column and biomasses
per timestamp, bottle and species per milliliter.
LEEF-1 - Add biomass to traits
LEEF_1_biomass_bemovi_25_non_cropped(ciliate_traits_25, ciliate_density_25)
LEEF_1_biomass_bemovi_25_non_cropped(ciliate_traits_25, ciliate_density_25)
ciliate_traits_25 |
traits as read from file |
ciliate_density_25 |
density as read from file |
list containing two objects, traits
containing complete traits file
as the argument algai_traits
day includinc biomass column and biomasses
per timestamp, bottle and species per milliliter.
LEEF-1 - Add biomass to traits
LEEF_1_biomass_flowcam(algae_traits, algae_density)
LEEF_1_biomass_flowcam(algae_traits, algae_density)
algae_traits |
algae traits as read from file |
algae_density |
algae density as read from file |
list containing two objects, traits
containing complete traits file
as the argument algai_traits
day includinc biomass column and biomasses
per timestamp, bottle and species per milliliter.
LEEF-1 - Add biomass to traits
LEEF_1_biomass_flowcytometer(traits, density)
LEEF_1_biomass_flowcytometer(traits, density)
ciliate_traits_16 |
traits as read from file |
ciliate_density_16 |
density as read from file |
list containing two objects, traits
containing complete traits file
as the argument algai_traits
day includinc biomass column and biomasses
per timestamp, bottle and species per milliliter.
composition
and experimetal_design
table to db.Add composition
and experimetal_design
table to db.
LEEF_2_add_experiment_tables( db = getOption("RRDdb", "LEEF-2.RRD.sqlite"), composition = NULL, experimetal_design = NULL, stressor_levels = NULL, immigration_schedule = NULL, overwrite = FALSE )
LEEF_2_add_experiment_tables( db = getOption("RRDdb", "LEEF-2.RRD.sqlite"), composition = NULL, experimetal_design = NULL, stressor_levels = NULL, immigration_schedule = NULL, overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
composition |
fully qualified path to the |
stressor_levels |
fully qualified path to the |
immigration_schedule |
fully qualified path to the |
overwrite |
if |
LEEF-1 - Add biomass to traits
LEEF_2_biomass_bemovi( ciliate_traits, ciliate_density, extrapolation_factor, cropping_factor )
LEEF_2_biomass_bemovi( ciliate_traits, ciliate_density, extrapolation_factor, cropping_factor )
ciliate_density |
density as read from file |
list containing two objects, traits
containing complete traits file
as the argument algai_traits
day includinc biomass column and biomasses
per timestamp, bottle and species per milliliter.
LEEF-2 - Add biomass to traits
LEEF_2_biomass_flowcam(algae_traits, algae_density)
LEEF_2_biomass_flowcam(algae_traits, algae_density)
algae_traits |
algae traits as read from file |
algae_density |
algae density as read from file |
list containing two objects, traits
containing complete traits file
as the argument algai_traits
day includinc biomass column and biomasses
per timestamp, bottle and species per milliliter.
Classify bemovi data by using the archived data
LEEF_2_classify_bemovi_archive( extracted_dir = NULL, magnification = 16, bemovi_extract_name = NULL, timestamps, classifier = NULL, output, exclude_videos = NULL, mc.cores = 1 )
LEEF_2_classify_bemovi_archive( extracted_dir = NULL, magnification = 16, bemovi_extract_name = NULL, timestamps, classifier = NULL, output, exclude_videos = NULL, mc.cores = 1 )
magnification |
the magnification or the bemovi videos to be reclassified |
bemovi_extract_name |
the name of the |
timestamps |
|
classifier |
classifier for bemovi 16 including path |
output |
path to which the classified data will be saved as |
exclude_videos |
file names of videos to exclude. If |
mc.cores |
number of cores to be used. Defaults to 1 |
directory |
with extracted data |
invisible NULL
Classify algae_traits data.frame
LEEF_2_classify_bemovi_files( datadir, bemovi_extract_name = NULL, classifier = NULL, exclude_videos = NULL )
LEEF_2_classify_bemovi_files( datadir, bemovi_extract_name = NULL, classifier = NULL, exclude_videos = NULL )
datadir |
|
bemovi_extract_name |
|
classifier |
classifier for bemovi 16 including path |
exclude_videos |
file names of videos to exclude. If |
list
containing three objects:
- mean_density_per_ml
- morph_mvt
- trajectory_data
Classify algae_traits data.frame
LEEF_2_classify_flowcam_archive( extracted_dir = NULL, timestamps, algae_traits_name = "algae_traits_filtered.rds", classifier = NULL, species_tracked = NULL, output, mc.cores = 1, bottle = NULL )
LEEF_2_classify_flowcam_archive( extracted_dir = NULL, timestamps, algae_traits_name = "algae_traits_filtered.rds", classifier = NULL, species_tracked = NULL, output, mc.cores = 1, bottle = NULL )
extracted_dir |
path to the extracted data |
timestamps |
|
classifier |
classifier for flowcytometer |
species_tracked |
names of the species tracked as a character vector. If |
output |
path to which the classified data will be saved as |
mc.cores |
number of cores to be used. Defaults to 1 |
bottle |
if not 'NULL' (default) only classify this bottle. Needs to be a single bottle! |
invisible NULL
Classify algae_traits data.frame
LEEF_2_classify_flowcam_files( datadir, algae_traits_name = "algae_traits_filtered.rds", classifier = NULL, timestamp = "55555555", species_tracked = NULL, bottle = NULL )
LEEF_2_classify_flowcam_files( datadir, algae_traits_name = "algae_traits_filtered.rds", classifier = NULL, timestamp = "55555555", species_tracked = NULL, bottle = NULL )
datadir |
|
algae_traits_name |
|
classifier |
classifier for flowcam |
timestamp |
timestamp to be used to stamp the classified data |
species_tracked |
names of the species tracked as a character vector.
If |
bottle |
if not 'NULL' (default) only classify this bottle. Needs to be a single bottle! |
list
containing two objects:
- algae_traits
including species
- algae_densities
densities of the different particles identified
Gate and extract densities from flowcytometer data by using the archived data
LEEF_2_density_flowcytometer_archive( extracted_dir, timestamps, output, use_H, gates_coordinates, min_FSC.A = NULL, particles = NULL, mc.cores = 1 )
LEEF_2_density_flowcytometer_archive( extracted_dir, timestamps, output, use_H, gates_coordinates, min_FSC.A = NULL, particles = NULL, mc.cores = 1 )
extracted_dir |
srchive directory of the extracted data |
timestamps |
|
output |
path to which the classified data will be saved as |
use_H |
if |
gates_coordinates |
the |
min_FSC.A |
numeric. If |
particles |
particle class to extract. Mainly |
invisible NULL
Extract traits from flowcytometer data by using the archived data
LEEF_2_extract_traits_flowcytometer_archive( extracted_dir = "~/Desktop/flowcytometer.FIXED/LEEF.FIXED.archived.data/LEEF/3.archived.data/extracted/", gates_coordinates, particles = "bacteria", timestamps, output, length_slope, length_intercept, use_H, min_FSC.A, log10_all = FALSE, wellid_keyword = "$WELLID", mc.cores = 1 )
LEEF_2_extract_traits_flowcytometer_archive( extracted_dir = "~/Desktop/flowcytometer.FIXED/LEEF.FIXED.archived.data/LEEF/3.archived.data/extracted/", gates_coordinates, particles = "bacteria", timestamps, output, length_slope, length_intercept, use_H, min_FSC.A, log10_all = FALSE, wellid_keyword = "$WELLID", mc.cores = 1 )
gates_coordinates |
the |
particles |
particle class to extract. Mainly |
timestamps |
|
output |
path to which the classified data will be saved as |
length_slope |
slope of the linear regression of FSC.A and size ( lm(mean_FSC.A ~ diameter_micrometer ) |
length_intercept |
intercept of the linear regression of FSC.A and size ( lm(mean_FSC.A ~ diameter_micrometer ) |
use_H |
if |
min_FSC.A |
numeric. If |
log10_all |
if |
wellid_keyword |
the kwyword which is used to identify the well ID. Usually "$WELLID" (default), but for the EAWAG Flowcytometer it is "$SMNO". |
mc.cores |
number of cores to be used. Defaults to 1 |
invisible NULL
density
view wgich contains all density data from all measurements for LEEF-2Create density
view wgich contains all density data from all measurements for LEEF-2
LEEF_2_make_view_density( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2022-11-07", overwrite = FALSE )
LEEF_2_make_view_density( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2022-11-07", overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
start_date |
the start date of the experiment |
overwrite |
if |
the result of the execution of the ecreatiuon of the view.
o2
view which contains selected fields from the os measurement for LEEF-2Create o2
view which contains selected fields from the os measurement for LEEF-2
LEEF_2_make_view_o2( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2022-11-07", overwrite = FALSE )
LEEF_2_make_view_o2( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2022-11-07", overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
start_date |
the start date of the experiment |
overwrite |
if |
the result of the execution of the ecreatiuon of the view.
toc
view wich contains selected fields from the toc__toc measurement for LEEF-2Create toc
view wich contains selected fields from the toc__toc measurement for LEEF-2
LEEF_2_make_view_toc( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2022-11-07", overwrite = FALSE )
LEEF_2_make_view_toc( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2022-11-07", overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
start_date |
the start date of the experiment |
overwrite |
if |
the result of the execution of the ecreatiuon of the view.
Plot diagnostic plot to check bottles per timestamp
LEEF_2_plot_bottles_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), lastDays = 7, arrow = FALSE )
LEEF_2_plot_bottles_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), lastDays = 7, arrow = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
lastDays |
last days to plot. Defaoult |
arrow |
if |
ggplot
object of the plot
Plot diagnostic plot to check number of species per timestamp
LEEF_2_plot_conductivity_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), treatment_begin_day = 70, treatment_end_day = 154, arrow = FALSE )
LEEF_2_plot_conductivity_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), treatment_begin_day = 70, treatment_end_day = 154, arrow = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
treatment_begin_day |
begin of treatment (vertical red line in plot). If |
treatment_end_day |
end of treatment (vertical red line in plot). If |
arrow |
if |
ggplot
object of the plot
Plot diagnostic plot to check number of species per timestamp for LEEF-2
LEEF_2_plot_density_species_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), transform_density_4throot = TRUE, measurement = "bemovi_mag_16", species_set_id = NULL, treatment_begin_day = 70, treatment_end_day = 154, arrow = FALSE )
LEEF_2_plot_density_species_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), transform_density_4throot = TRUE, measurement = "bemovi_mag_16", species_set_id = NULL, treatment_begin_day = 70, treatment_end_day = 154, arrow = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
transform_density_4throot |
if |
measurement |
the measurement to be plotted. If |
species_set_id |
id of species set to use for filtering |
treatment_begin_day |
begin of treatment (vertical red line in plot). If |
treatment_end_day |
end of treatment (vertical red line in plot). If |
arrow |
if |
ggplot
object of the plot
Plot diagnostic plot to check is plte has an impact on flowcytometer for LEEF-2
LEEF_2_plot_flowcytometer_individual_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), species = c("bacteria"), arrow = FALSE )
LEEF_2_plot_flowcytometer_individual_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), species = c("bacteria"), arrow = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
species |
species to be plotted |
arrow |
if |
ggplot
object of the plot
Plot diagnostic plot to check number of species per timestamp
LEEF_2_plot_o2s_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), treatment_begin_day = 70, treatment_end_day = 154, arrow = FALSE )
LEEF_2_plot_o2s_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), treatment_begin_day = 70, treatment_end_day = 154, arrow = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
treatment_begin_day |
begin of treatment (vertical red line in plot). If |
treatment_end_day |
end of treatment (vertical red line in plot). If |
arrow |
if |
ggplot
object of the plot
Plot diagnostic plot to check number of species per timestamp
LEEF_2_plot_response_incubator( db = getOption("RRDdb", "LEEF.RRD.sqlite"), arrow = FALSE )
LEEF_2_plot_response_incubator( db = getOption("RRDdb", "LEEF.RRD.sqlite"), arrow = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
arrow |
if |
ggplot
object of the plot
Plot diagnostic plot to check number of species per timestamp
LEEF_2_plot_tocs_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), type = c("IC", "TC", "TN", "TOC"), treatment_begin_day = 70, treatment_end_day = 154, arrow = FALSE )
LEEF_2_plot_tocs_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), type = c("IC", "TC", "TN", "TOC"), treatment_begin_day = 70, treatment_end_day = 154, arrow = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
type |
the type of the measurement which should be displayed. A vector with the types. Possible values are: "TOC", "TN", "IC", "TN", "". |
treatment_begin_day |
begin of treatment (vertical red line in plot). If |
treatment_end_day |
end of treatment (vertical red line in plot). If |
arrow |
if |
ggplot
object of the plot
FUNCTION_DESCRIPTION
LEEF_2_rename_composition(object)
LEEF_2_rename_composition(object)
object |
PARAM_DESCRIPTION |
DETAILS
OUTPUT_DESCRIPTION
## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run)
## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run)
FUNCTION_DESCRIPTION
LEEF_2_rename_species(x)
LEEF_2_rename_species(x)
x |
PARAM_DESCRIPTION |
DETAILS
OUTPUT_DESCRIPTION
## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run)
## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run)
FUNCTION_DESCRIPTION
LEEF_2_rename_species_prob_columns(object)
LEEF_2_rename_species_prob_columns(object)
object |
PARAM_DESCRIPTION |
DETAILS
OUTPUT_DESCRIPTION
## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run)
## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run)
FUNCTION_DESCRIPTION
LEEF_2_rename_toc(x)
LEEF_2_rename_toc(x)
x |
PARAM_DESCRIPTION |
DETAILS
OUTPUT_DESCRIPTION
## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run)
## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run)
Report for checking pipeline and sampling
LEEF_2_report_diagnostic( db = NULL, suffix = "", format = "html", lastDays = 7, arrow = FALSE, parquet_dir = "/Volumes/RRD.Reclassification_LEEF-2/parquet/" )
LEEF_2_report_diagnostic( db = NULL, suffix = "", format = "html", lastDays = 7, arrow = FALSE, parquet_dir = "/Volumes/RRD.Reclassification_LEEF-2/parquet/" )
db |
fully qualified path to the sqlite database. The report will be saved to the same directory. |
suffix |
suffix for the file name |
format |
the format of the report as a character vector of length 1.
Supported are at the moment: |
lastDays |
number of last days to be included in graph 2. Default: 7 |
arrow |
if |
parquet_dir |
directory where the parquet files are stored. Default: '/Volumes/RRD.Reclassification_LEEF-2/parquet/'. Will only be used whe |
the fully qualified file name to the created report.
o2
view wgich contains selected fields from the conductivity measurementCreate o2
view wgich contains selected fields from the conductivity measurement
make_view_conductivity( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
make_view_conductivity( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
start_date |
the start date of the experiment |
overwrite |
if |
the result of the execution of the ecreatiuon of the view.
density
view wgich contains all density data from all measurementsCreate density
view wgich contains all density data from all measurements
make_view_density( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
make_view_density( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
start_date |
the start date of the experiment |
overwrite |
if |
the result of the execution of the ecreatiuon of the view.
immigration_event
view which adds the experimental dayCreate immigration_event
view which adds the experimental day
make_view_immigration_event( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
make_view_immigration_event( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
start_date |
the start date of the experiment |
overwrite |
if |
the result of the execution of the ecreatiuon of the view.
light_decline
view which adds the experimental dayCreate light_decline
view which adds the experimental day
make_view_light_decline( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
make_view_light_decline( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
start_date |
the start date of the experiment |
overwrite |
if |
the result of the execution of the creation of the view.
o2
view wgich contains selected fields from the os measurementCreate o2
view wgich contains selected fields from the os measurement
make_view_o2( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
make_view_o2( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
start_date |
the start date of the experiment |
overwrite |
if |
the result of the execution of the ecreatiuon of the view.
toc
view wich contains selected fields from the toc__toc measurementCreate toc
view wich contains selected fields from the toc__toc measurement
make_view_toc( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
make_view_toc( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
start_date |
the start date of the experiment |
overwrite |
if |
the result of the execution of the ecreatiuon of the view.
This function calls the other make_view_...()
functions, wrapped in individual try()
blocks.
make_views( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
make_views( db = getOption("RRDdb", "LEEF.RRD.sqlite"), start_date = "2021-09-20", overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
start_date |
the start date of the experiment in the format |
overwrite |
if |
invisibly NULL
Create overlays
overlays( timestamp = 20210920, magnification = 25, cropped = FALSE, label = "species", overlay.type = "both", crf = 17, gamma = 2, ffmpeg = "ffmpeg", from_current_to_archive_dir = "./../../../../../Duck/LEEFSwift3/LEEF.archived.data/LEEF/3.archived.data", mc.cores = 1 )
overlays( timestamp = 20210920, magnification = 25, cropped = FALSE, label = "species", overlay.type = "both", crf = 17, gamma = 2, ffmpeg = "ffmpeg", from_current_to_archive_dir = "./../../../../../Duck/LEEFSwift3/LEEF.archived.data/LEEF/3.archived.data", mc.cores = 1 )
timestamp |
the timestamp of the sampling day |
magnification |
the magnification of the bemovi method |
cropped |
if |
label |
column to be used to label the particle. Default
|
overlay.type |
Overlays can either be shown as "label", "circle" or
"both". Default: |
crf |
integer value between 1 to 51, where 1 means lossless, 17 is nearly visually lossless, 51 is worst quality. Default value is 23 |
gamma |
increase video dynamic range. Value between 0.1 and 10. Default 2. see https://ffmpeg.org/ffmpeg-filters.html#eq for further info |
ffmpeg |
command to run ffmpeg. It can include a path. Default
|
from_current_to_archive_dir |
path from the current directory to the
archived data can be found and the folders |
mc.cores |
number of cores to be used for parallel execution. Defaults to 1 |
This is a wrapper around the function bemovi.LEEF::create_overlays_subtitle_directory()
providing default values for LEEF.
Overlays will be created from a folder containing the video files and the bemovi config file
and the trajectory data file name.
overlays_from_folders( traj_data_file, avi_folder, bemovi_extract_yml_file, temp_overlay_folder, overlay_folder, overlay_type = "both", label = "species", ffmpeg = "ffmpeg", font_size = 24, circle_size = 120, crf = 23, gamma = 2, mc_cores = 1, overwrite = FALSE )
overlays_from_folders( traj_data_file, avi_folder, bemovi_extract_yml_file, temp_overlay_folder, overlay_folder, overlay_type = "both", label = "species", ffmpeg = "ffmpeg", font_size = 24, circle_size = 120, crf = 23, gamma = 2, mc_cores = 1, overwrite = FALSE )
traj_data_file |
file name of the file containing the trajectory data (usually from the Master file) |
avi_folder |
folder containing the input |
bemovi_extract_yml_file |
name of the |
temp_overlay_folder |
directory where the subtitle files will be saved |
overlay_folder |
directory where the overlay video will be saved |
overlay_type |
option for the overlays. Overlays can either be shown as
|
label |
column to be used to label the particle. Default is
|
ffmpeg |
command to run ffmpeg. The default is |
font_size |
size of the font for the labels. Default: 24 |
circle_size |
size of the circle. Default: 120 |
crf |
integer value between 1 to 51, where 1 means lossless, 17 is nearly visually lossless, 51 is worst quality. Default value is 23 |
gamma |
gamma correction. Value between 0.1 and 10. Default 2. see https://ffmpeg.org/ffmpeg-filters.html#eq for further info |
mc_cores |
number of cores toi be used for parallel execution.
Defaults to |
overwrite |
if |
Create overlays
overlays_from_reclassification( archive_dir = "/Users/rainerkrug/Duck/LEEFSwift3", classification_dir = "~/RRD.Reclassification_1", magnification = 16, yml_postfix = NULL, timestamp, overlay_folder = NULL, overlay_type = "both", label = "species", ffmpeg = "ffmpeg", font_size = 24, circle_size = 120, crf = 23, gamma = 2, mc_cores = 1 )
overlays_from_reclassification( archive_dir = "/Users/rainerkrug/Duck/LEEFSwift3", classification_dir = "~/RRD.Reclassification_1", magnification = 16, yml_postfix = NULL, timestamp, overlay_folder = NULL, overlay_type = "both", label = "species", ffmpeg = "ffmpeg", font_size = 24, circle_size = 120, crf = 23, gamma = 2, mc_cores = 1 )
magnification |
the magnification of the bemovi method |
timestamp |
the timestamp of the sampling day |
label |
column to be used to label the particle. Default |
ffmpeg |
command to run ffmpeg. It can include a path. Default |
crf |
integer value between 1 to 51, where 1 means lossless, 17 is nearly visually lossless, 51 is worst quality. Default value is 23 |
gamma |
increase video dynamic range. Value between 0.1 and 10. Default |
mc_cores |
number of cores to use. Default |
FUNCTION_DESCRIPTION
FUNCTION_DESCRIPTION
FUNCTION_DESCRIPTION
FUNCTION_DESCRIPTION
FUNCTION_DESCRIPTION
FUNCTION_DESCRIPTION
FUNCTION_DESCRIPTION
FUNCTION_DESCRIPTION
FUNCTION_DESCRIPTION
Essentially combined re-implementation of rds_to_parquet
and csv_to_parquet
plus standardisation on small
letter column names and timestamps as character.
parquet_add_bemovi_16( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_bemovi_25( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_bemovi_25_cropped( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_flowcam( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_flowcytometer( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_o2( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_manualcount( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_conductivity( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_toc( fn = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) object_to_parquet( object, path_to_parquet, partition = "no", compression = "snappy", compression_level = NULL, ... )
parquet_add_bemovi_16( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_bemovi_25( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_bemovi_25_cropped( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_flowcam( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_flowcytometer( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_o2( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_manualcount( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_conductivity( fns = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) parquet_add_toc( fn = NULL, path_to_parquet_root_dir = NULL, compression = "snappy", rename = FALSE ) object_to_parquet( object, path_to_parquet, partition = "no", compression = "snappy", compression_level = NULL, ... )
fns |
PARAM_DESCRIPTION, Default: NULL |
path_to_parquet_root_dir |
PARAM_DESCRIPTION, Default: NULL |
compression |
compression as used in |
rename |
Should data be renamed to follow specified standards, Default: FALSE |
fn |
PARAM_DESCRIPTION, Default: NULL |
object |
object to be written as a parquet file / arrow db |
path_to_parquet |
PARAM_DESCRIPTION, Default: NULL |
compression_level |
PARAM_DESCRIPTION, Default: "NULL" |
DETAILS
DETAILS
DETAILS
DETAILS
DETAILS
DETAILS
DETAILS
DETAILS
DETAILS
DETAILS
OUTPUT_DESCRIPTION
OUTPUT_DESCRIPTION
OUTPUT_DESCRIPTION
OUTPUT_DESCRIPTION
OUTPUT_DESCRIPTION
OUTPUT_DESCRIPTION
OUTPUT_DESCRIPTION
OUTPUT_DESCRIPTION
OUTPUT_DESCRIPTION
OUTPUT_DESCRIPTION
## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run)
## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run) ## Not run: if (interactive()) { # EXAMPLE1 } ## End(Not run)
Plot diagnostic plot to check bottles per timestamp
plot_bottles_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), lastDays = 7 )
plot_bottles_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), lastDays = 7 )
db |
fully qualified path to the sqlite database. Default, read from option |
lastDays |
last days for which to plot |
ggplot
object of the plot
Plot diagnostic plot to check number of species per timestamp
plot_density_species_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), transform_density_4throot = TRUE, measurement = "bemovi_mag_16", species_set_id = NULL )
plot_density_species_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), transform_density_4throot = TRUE, measurement = "bemovi_mag_16", species_set_id = NULL )
db |
fully qualified path to the sqlite database. Default, read from option |
transform_density_4throot |
if |
measurement |
the measurement to be plotted. If |
species_set_id |
name of the set of species |
ggplot
object of the plot
Plot diagnostic plot to check number of species per timestamp
plot_no_species_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite") )
plot_no_species_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite") )
db |
fully qualified path to the sqlite database. Default, read from option |
ggplot
object of the plot
Plot diagnostic plot to check number of species per timestamp
plot_o2s_per_bottle_per_timestamp(db = getOption("RRDdb", "LEEF.RRD.sqlite"))
plot_o2s_per_bottle_per_timestamp(db = getOption("RRDdb", "LEEF.RRD.sqlite"))
db |
fully qualified path to the sqlite database. Default, read from option |
ggplot
object of the plot
Plot diagnostic plot to check number of species per timestamp
plot_response_incubator(db = getOption("RRDdb", "LEEF.RRD.sqlite"))
plot_response_incubator(db = getOption("RRDdb", "LEEF.RRD.sqlite"))
db |
fully qualified path to the sqlite database. Default, read from option |
ggplot
object of the plot
Plot diagnostic plot to check species per timestamp per method
plot_species_per_timestamp_per_measure( db = getOption("RRDdb", "LEEF.RRD.sqlite") )
plot_species_per_timestamp_per_measure( db = getOption("RRDdb", "LEEF.RRD.sqlite") )
db |
fully qualified path to the sqlite database. Default, read from option |
ggplot
object of the plot
Plot diagnostic plot to check number of species per timestamp
plot_tocs_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), type = c("IC", "TC", "TN", "TOC") )
plot_tocs_per_bottle_per_timestamp( db = getOption("RRDdb", "LEEF.RRD.sqlite"), type = c("IC", "TC", "TN", "TOC") )
db |
fully qualified path to the sqlite database. Default, read from option |
type |
the type of the measurement which should be displayed. A vector with the types. Possible values are: "TOC", "TN", "IC", "TN", "". |
ggplot
object of the plot
This function adds the needed tables and creates the vuews needed for the analysis.
prepare_rrd( db = getOption("RRDdb", "LEEF.RRD.sqlite"), composition = NULL, experimetal_design = NULL, overwrite = FALSE )
prepare_rrd( db = getOption("RRDdb", "LEEF.RRD.sqlite"), composition = NULL, experimetal_design = NULL, overwrite = FALSE )
db |
fully qualified path to the sqlite database. Default, read from option |
composition |
fully qualified path to the |
experimetal_design |
fully qualified path to the |
overwrite |
if |
The function executes the provided sql statement and returns the resulting table0. For security, the database is opened in read-only mode.!
read_sql(db = getOption("RRDdb", "LEEF.RRD.sqlite"), sql)
read_sql(db = getOption("RRDdb", "LEEF.RRD.sqlite"), sql)
db |
fully qualified path to the sqlite database. Default, read from option |
sql |
sql statement |
the table resulting from the query as a data.frame
object.
Render a quarto file in a temporary directory and copy the resulting files back to the working directory
render_quarto_temp(input, output_format = "html", ...)
render_quarto_temp(input, output_format = "html", ...)
input |
the input qmd file |
output_format |
the output format |
... |
additional arguments for |
Report for checking pipeline and sampling
report_diagnostic( db, template = "LEEF_1", suffix = "", format = "html", lastDays = 7 )
report_diagnostic( db, template = "LEEF_1", suffix = "", format = "html", lastDays = 7 )
db |
fully qualified path to the sqlite database. The report will be saved to the same directory. |
template |
Template to be used for report. At the moment only |
suffix |
suffix for the file name |
format |
the format of the report as a character vector of length 1.
Supported are at the moment: |
lastDays |
number of last days to be included in graph 2. Default: 7 |
the fully qualified file name to the created report.
Report for checking pipeline and sampling
report_flowcytometer( timestamp = "20230106", extracted_base_dir = "~/Duck/LEEFSwift3/LEEF_2.archived.data/LEEF/3.archived.data/extracted/", leef = "LEEF-2", output_dir = ".", format = "html", browse = TRUE )
report_flowcytometer( timestamp = "20230106", extracted_base_dir = "~/Duck/LEEFSwift3/LEEF_2.archived.data/LEEF/3.archived.data/extracted/", leef = "LEEF-2", output_dir = ".", format = "html", browse = TRUE )
timestamp |
one or more timestamp to be plotted. If |
extracted_base_dir |
directory in which the extracted data can be found with filenames as in the archive |
leef |
LeEEF experiment, either |
output_dir |
output directory of the fil=nal report |
format |
the format of the report as a character vector of length 1.
Supported are at the moment: |
browse |
if |
the fully qualified file name to the created report.
Run interactive report
report_interactive(db)
report_interactive(db)
db |
fully qualified path to the sqlite database. The report will be saved to the same directory. |
invisibly NULL
The report needs to adapted to new classifications.
report_reclassification( reclassification_report = system.file(leef, "Reclassification_20220105.Rmd", package = "LEEF.analysis"), leef = "LEEF-1", output_dir = normalizePath(file.path("~", "Reclassification_20220105")), output_name = "Reclassification_20220105", format = "html" )
report_reclassification( reclassification_report = system.file(leef, "Reclassification_20220105.Rmd", package = "LEEF.analysis"), leef = "LEEF-1", output_dir = normalizePath(file.path("~", "Reclassification_20220105")), output_name = "Reclassification_20220105", format = "html" )
reclassification_report |
The name of the reclassification report. The default points to the first one. Included reclassification reports are:
|
leef |
LEEF study - allowed are |
output_dir |
directory of the output of the reclassification and the report |
output_name |
The name of the final report, without extension. |
format |
the format of the report as a character vector of length 1.
Supported are at the moment: |
the fully qualified file name to the created report.
Report for the sanity check of the data for submission to the pipeline
report_sanity_check(sample_dir, suffix = "", format = "html")
report_sanity_check(sample_dir, suffix = "", format = "html")
sample_dir |
root dir in which the folder |
suffix |
suffix for the file name |
format |
the format of the report as a character vector of length 1.
Supported are at the moment: |
the fully qualified file name to the created report.
Create indices in RRD database
RRD_create_indices(dbname, LEEF = NULL, continue_after_error = FALSE)
RRD_create_indices(dbname, LEEF = NULL, continue_after_error = FALSE)
dbname |
the path and name of the database. Must exist! |
either |
"LEEF-1" or "LEEF-2" |
contimue_after_error |
Do not quit execution of sql statements when error
occurs but continue. Use with caution! Default: |
Rename columns and species in the RRD
RRD_LEEF_1_rename(db = getOption("RRDdb", "LEEF.RRD.sqlite"))
RRD_LEEF_1_rename(db = getOption("RRDdb", "LEEF.RRD.sqlite"))
db |
fully qualified path to the sqlite database. Default, read from option |
Create a new database following the scheme used for the LEEF.RRD database
RRD_new(dbname, LEEF = NULL, DBIDriver = RSQLite::SQLite())
RRD_new(dbname, LEEF = NULL, DBIDriver = RSQLite::SQLite())
dbname |
the path and name of the database. Must not exist. |
DBIDriver |
the DBI driver to use. Default is RSQLite::SQLite() |
either |
"LEEF-1" or "LEEF-2" |
Executes onle test per method required.
sanity_check(sample_dir = ".")
sanity_check(sample_dir = ".")
sample_dir |
root dir in which the folder |
named list
object, with one element per method. If the test passed
for the method, the result is TRUE
, if it fails, a string indicating the
reason why it failed
Sanity check for bemovi.mag.16
sanity_check_bemovi.mag.16(sample_dir = ".")
sanity_check_bemovi.mag.16(sample_dir = ".")
sample_dir |
root dir in which the folder |
TRUE
if the test passed, a string indicating the error if it failed.
Sanity check for bemovi.mag.25
sanity_check_bemovi.mag.25(sample_dir = ".")
sanity_check_bemovi.mag.25(sample_dir = ".")
sample_dir |
root dir in which the folder |
TRUE
if the test passed, a string indicating the error if it failed.
Sanity check for flowcam
sanity_check_flowcam(sample_dir = ".")
sanity_check_flowcam(sample_dir = ".")
sample_dir |
root dir in which the folder |
TRUE
if the test passed, a string indicating the error if it failed.
Sanity check for flowcytometer
sanity_check_flowcytometer(sample_dir = ".")
sanity_check_flowcytometer(sample_dir = ".")
sample_dir |
root dir in which the folder |
TRUE
if the test passed, a string indicating the error if it failed.
Sanity check for 0.general.data
sanity_check_general.data(sample_dir = ".")
sanity_check_general.data(sample_dir = ".")
sample_dir |
root dir in which the folder |
TRUE
if the test passed, a string indicating the error if it failed.
Sanity check for manualcount
sanity_check_manualcount(sample_dir = ".")
sanity_check_manualcount(sample_dir = ".")
sample_dir |
root dir in which the folder |
TRUE
if the test passed, a string indicating the error if it failed.
Sanity check for o2meter
sanity_check_o2meter(sample_dir = ".")
sanity_check_o2meter(sample_dir = ".")
sample_dir |
root dir in which the folder |
TRUE
if the test passed, a string indicating the error if it failed.
sample_metadata.yml
fileExtract timestamp from sample_metadata.yml
file
sanity_get_timestamp(sample_dir = ".")
sanity_get_timestamp(sample_dir = ".")
sample_dir |
root dir in which the folder |
The extracted timestamp as a string
ADD DESCRIPTION
SetNotFoundSpeciesTo0( densities, mb, meas, exp_design, compositions, species.tracked )
SetNotFoundSpeciesTo0( densities, mb, meas, exp_design, compositions, species.tracked )
species.tracked |
Defines sets of species
species_set(species_set_id = NULL)
species_set(species_set_id = NULL)
species_set_id |
if |
Names of sets or the set itself
Gate and extract densities from flowcytometer data by using the archived data
traits_flowcytometer_archive( extracted_dir = "/Volumes/LEEF-1_archive/LEEF.archived.data/LEEF/3.archived.data/extracted/", gates_coordinates, timestamps, output, use_H, min_FSC.A, log10_all = FALSE, particles = c("bacteria", "algae"), mc.cores = 1 )
traits_flowcytometer_archive( extracted_dir = "/Volumes/LEEF-1_archive/LEEF.archived.data/LEEF/3.archived.data/extracted/", gates_coordinates, timestamps, output, use_H, min_FSC.A, log10_all = FALSE, particles = c("bacteria", "algae"), mc.cores = 1 )
extracted_dir |
srchive directory of the extracted data |
gates_coordinates |
the |
timestamps |
|
output |
path to which the classified data will be saved as |
use_H |
if |
min_FSC.A |
numeric. If |
log10_all |
if |
particles |
the particles, as defined in the gates file, to be extracted. Allowed are one or multiple of
|
mc.cores |
number of cores to be used. Defaults to 1 |
invisible NULL