Base class for all nemo tools.
Public fields
name(
character(1))
Name of tool.path(
character(1))
Output directory of tool.config(
Config())
Config of tool.files(
tibble())
Tibble of files matching available Tool patterns.tbls(
tibble())
Tibble of tidy tibbles.raw_schemas_all(
tibble())
All raw schemas for tool.tidy_schemas_all(
tibble())
All tidy schemas for tool.get_tidy_schema(
function())
Get specific tidy schema.get_raw_schema(
function())
Get specific raw schema.files_tbl(
tibble(n))
Tibble of files fromlist_files_dir().
Methods
Method new()
Create a new Tool object.
Usage
Tool$new(name = NULL, pkg = NULL, path = NULL, files_tbl = NULL)Arguments
name(
character(1))
Name of tool.pkg(
character(1))
Package name tool belongs to (for config lookup).path(
character(1))
Output directory of tool. Iffiles_tblis supplied, this basically gets ignored.files_tbl(
tibble(n))
Tibble of files fromlist_files_dir().
Method print()
Print details about the Tool.
Method list_files()
List files in given tool directory.
Arguments
type(
character(1))
File type(s) to return (e.g. any, file, directory, symlink). Seefs::dir_info.
Method .parse_file()
Parse file.
Arguments
x(
character(1))
File path.name(
character(1))
Parser name (e.g. "breakends" - see docs).delim(
character(1))
File delimiter....Passed on to
readr::read_delim.
Method .tidy_file()
Tidy file.
Method .parse_file_keyvalue()
Parse files with no header and two columns representing key-value pairs.
Arguments
x(
character(1))
File path.name(
character(1))
Parser name (e.g. "qc" - see docs).delim(
character(1))
File delimiter....Passed on to
readr::read_delim.
Method .parse_file_nohead()
Parse headless file.
Arguments
x(
character(1))
File path.pname(
character(1))
Parser name (e.g. "breakends" - see docs).delim(
character(1))
File delimiter....Passed on to
readr::read_delim.
Method .eval_func()
Evaluate function in the context of the Tool's environment.
Arguments
fun(
character(1))
Function from Tool to evaluate.envir(
environment())
Environment to evaluate the function within.
Method tidy()
Tidy a list of files.
Method write()
Write tidy tibbles.
Usage
Tool$write(
diro = ".",
format = "tsv",
input_id = NULL,
output_id = ulid::ulid(),
dbconn = NULL
)Arguments
diro(
character(1))
Directory path to output tidy files. Ignored if format is db.format(
character(1))
Format of output.input_id(
character(1))
Input ID to use for the dataset (e.g.run123).output_id(
character(1))
Output ID to use for the dataset (e.g.run123).dbconn(
DBIConnection)
Database connection object (seeDBI::dbConnect).
Method nemofy()
Parse, filter, tidy and write files.
Usage
Tool$nemofy(
diro = ".",
format = "tsv",
input_id = NULL,
output_id = ulid::ulid(),
dbconn = NULL,
include = NULL,
exclude = NULL
)Arguments
diro(
character(1))
Directory path to output tidy files.format(
character(1))
Format of output.input_id(
character(1))
Input ID to use for the dataset (e.g.run123).output_id(
character(1))
Output ID to use for the dataset (e.g.run123).dbconn(
DBIConnection)
Database connection object (seeDBI::dbConnect).include(
character(n))
Files to include.exclude(
character(n))
Files to exclude.
Examples
if (FALSE) { # \dontrun{
path <- here::here("inst/extdata/tool1")
# demo filter + tidy
x <- Tool1$new(path = path)$
filter_files(exclude = "alignments_dupfreq")$
tidy(keep_raw = TRUE)
x$tbls
x$files
x$list_files()
lx <- Linx$new(path)
dbconn <- DBI::dbConnect(
drv = RPostgres::Postgres(),
dbname = "nemo",
user = "orcabus"
)
lx$nemofy(
diro = "nogit/test_data",
format = "db", # "parquet",
id = "run2",
dbconn = dbconn,
include = NULL,
exclude = NULL
)
DBI::dbDisconnect(dbconn)
} # }
