Title: | A set of internal tools for managing high-throughput assay data at NEB |
---|---|
Description: | What the package does (one paragraph). |
Authors: | Eric Hunt [aut, cre] |
Maintainer: | Eric Hunt <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-08 04:57:59 UTC |
Source: | https://github.com/eric-hunt/htce |
Retrieve a well_id from barcode and address strings
address_to_well_id( barcode, address, .db_loc = "./htCE.duckdb", .db_con = NULL, .pg_load = FALSE )
address_to_well_id( barcode, address, .db_loc = "./htCE.duckdb", .db_con = NULL, .pg_load = FALSE )
barcode |
A string - the unique barcode identifying the physical plate |
address |
A string - the well identifier (e.g. A1, H12, etc.) |
.db_loc |
A string - local path to the DuckDB file; passed to |
.db_con |
A valid DBIConnection object; passed to |
.pg_load |
A Boolean - use the DuckDB Postgres extension?; passed to |
A double value representing the well_id
integer primary key which corresponds to the barcode and address arguments
Retrieve a plate_id from a barcode string
barcode_to_plate_id( barcode, .db_loc = "./htCE.duckdb", .db_con = NULL, .pg_load = FALSE )
barcode_to_plate_id( barcode, .db_loc = "./htCE.duckdb", .db_con = NULL, .pg_load = FALSE )
barcode |
A string - the unique barcode identifying the physical plate |
.db_loc |
A string - local path to the DuckDB file; passed to |
.db_con |
A valid DBIConnection object; passed to |
.pg_load |
A Boolean - use the DuckDB Postgres extension?; passed to |
A double value representing the plate_id
integer primary key which corresponds to the barcode argument
Return the number of lines in a file
count_newlines(path, remove_header = TRUE, ignore_trailing = TRUE)
count_newlines(path, remove_header = TRUE, ignore_trailing = TRUE)
path |
A string - path to file |
remove_header |
A Boolean - should the first row be ignored? |
ignore_trailing |
A Boolean - should a trailing '\n' be ignored? |
An integer - the number of lines in the file
Execute or collect results from a query to a DuckDB database.
dkdb_execute( query_string, ..., .quiet = TRUE, .db_loc = "./htCE.duckdb", .db_con = NULL, .pg_install = FALSE, .pg_load = FALSE ) dkdb_collect( query_string, ..., .quiet = TRUE, .db_loc = "./htCE.duckdb", .db_con = NULL, .pg_install = FALSE, .pg_load = FALSE, .return = NULL )
dkdb_execute( query_string, ..., .quiet = TRUE, .db_loc = "./htCE.duckdb", .db_con = NULL, .pg_install = FALSE, .pg_load = FALSE ) dkdb_collect( query_string, ..., .quiet = TRUE, .db_loc = "./htCE.duckdb", .db_con = NULL, .pg_install = FALSE, .pg_load = FALSE, .return = NULL )
query_string |
A string - SQL query |
... |
Key-value pairs - additional injected values passed to |
.quiet |
A Boolean - suppress console messages? |
.db_loc |
A string - local path to the DuckDB file |
.db_con |
A valid DBIConnection object |
.pg_install |
A Boolean - install the DuckDB Postgres extension? |
.pg_load |
A Boolean - use the DuckDB Postgres extension? |
.return |
A string - how collected data should be returned, default is a |
dkdb_execute
executes a query without collecting results.
dkdb_collect
collects the results from a query and returns them as a tibble
.
A data.frame
(default), tibble
, or data.table
containing the collected query results
id
or a Boolean value indicating if it already existsLookup something by a set of attributes and return the id
or a Boolean value indicating if it already exists
dkdb_lookup( ..., .table = NULL, .return = "id", .db_loc = "./htCE.duckdb", .db_con = NULL, .pg_load = FALSE )
dkdb_lookup( ..., .table = NULL, .return = "id", .db_loc = "./htCE.duckdb", .db_con = NULL, .pg_load = FALSE )
... |
Key-value pairs - unique set of injected arguments (using |
.table |
A string - the table to query in the database schema |
.return |
A string - should the returned value be a |
.db_loc |
A string - local path to the DuckDB file; passed to |
.db_con |
A valid DBIConnection object; passed to |
.pg_load |
A Boolean - use the DuckDB Postgres extension?; passed to |
A primary key id
as a double (.return = "id") or a Boolean value returned from an EXISTS
operator subquery (.return = "exixts")
Title
existing_barcodes( source_only = FALSE, .table = "plates", .db_loc = "./htCE.duckdb", .db_con = NULL )
existing_barcodes( source_only = FALSE, .table = "plates", .db_loc = "./htCE.duckdb", .db_con = NULL )
source_only |
A Boolean - only retrieve source plate barcodes |
.table |
A string - the database table to query ( |
.db_loc |
A string - local path to the DuckDB file; passed to |
.db_con |
A valid DBIConnection object; passed to |
A named character vector of barcodes that exist in the database
Returns a named list of skip values for importing Echo transfer report metadata and transfer data.
find_skips(file_path)
find_skips(file_path)
file_path |
A string - the path to the .csv delimited file to read |
A named list of skip values to use during Echo transfer report import
Creates tab-delimited files for submitting CE plates to the NEB sequencing core via the LIMS system.
make_submission_files( initials = "EH", datetime = NULL, plate_code = 5, num_wells = 96, num_plates = 12, dest_dir = NULL, .pad_well_num = FALSE )
make_submission_files( initials = "EH", datetime = NULL, plate_code = 5, num_wells = 96, num_plates = 12, dest_dir = NULL, .pad_well_num = FALSE )
initials |
A string - your initials |
datetime |
A date - use |
plate_code |
An integer - a code representing the type of plate |
num_wells |
An integer - 96 or 384, the number of wells on the submission plate |
num_plates |
An integer - the number of plate submission files to create |
dest_dir |
A string - the directory to create the tab-delimited submission files |
.pad_well_num |
A Boolean - passed to |
Create a vector of well addresses
make_well_order(num_wells, pad = FALSE)
make_well_order(num_wells, pad = FALSE)
num_wells |
An integer - the number of wells in the plate format (96 or 384) |
pad |
A Boolelan - whether or not to pad the column numbers with zeros (e.g. A1 vs. A01) |
A character vector of well addresses in top to bottom, left to right order (e.g. for 96 wells, A1 -> H1, A2...H11, A12 -> H12)
Title
new_fatools_matrix(m = matrix())
new_fatools_matrix(m = matrix())
m |
Title
## S3 method for class 'fatools_matrix' tidy(x, ...)
## S3 method for class 'fatools_matrix' tidy(x, ...)
x |
DuckDB connection handling à la withr::local_db_connection
.
with_duckdb_connection( db_file_path, read_only = FALSE, .local_envir = parent.frame() )
with_duckdb_connection( db_file_path, read_only = FALSE, .local_envir = parent.frame() )
db_file_path |
a string - path to a DuckDB file |
read_only |
a Boolean - passed to |
.local_envir |
an environment - passed to |
A database connection of class DBIConnection.
DBI::dbConnect()
, withr::defer()
, withr::local_db_connection()
,
duckdb/duckdb#5525