addMeta: addMeta Add or change meta information for a cwl recipe.

View source: R/meta.R

metaR Documentation

addMeta Add or change meta information for a cwl recipe.

Description

addMeta Add or change meta information for a cwl recipe.

Usage

meta(cwl)

meta(cwl) <- value

addMeta(
  cwl,
  label = character(),
  doc = character(),
  inputLabels = character(),
  inputDocs = character(),
  outputLabels = character(),
  outputDocs = character(),
  stepLabels = character(),
  stepDocs = character(),
  extensions = list()
)

Arguments

cwl

'cwlProcess' object for data or tool recipe. 'cwlWorkflow' object for a pipeline recipe.

value

A list of meta information to add to 'cwl'.

label

Character string specifying a label for the recipe. E.g., "bwa align", "gencode annotation".

doc

Character string describing the recipe. E.g, "Align reads to reference genome".

inputLabels

Vector of character string, specifying labels for each input parameter.

inputDocs

Vector of character string as descriptions for each input parameter.

outputLabels

Vector of character string, specifying labels for each output parameter.

outputDocs

Vector of character string as descriptions for each output parameter.

stepLabels

Vector of character string, specifying labels for each step. Use only if 'cwl' is a 'cwlWorkflow' object.

stepDocs

Vector of character string as description for each step. Use only if 'cwl' is a 'cwlWorkflow' object.

extensions

A list of character strings. Can be used to add meta information about the recipe. Generally, add fields of information that does not require execution as part of the recipe evaluation. for information about "author", "url", "date", "example", use the exact names as list names as shown in examples, so that they can be correctly passed into corresponding fields in markdown file when using 'meta2md'. Other information can be added as a list element with arbitrary names.

Value

'meta()': return a list of all available meta information for the 'cwl' object.

'addMeta()': 'cwlProcess' or 'cwlWorkflow' object, with added meta information, which can be returned using 'meta(cwl)'. Meta information can be converted into markdown file with 'meta2md' function.

Examples

## Not run: 
library(RcwlPipelines)
cwlSearch(c("bwa", "align"))
bwaAlign <- RcwlPipelines::cwlLoad("pl_bwaAlign")
bwaAlign <- addMeta(
  cwl = bwaAlign,
  label = "align",
  doc = "align reads to reference genome",
  inputLabels = c("threads", "readgroup", "reference", "read1", "read2"),
  inputDocs = c("number of threads", "read groups",
                "reference genome", "read pair1", "read pair2"),
  outputLabels = c("Bam", "Idx"),
  outputDocs = c("outputbam file", "index file"),
  stepLabels = c(bwa = "bwa"),
  stepDocs = c(bwa = "bwa alignment"))
cat(meta2md(bwaAlign))

## End(Not run)

## Not run: 
rcp <- ReUseData::recipeLoad("gencode_annotation")
meta(rcp)
rcp1 <- addMeta(
  cwl = rcp,
  label = "",
  doc = "An empty description line", 
  inputLabels = c("input label1", "input label2"),
  inputDocs = c("input description 1", "input description 2"), 
  outputLabels = c("output label1"),
  outputDocs = c("output description 1"), 
  extensions = list(
    author = "recipe author's name",
    url = "http://ftp.ebi.ac.uk/pub/databases/gencode/",
    date = as.character(Sys.Date()),
    example = "An example"))
meta(rcp1)
cat(meta2md(rcp1))

## End(Not run)

hubentu/Rcwl documentation built on May 9, 2024, 2:14 a.m.