-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
211 lines (159 loc) Β· 5.85 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
---
output:
github_document:
toc: true
---
<!-- 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%"
)
knitr::knit_hooks$set(
prompt = function(before, options, envir) {
options(prompt = if (options$engine %in% c("sh", "bash")) "$ " else "R> ")
}
)
```
```{r pkg_load, warning=FALSE, message=FALSE, echo=FALSE}
require(dracarys)
```
# π₯ dracarys - UMCCR Workflow Tidying
![](https://emojis.slackmojis.com/emojis/images/1643515659/16823/flying_dragon.gif?1643515659 "Dragon Flying")
- Docs: <https://umccr.github.io/dracarys/>
[![Conda install](https://anaconda.org/umccr/r-dracarys/badges/version.svg)](https://anaconda.org/umccr/r-dracarys)
[![Conda install](https://anaconda.org/umccr/r-dracarys/badges/latest_release_date.svg)](https://anaconda.org/umccr/r-dracarys)
## π Aim
Given a directory with results from a DRAGEN/UMCCR workflow,
{dracarys} will grab files of interest and transform them into 'tidier'
structures for output into TSV/Parquet/RDS format for downstream ingestion
into a database/data lake.
See supported [workflows](#supported-workflows), [running](#running) examples,
and [CLI](#cli) options in the sections below.
## π Installation
<details>
<summary>R</summary>
```r
remotes::install_github("umccr/[email protected]") # for vX.X.X Release/Tag
```
</details>
<details>
<summary>Conda</summary>
- Linux & MacOS (non-M1)
```bash
mamba create \
-n dracarys_env \
-c umccr -c bioconda -c conda-forge \
r-dracarys==X.X.X
conda activate dracarys_env
```
- MacOS M1
```bash
CONDA_SUBDIR=osx-64 \
mamba create \
-n dracarys_env \
-c umccr -c bioconda -c conda-forge \
r-dracarys==X.X.X
conda activate dracarys_env
```
</details>
<details>
<summary>Docker</summary>
```bash
docker pull --platform linux/amd64 ghcr.io/umccr/dracarys:X.X.X
```
</details>
<a name="supported-workflows"></a>
## β¨ Supported Workflows
{dracarys} supports most outputs from the following DRAGEN/UMCCR workflows:
| Workflow | Description |
|------------|-------------|
| bcl_convert | [BCLConvert][bclconvert-web] workflow |
| tso_ctdna_tumor_only | [ctDNA TSO500][cttso-web] workflow |
| wgs_alignment_qc | [DRAGEN DNA][dragen-web] (alignment) workflow |
| wts_alignment_qc | [DRAGEN RNA][dragen-web] (alignment) workflow |
| wts_tumor_only | [DRAGEN RNA][dragen-web] workflow |
| wgs_tumor_normal | [DRAGEN Tumor/Normal][dragen-web] workflow |
| umccrise | [umccrise][umccrise-web] workflow |
| rnasum | [RNAsum][rnasum-web] workflow |
| sash | [sash][sash-web] workflow |
| oncoanalyser | [oncoanalyser][oa-web] workflow |
[dragen-web]: <https://support-docs.illumina.com/SW/DRAGEN_v40/Content/SW/DRAGEN/GPipelineIntro_fDG.htm>
[cttso-web]: <https://support-docs.illumina.com/SW/DRAGEN_TSO500_ctDNA_v2.1/Content/SW/TSO500/WorkflowDiagram_appT500ctDNAlocal.htm>
[umccrise-web]: <https://github.com/umccr/umccrise>
[rnasum-web]: <https://github.com/umccr/RNAsum>
[sash-web]: <https://github.com/scwatts/sash>
[oa-web]: <https://github.com/nf-core/oncoanalyser>
[bclconvert-web]: <https://emea.support.illumina.com/sequencing/sequencing_software/bcl-convert.html>
See which output files from these workflows are supported in
[Supported Files](https://umccr.github.io/dracarys/articles/files.html).
<a name="cli"></a>
## π CLI
A `dracarys.R` command line interface is available for convenience.
- If you're using the conda package, the `dracarys.R` command will already be
available inside the activated conda environment.
- If you're _not_ using the conda package, you need to export the
`dracarys/inst/cli/` directory to your `PATH` in order to use `dracarys.R`.
```{bash eval=FALSE, echo=TRUE}
dracarys_cli=$(Rscript -e 'x = system.file("cli", package = "dracarys"); cat(x, "\n")' | xargs)
export PATH="${dracarys_cli}:${PATH}"
```
```{bash prompt=TRUE, echo=FALSE}
dracarys_cli=$(Rscript -e 'x = system.file("cli", package = "dracarys"); cat(x, "\n")' | xargs)
export PATH="${dracarys_cli}:${PATH}"
echo "dracarys.R --version" & dracarys.R --version
echo ""
echo "#-----------------------------------#"
echo "dracarys.R --help" & dracarys.R --help
echo ""
echo "#-----------------------------------#"
echo "#------- Tidy ----------------------#"
echo "dracarys.R tidy --help" & dracarys.R tidy --help
echo ""
```
<a name="running"></a>
## π Running
{dracarys} takes as input (`--in_dir`) a directory with results from one of the
UMCCR [workflows](#supported-workflows). It will recursively scan that directory
for [supported files](https://umccr.github.io/dracarys/articles/files.html),
download those into a local directory (`--gds_local_dir`), and then it will
parse, transform and write the tidied versions into the specified output
directory (`--out_dir`). A prefix (`--prefix`) is prepended to each of the tidied
files. The output file format (`--format`) can be tsv, parquet, or both.
To get just a list of supported files within the specified input directory, use
the `-n (--dryrun)` option.
<details><summary>R</summary>
```{r eval=FALSE}
# help(umccr_tidy)
in_dir <- "gds://path/to/subjectX_multiqc_data/"
out_dir <- tempdir()
prefix <- "subjectX"
umccr_tidy(in_dir = in_dir, out_dir = out_dir, prefix = prefix)
```
</details>
<details><summary>Mac/Linux</summary>
From within an activated conda environment or a shell with the `dracarys.R`
CLI available:
```bash
dracarys.R tidy \
-i gds://path/to/subjectX_multiqc_data/ \
-o local_output_dir \
-p subjectX_prefix
```
</details>
<details><summary>Docker</summary>
```bash
docker container run \
-v $(PWD):/mount1 \
--platform=linux/amd64 \
--env "ICA_ACCESS_TOKEN" \
--rm -it \
ghcr.io/umccr/dracarys:X.X.X \
dracarys.R tidy \
-i gds://path/to/subjectX_multiqc_data/ \
-o /mount1/output_dir \
-p subjectX_prefix
```
</details>