-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.qmd
More file actions
161 lines (122 loc) · 5.52 KB
/
index.qmd
File metadata and controls
161 lines (122 loc) · 5.52 KB
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
---
title: Welcome to Viash!
search: true
engine: knitr
---
{{< include ../_includes/_clone_template.qmd >}}
**Viash** is your go-to script wrapper for building data pipelines from modular software components. All you need is your trusty script and a metadata file to embark on this journey.
Check out some of Viash's key features:
- Code in your [favorite scripting language](/guide/component/create-component.html). Mix and match scripting between multiple components to suit your needs. Viash supports a wide range of languages, including Bash, Python, R, Scala, JS, and C#.
- A **custom Docker container** is auto-generated based on the dependencies you've outlined in your metadata, meaning you don't need to be a Docker expert.
- Viash also generates a **Nextflow module** from your script, so no need to be a Nextflow guru either.
- Effortlessly combine Nextflow modules to design and run scalable, reproducible data pipelines.
- Test every component on your local workstation using the convenient built-in development kit.
## Requirements
This guide assumes you've already installed [Viash](/installation), [Docker](https://docs.docker.com/get-docker) and [Nextflow](https://www.nextflow.io/index.html#GetStarted).
## Quickstart example project
To get up and running fast, we provide a [template project](https://github.com/viash-io/viash_project_template) for you to use. It contains three components from the same package which are combined into a Nextflow pipeline as follows:
```{mermaid}
graph TD
input1(file1.tsv) --> B1[/remove_comments/] --> C1[/take_column/] --> Y
input2(file2.tsv)--> B2[/remove_comments/] --> C2[/take_column/] --> Y
Y[combine] --> D[/combine_columns/]
D --> output(output.tsv)
```
This pipeline takes one or more TSV files as input and stores its output in an output folder.
## Step 1: Get the template
First create a new repository by clicking the "Use this template" button. If you can't see the "Use this template" button, log into GitHub first.
Next, clone the repository using the following command.
```bash
git clone https://github.com/youruser/my_first_pipeline.git && cd my_first_pipeline
```
Your new repository should contain the following files:
```bash
tree my_first_pipeline
```
.
├── CHANGELOG.md
├── LICENSE.md
├── README.md
├── README.qmd
├── _viash.yaml
├── main.nf
├── resources_test
│ ├── file1.tsv
│ └── file2.tsv
└── src
└── template
├── combine_columns
│ ├── config.vsh.yaml
│ └── script.R
├── remove_comments
│ ├── config.vsh.yaml
│ ├── script.sh
│ └── test.sh
├── take_column
│ ├── config.vsh.yaml
│ └── script.py
└── workflow
├── config.vsh.yaml
├── main.nf
└── nextflow.config
## Step 2: Build the Viash components
With Viash you can turn the components in `src/` into (Dockerized) Nextflow modules by running:
```bash
viash ns build --setup cachedbuild --parallel
```
<details>
<summary>Output</summary>
```{bash echo=FALSE}
viash ns build --setup cachedbuild --parallel
```
</details>
This command not only transforms the Viash components in `src/` to Nextflow modules but it also builds the containers when appropriate (starting from the Docker cache when available using the `cachedbuild` argument). Once everything is built, a new **target** directory has been created containing the executables and modules grouped per platform:
```bash
ls -l
```
<details>
<summary>Output</summary>
```{bash echo=FALSE}
ls -l
```
</details>
## Step 3: Run the pipeline
Now run the pipeline with Nextflow:
```bash
nextflow run . \
-main-script target/nextflow/template/workflow/main.nf \
-with-docker \
--input resources_test/file*.tsv \
--publish_dir output
```
<details>
<summary>Output</summary>
```{bash echo=FALSE}
# avoid ansi log for proper static output using -ansi-log false
nextflow run . \
-ansi-log false \
-main-script target/nextflow/template/workflow/main.nf \
-with-docker \
--input resources_test/file*.tsv \
--publish_dir output
```
</details>
This will run the different stages of the workflow , with the final result result being stored in a file named **combined.workflow.output.tsv** in the output directory `output`:
```bash
cat output/combined.workflow.output.tsv
```
<details>
<summary>Output</summary>
```{bash echo=FALSE}
cat output/combined.workflow.output.tsv
```
</details>
## What's next?
Congratulations, you've reached the end of this quickstart tutorial, and we're excited for you to delve deeper into the world of Viash!
Our comprehensive [guide](/guide/) and [reference documentation](/reference/) is here to help you explore various topics, such as:
* [Creating a Viash component and converting it into a standalone executable](/guide/component/create-component.qmd)
* [Ensuring reproducibility and designing customised Docker images](/guide/component/add-dependencies.qmd)
* [Ensuring code reliability with unit testing for Viash](/guide/component/unit-testing.qmd)
* [Streamlining your workflow by performing batch operations on Viash projects](/guide/project/batch-processing.qmd)
* [Building Nextflow pipelines using Viash components](/guide/nextflow_vdsl3/index.qmd)
So, get ready to enhance your skills and create outstanding solutions with Viash!