-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
92 lines (66 loc) · 2 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# isaeditor
<!-- badges: start -->
<!-- badges: start -->
[![R-CMD-check](https://github.com/bihealth/isaeditor/workflows/R-CMD-check/badge.svg)](https://github.com/bihealth/isaeditor/actions)
<!-- badges: end -->
<!-- badges: end -->
isaeditor is a collection of helper functions for modifying and displaying
[ISA-Tab](https://isa-tools.org/) files.
## Installation
You can install the released version of isaeditor from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("isaeditor")
```
And the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("bihealth/isaeditor")
```
## Basic usage
### Reading ISA-Tabs
Use the `read_isa()` function:
```{r}
library(isaeditor)
file <- system.file('extdata', 's_isatab.txt', package='isaeditor')
isa_s <- read_isa(file)
dim(isa_s)
class(isa_s)
summary(isa_s)
print(isa_s)
```
You can directly modify the isatab object almost as simply as you would do
it with a data frame:
```{r}
## access a node
isa_s[ "New Node" ] <- c("em", "pstrem", "bzdrem")
## create a property of the new node
isa_s[ "New Node", "Characteristics[Replicate]" ] <- 1:3
## remove the node and all its properties
isa_s[ "New Node" ] <- NULL
```
Unfortunately, multiple nodes with the same label may exist according to
the ISA-Tab specifications. Sometimes it is therefore necessary to indicate
which of these nodes we mean. There are several ways to do it in
`isaeditor`, two of them are shown here:
```{r}
file <- system.file('extdata', 'a_isatab.txt', package='isaeditor')
isa_a <- read_isa(file)
## use the internal ID to access the node
## you can also use isa_ID_find for that
isa_nodes(isa_a)
isa_a[['ID34']]
## specify which of the nodes
isa_a[ "Extract Name", n=2 ]
```