fetch: Two generic functions to search for pipelines and...

Description Usage Arguments Details See Also Examples

View source: R/fetch.r

Description

These functions help in searching for specific files in the user's space.

fetch_pipes(): Fetches pipelines in the following places, in this specific order:

NOTE: If same pipeline is available in multiple places; intuitively, one from the later folder would be selected. As such, giving priority to user's home, and current working directories.

<br> fetch_conf(): Fetches configuration files in ALL of the following places:

NOTE: This function would greedily return all matching conf files. One would load all of them in the order returned by this function. If the same variable is repeated in multiple files, value from later files would replace those formerly defined. Thus ( as explained above ), giving priority to options defined in user's home and current working directories.

By default flowr loads, flowr.conf and ngsflows.conf. See the details sections, for more explanation on this.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
fetch(x, places, urls, verbose = opts_flow$get("verbose"))

fetch_pipes(
  x,
  places,
  last_only = FALSE,
  urls = opts_flow$get("flowr_pipe_urls"),
  silent = FALSE,
  verbose = opts_flow$get("verbose"),
  ask = TRUE
)

fetch_conf(x = "flowr.conf", places, ...)

Arguments

x

name of the file to search for (without extension). By default fetch_pipes and fetch_conf search for files ending with .R and .conf respectively.

places

places (paths) to look for files matching the name. Defaults are already defined in the function.

urls

urls to look for, works well for pipelines [not implemented yet]

verbose

A numeric value indicating the amount of messages to produce. Values are integers varying from 0, 1, 2, 3, .... Please refer to the verbose page for more details. opts_flow$get("verbose")

last_only

fetch_pipes():. If multiple pipelines match the pattern, return the last one. [TRUE]

silent

fetch_pipes(): logical, be silent even if no such pipeline is available. [FALSE]

ask

ask before downloading or copying. [not implemented]

...

[not implemented]

Details

For example flowr has a variable flow_run_path where it puts all the execution logs etc. The default value is picked up from the internal flowr.conf file. To redefine this value, one could create a new file called ~/flowr/conf/flowr.conf and add a line:

flow_run_path TAB my_awesome_path, where TAB is a tab character, since these are tab separated files.

Also, at any time you can run, opts_flow$load; to load custom options.

See Also

flowopts

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## let us find a default conf file
conf = fetch_conf("flowr.conf");conf
## load this
opts_flow$load(conf)

## this returns a list, which prints pretty
pip = fetch_pipes("sleep_pipe")
pip$name
pip$pipe
pip$def

sahilseth/flowr documentation built on March 20, 2021, 8:44 a.m.