Class for isatab assay and study objects
# S3 method for isatab
dim(x)# S3 method for isatab
print(x, ...)
# S3 method for isatab
as.data.frame(x, ...)
# S3 method for isatab
as_tibble(x, ...)
# S3 method for isatab
n_row(x)
# S3 method for isatab
summary(object, ...)
# S3 method for isatab
[(x, node, property = NULL, new = FALSE, n = NA, after_id = NULL) <- value
# S3 method for isatab
[(x, node, property = NULL, n = NA)
# S3 method for isatab
[[(x, col_id) <- value
# S3 method for isatab
[[(x, col_id)
object of class isatab
any further arguments are ignored
object of class isatab
node column (e.g. 'Sample Name')
property column (e.g. 'Performer')
force creating a new node even if there is already a node with such an identifier
instance of the node identifier (if there are multiple identical node identifiers in the isatab, for example multiple 'Extract Name' nodes).
ID of an existing column. If a column (node or property) needs to be created, after_id can be used to specify after which node / column the new column will be inserted.
vector or data frame with values which will be inserted into the isatab at the specified column.
Column ID (e.g. 'ID34')
An object of isatab-class
is a list containing three elements:
isa_stru
, a data frame holding the meta-data
contents
, a data frame holding the data
type
, the type of the isatab
component (study, investigation,
assay).
Objects of this class are generated usually by reading a file with
read_isa()
.
Internally, it is a list containing as elements a data frame (tibble)
describing the structure of the isa tab (isa_stru
) and a data frame
(tibble) containing the actual data.
ISA-tab nodes (such as 'Source Name', 'Sample Name', 'Protocol REF',
'Extract Name' or 'Library Name') can have properties. Both are represented as
columns. In the ISA-tab specificiation, node designators such as
'Sample Name' are called identifiers, although they need not be unique.
IDs are internal identifiers of the package isaeditor
; they are unique
to a column. Some functions in isaeditor
can access ISA-tab columns
using node / property combination; some other require the internal ID.
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.
There are two ways of accessing a column: by using the [
function to
select a node identifier
(e.g. 'Protocol REF') and, optionally, a property identifier (e.g.
'Performer'), or by using the [[
function to select column IDs. The former has the disadvantage that
multiple identical node / property identifier combinations may exist,
and it may be necessary to specify which node is meant:
isa_a <- read_isa('a_isatab.txt') isa_a[ 'Sample Name' ] isa_a[ 'Protocol REF', 'Performer' ] ## 3rd instance of the combination Protocol REF / Performer isa_a[ 'Protocol REF', 'Performer', n=3 ] isa_a[ 'Protocol REF', 'Performer', n=3 ] <- 'Rosalind Franklin'
Assigning a NULL value to a selected node is equivalent to removing this node and all its properties.
Assigning a NULL value to a property is equivalent with removing this property.
Using column IDs with the [[
function is not ambiguous, but column IDs are a trick
used by the package isaeditor
and are not exported or read from an
actual ISA-tab. To view the column IDs, simply print the isatab object to the
screen or inspect the isa_stru
element of the object:
isa_s <- read_isa('s_isatab.txt') isa_s isa_s$isa_stru isa_s[['ID21']] isa_s[['ID21']] <- 'Rosalind Franklin'
Both [
and [[
return a vector if a single column is specified and a data
frame if more than one column is selected.
Nodes and properties can either be created with isa_node_add()
and
isa_property_add()
or with assigning a value to a new node with [<-
:
isa_a['Test Node'] <- c(1, 2, 3) isa_a['Test Node', 'Test Property'] <- 5:7
In the above code, first the node Test Node
was created and filled
with values 1:3, and then the property Test Property
was created and
filled with 5:7. This can be shortened by assigning a data frame in one
step:
isa_a['Test Node', 'Test Property'] <- data.frame(1:3, 5:7)
A column ID can be specified to insert the node at a position relative to another node, or the property at a position relative to another property:
isa_a[ 'Test Node', after_id='ID1' ] <- 1:3
Removing nodes and properties works by assigning NULL
to either a node
(in which case all node properties will be removed as well) or a
property.
# remove only one property isa_a['Test Node', 'Test Property'] <- NULL # remove node and its properties isa_a['Test Node'] <- NULL