designFile | R Documentation |
This function is a slave for generic.process
. It process a design file and returns its processed elements as a list.
designFile(fileName)
fileName |
Single character value, the path and name of a design file to process. |
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 :
The function will be called only once, while processing the first .fsa file.
The function will be called only once, while processing the last .fsa file.
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 :
The full name and path of the .fsa file currently considered in the loop.
The parent directory of the .fsa file currently considered in the loop.
The base name (without path) of the .fsa file currently considered in the loop.
The last object of class 'fsa' returned by any function called in the pipeline.
The full name and path defined by output
while calling generic.process
.
The parent directory of output
while calling generic.process
.
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 :
The name of the design author (for human readers only).
The description of the design (for human readers only).
Version of the FSAtools package for which the design was created (separated with dots).
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.
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.
Sylvain Mareschal
generic.process
, generic.interface
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.