isa_node_add: Add or remove nodes and properties

Description Usage Arguments Details Value See Also Examples

View source: R/isatools.R

Description

Add or remove nodes and properties

Usage

1
2
3
4
5
6
7
isa_node_add(x, node, columns = NULL, after_node = NULL)

isa_node_rm(x, node_id)

isa_property_add(x, property, values = NA, node_id = NULL, after_id = NULL)

isa_property_rm(x, prop_ids = NULL)

Arguments

x

isatab object

node

new node identifier (e.g. 'Sample Name')

columns

(optional) character vector with columns to add

after_node

ID of the node after which the current node should be inserted

node_id

ID of the node in which to add the property (default: last node in the isatab).

property

Character vector with identifiers (such as 'Comment[Important]') of the properties to be inserted

values

vector (if only one property is added) or data frame (if multiple properties are added) of values used to initialize the node / parameter. If multiple properties are added with one call (the length of the property vector is greater than one), and values is a data frame, than it has to have sufficient number of columns corresponding to the property vector.

after_id

ID of the property after which the parameter should be inserted (deault: last property)

prop_ids

IDs of the properties to be removed

Details

These functions manipulate the structure of an isatab. isa_node_add and isa_node_rm add or remove whole nodes.

To add or remove properties (individual columns which are not nodes) belonging to a given node, use isa_property_add and isa_property_rm.

Adding and removing nodes is easier using brackets / subscripts. Read the documentation for isatab for details.

Note: IDs are a thing internal to this R package. They are not imported from or exported to actual ISA-tab files. However, given that the node 'identifiers' (e.g. 'Sample Name') can be ambiguous, IDs are necessary to unambiguously identify a node.

Value

These functions return an object of isatab-class.

See Also

isatab

Examples

1
2
3
4
5
file <- system.file('extdata', 's_isatab.txt', package='isaeditor')
isa_s <- read_isa(file)
isa_s <- isa_node_add(isa_s, 'Library Name', columns='Comment[Raw File]')
isa_nodes(isa_s)
isa_s <- isa_property_add(isa_s, 'Characteristics[Age]', values=c(75, 38, 43), node_id='ID1')

isaeditor documentation built on Sept. 29, 2021, 9:08 a.m.