designFile: Process interface's design file

View source: R/designFile.R

designFileR Documentation

Process interface's design file

Description

This function is a slave for generic.process. It process a design file and returns its processed elements as a list.

Usage

  designFile(fileName)

Arguments

fileName

Single character value, the path and name of a design file to process.

Details

Design files are text file split in multiple sections. Each section starts with a "[NAME]" line and ends when the next section begins. Lines starting with a # sign are ignored, as well as blank lines.

Standard sections refer to an existing R function (the section name is expected to match the function name in a case-sensitive manner), each line in the section setting an argument to call this function : the first value is the argument name, then after a tabulation come one or many values separated by tabulations. Multiple values will be aggregated into a vector, and type.convert will try to guess the correct type.

One or many modifiers can be added in the section name after the function name followed by the : sign and separated by commas (e.g. file.remove:first,nowarn). Modifiers have the following effects :

first

The function will be called only once, while processing the first .fsa file.

last

The function will be called only once, while processing the last .fsa file.

nowarn

The function will be embedded inside suppressWarnings to silently ignore warnings.

$NAME and @NAME can be used while setting an argument to refer to global variable NAME. Use $ reference for character variables, which will be replaced with gsub and can thus be combined (e.g. $NAME.txt). Use @ reference to obtain the raw R variable, regardless of its type. Default globals are :

FILE_PATH

The full name and path of the .fsa file currently considered in the loop.

FILE_DIR

The parent directory of the .fsa file currently considered in the loop.

FILE_NAME

The base name (without path) of the .fsa file currently considered in the loop.

OBJECT

The last object of class 'fsa' returned by any function called in the pipeline.

OUTPUT_PATH

The full name and path defined by output while calling generic.process.

OUTPUT_DIR

The parent directory of output while calling generic.process.

OUTPUT_NAME

The base name (without path) defined by output while calling generic.process.

Sections with full uppercase names (only letters and _ are allowed) will define a new global variable with matching name. The global will be a named list, each line in the section defining a vector (the first value being the name for the vector in the list). The table modifier can be used while defining globals (e.g. PEAKS:table), to request instead the section to be parsed as a TSV file (one row in the section is one row in the table, columns are separated by tabulations, see read.table). The first row will be used as column names and the first column as row names.

A DESIGN global ([DESIGN] section) is strongly recommended to keep design file self-explained, the following elements are suggested :

author

The name of the design author (for human readers only).

purpose

The description of the design (for human readers only).

FSAtools

Version of the FSAtools package for which the design was created (separated with dots).

updated

Date of the last design update (YYYY-MM-DD).

Please refer to the two provided working examples to help building your own designs. Full processing with the examples are described in generic.process examples section, direct access to the example design files is shown below.

Value

Returns a multi-level list, with a direct children per function to call and an extra GLOBALS element.

Children are named according to the function to call, thus multiple children can have the same name.

Author(s)

Sylvain Mareschal

See Also

generic.process, generic.interface

Examples

  # Example file provided
  file <- system.file("extdata/design_GEP.conf", package="FSAtools")
  design <- designFile(file)
  
  # Alignment rescue design provided
  file <- system.file("extdata/design_SNP.conf", package="FSAtools")
  design <- designFile(file)

FSAtools documentation built on Aug. 19, 2023, 1:06 a.m.