dispatch_regex_search: Generic dispatcher to hunt down useful information from logs.

View source: R/metadata.R

dispatch_regex_searchR Documentation

Description

Given the metadata, a couple of regular expressions, and a filename specification, this should be able to pull out the interesting number(s) from one logfile per sample from the metadata.

Usage

dispatch_regex_search(
  meta,
  search,
  replace,
  input_file_spec,
  species = "*",
  basedir = "preprocessing",
  extraction = "\\1",
  which = "first",
  as = NULL,
  verbose = FALSE,
  type = "genome",
  ...
)

Arguments

meta

Input metadata.

search

regex used to go hunting for the line of interest.

replace

probably the same regex with parentheses in place for gsub().

input_file_spec

filename extractor expression.

species

Specify a species or glob it.

basedir

Root directory containing the files/logs of metadata.

extraction

the replacement portion of gsub(). I am thinking to make it possible to have this function return more interesting outputs if this changes, but for the moment I am sort of assuming \1 will always suffice.

which

Usually 'first', which means grab the first match and get out.

as

Coerce the output to a specific data type (numeric/character/etc).

verbose

For testing regexes.

type

Make explicit the type of data (genome/rRNA/Tx/etc).

...

Used to pass extra variables to glue for finding files.


elsayed-lab/hpgltools documentation built on May 9, 2024, 5:02 a.m.