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 belong 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_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.
Arguments
odir(
character(1))
Directory path to output tidy files. Ignored if format is db.format(
character(1))
Format of output files.id(
character(1))
ID to use for the dataset (e.g.wfrid.123,prid.456).dbconn(
DBIConnection)
Database connection object (seeDBI::dbConnect).
Method nemofy()
Parse, filter, tidy and write files.
Usage
Tool$nemofy(
odir = ".",
format = "tsv",
id = NULL,
dbconn = NULL,
include = NULL,
exclude = NULL
)Arguments
odir(
character(1))
Directory path to output tidy files.format(
character(1))
Format of output files.id(
character(1))
ID to use for the dataset (e.g.wfrid.123,prid.456).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")
x <- Tool$new("tool1", pkg = "nemo", path = path)
# demo filter + tidy
x <- Tool1$new(path = path)$
filter_files(exclude = "alignments_dupfreq")$
tidy(keep_raw = TRUE)
a$tbls
a$files
a$list_files()
lx <- Linx$new(path)
dbconn <- DBI::dbConnect(
drv = RPostgres::Postgres(),
dbname = "nemo",
user = "orcabus"
)
lx$nemofy(
odir = "nogit/test_data",
format = "db", # "parquet",
id = "run2",
dbconn = dbconn,
include = NULL,
exclude = NULL
)
DBI::dbDisconnect(dbconn)
} # }
