Skip to content

Commit 217fbb8

Browse files
committed
add images, fix toc, fix meta.id
1 parent d170390 commit 217fbb8

9 files changed

+62
-134
lines changed

README.md

+31-100
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ primary focus of the library is to provide pre-built processes and processing se
1818
technologies and made easily available to pipeline's developers through the `nf-core`
1919
framework.
2020

21-
# WHY ? `nf-neuro`
21+
# WHY ? `nf-neuro`<!-- omit in toc -->
2222

2323
**Let's say you develop a pipeline for neuroimaging**. You want to make it the more _efficient,_
2424
_reliable, reproducible_ and also be able to _evaluate it_ and _control the quality_ of its outputs.
@@ -30,7 +30,7 @@ closely aligned with [nf-core](), but we'll make you adapt to them slowly as you
3030
haven't finished complying to all of them ourselves). Using `nf-neuro` helps accelerate
3131
development in **neuroimaging** and produces better research outcomes for all !
3232

33-
# Where do I start ?
33+
# Where do I start ?<!-- omit in toc -->
3434

3535
Well, it depends on what you want to do. If you want to :
3636

@@ -46,7 +46,6 @@ Well, it depends on what you want to do. If you want to :
4646

4747
- [Discovering `nf-neuro`](#discovering-nf-neuro)
4848
- [Getting info on components from `nf-neuro`](#getting-info-on-components-from-nf-neuro)
49-
- [Using the information from the `info` command](#using-the-information-from-the-info-command)
5049
- [Pipeline creation with `nf-neuro`](#pipeline-creation-with-nf-neuro)
5150
- [Prototyping using components from `nf-neuro`](#prototyping-using-components-from-nf-neuro)
5251
- [Porting prototypes to `nf-` ready pipelines](#porting-prototypes-to-nf--ready-pipelines)
@@ -62,20 +61,46 @@ extensive guidelines to do it in [this guide](./docs/environment/NFCORE.md).
6261

6362
## Getting info on components from `nf-neuro`
6463

65-
With your environment ready, you can list `nf-neuro` modules and subworkflows with :
64+
With your environment ready, you can list `nf-neuro` modules available with a simple command :
6665

6766
```bash
6867
nf-core modules list remote
68+
```
69+
70+
<p align="center">
71+
<img src="docs/images/cli/nfcore_modules_list.png" alt="nf-core modules list remote"/>
72+
</p> <!-- omit in toc -->
73+
74+
The same goes for `subworkflows` :
75+
76+
```bash
6977
nf-core subworkflows list remote
7078
```
7179

72-
To get more information on a module (say `denoising/nlmeans`) or a subworkflow (say `preproc_t1`), use :
80+
<p align="center">
81+
<img src="docs/images/cli/nfcore_subworkflows_list.png" alt="nf-core subworkflows list remote"/>
82+
</p> <!-- omit in toc -->
83+
84+
To get more information on a module (say `denoising/nlmeans`) use :
7385

7486
```bash
7587
nf-core modules info denoising/nlmeans
88+
```
89+
90+
<p align="center">
91+
<img src="docs/images/cli/nfcore_modules_info.png" alt="nf-core modules info"/>
92+
</p> <!-- omit in toc -->
93+
94+
or for a subworkflow (say `preproc_t1`) :
95+
96+
```bash
7697
nf-core subworkflows info preproc_t1
7798
```
7899

100+
<p align="center">
101+
<img src="docs/images/cli/nfcore_subworkflows_info.png" alt="nf-core subworkflows info"/>
102+
</p> <!-- omit in toc -->
103+
79104
> [!NOTE]
80105
> Additionally, `VS Code` users can install the [nextflow extension](https://marketplace.visualstudio.com/items?itemName=nextflow.nextflow),
81106
> which contains a language server that helps you in real time when coding. It gives you useful tooltips on modules inputs and outputs, commands
@@ -86,101 +111,7 @@ nf-core subworkflows info preproc_t1
86111
> description of modules and workflows prescribed by `nf-core` and shown below. Thus, we highly recommend its use.
87112
88113
You'll get a good description of the modules's or subworkflow's `behavior` and `dependencies`, as well as a
89-
thorough description of its `inputs` and `outputs`. To use them in your own pipeline, you need first to
90-
install them locally :
91-
92-
```bash
93-
nf-core modules install denoising/nlmeans
94-
nf-core subworkflows install preproc_t1
95-
```
96-
97-
> [!WARNING]
98-
> You need to be at the root of your `pipeline directory` when calling this command ! `nf-core` installs
99-
> locally to your pipeline's `modules` and `subworkflows`, not in a special hidden place !
100-
101-
> [!NOTE]
102-
> On the first run of the `install` command, select `pipeline` as an install setup. The interactive prompt
103-
> will also ask you to create multiple files and directories. Say yes to everything !
104-
105-
> [!IMPORTANT]
106-
> The installation procedure will provide you an `include` line to add to your pipeline's `main.nf`
107-
> file, which will import the module or subworkflow at runtime.
108-
109-
### Using the information from the `info` command
110-
111-
For a `module`, the list of `inputs` tell you the content to provide in `a single channel`, usually
112-
as a list of lists, each starting with a `meta`, a map `[:]` of metadata containing a mandatory `id` :
113-
114-
```nextflow
115-
// Example for denoising/nlmeans
116-
input = Channel.of( [
117-
[ [id: "sub-1"], file("image1.nii.gz"), file("mask1.nii.gz") ],
118-
[ [id: "sub-2"], file("image2.nii.gz"), file("mask2.nii.gz") ]
119-
] )
120-
121-
DENOSING_NLMEANS( input )
122-
```
123-
124-
> [!WARNING]
125-
> There are some exceptions here, due to limitations in current `nf-core` tools and standards.
126-
>
127-
> 1. some inputs could be associated to different channels. It's almost never the case, but it happens.
128-
> We are working hard at changing the behavior of those modules, and at improving the metadata to
129-
> help you better. For now, please refer to their implementation in the `modules/nf-neuro/`
130-
> directory as well, through the `main.nf` file, or given by the `nextflow language server tooltips`.
131-
132-
For the `module's` list of `outputs`, each corresponds to its own `named channel` :
133-
134-
```nextflow
135-
// Example for denoising/nlmeans
136-
DENOISING_NLMEANS.out.image.view() // [ [ [id: "sub-1"], "sub-1_denoised.nii.gz" ],
137-
// [ [id: "sub-2"], "sub-2_denoised.nii.gz" ] ]
138-
DENOISING_NLMEANS.out.versions.first().view() // [ "versions.yml" ]
139-
```
140-
141-
> [!WARNING]
142-
> There are some exceptions here, due to limitations in current `nf-core` tools and standards.
143-
>
144-
> 1. `meta` output **is not a channel** but accompanies all files, produced by other channels.
145-
> 2. `versions` is a channel, but its output is not accompanied by `meta`
146-
> 3. Some other outputs are not accompanied by `meta` also. We are currently improving the metadata
147-
> files to make it apparent. For now, please refer to their implementation in the `modules/nf-neuro/`
148-
> directory, through the `main.nf` file.
149-
150-
For `subworkflows` there are no exceptions, nor differences between `inputs` and `outputs`; they are all
151-
`named channels`. Each comes with a `Structure` description, telling you the content to put in the `list of lists`.
152-
For `preproc_t1`, a simple example would be :
153-
154-
```nextflow
155-
ch_image = Channel.of( [
156-
[ [id: "sub-1"], file("image1.nii.gz") ],
157-
[ [id: "sub-2"], file("image2.nii.gz") ]
158-
] )
159-
160-
ch_template = Channel
161-
.of( [ [id: "sub-1"], [id: "sub-2"] ] )
162-
.combine( [ file("template.nii.gz") ] )
163-
.view() // [ [ [id: "sub-1"], "template.nii.gz" ],
164-
// [ [id: "sub-2"], "template.nii.gz" ] ]
165-
166-
ch_probability_map = Channel
167-
.of( [ [id: "sub-1"], [id: "sub-2"] ] )
168-
.combine( [ file("probmap.nii.gz") ] )
169-
.view() // [ [ [id: "sub-1"], "probmap.nii.gz" ],
170-
// [ [id: "sub-2"], "probmap.nii.gz" ] ]
171-
172-
PREPROC_T1(
173-
ch_image
174-
ch_template,
175-
ch_probability_map
176-
)
177-
178-
PREPROC_T1.out.t1_final.view() // [ [ [id: "sub-1"], "sub-1_t1_cropped.nii.gz" ],
179-
// [ [id: "sub-2"], "sub-2_t1_cropped.nii.gz" ] ]
180-
PREPROC_T1.out.mask_final.view() // [ [ [id: "sub-1"], "sub-1_t1_mask_cropped.nii.gz" ],
181-
// [ [id: "sub-2"], "sub-2_t1_mask_cropped.nii.gz" ] ]
182-
PREPROC_T1.out.versions.first().view() // [ "versions.yml" ]
183-
```
114+
thorough description of its `inputs` and `outputs`.
184115

185116
# Pipeline creation with `nf-neuro`
186117

docs/PROTOTYPING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ workflow get_data {
5656
// ** Loading all files. ** //
5757
dwi_channel = Channel.fromFilePairs("$input/**/*dwi.{nii.gz,bval,bvec}", size: 3, flat: true)
5858
{ it.parent.name }
59-
.map{ sid, bvals, bvecs, dwi -> tuple(meta.id: sid, dwi, bvals, bvecs) } // Reordering the inputs.
59+
.map{ sid, bvals, bvecs, dwi -> [ [id: sid], dwi, bvals, bvecs ] } // Reordering the inputs.
6060
rev_channel = Channel.fromFilePairs("$input/**/*revb0.nii.gz", size: 1, flat: true)
6161
{ it.parent.name }
62-
.map{ sid, rev -> tuple(meta.id: sid, rev) }
62+
.map{ sid, rev -> [ [id: sid], rev ] }
6363
t1_channel = Channel.fromFilePairs("$input/**/*t1.nii.gz", size: 1, flat: true)
6464
{ it.parent.name }
65-
.map{ sid, t1 -> tuple(meta.id: sid, t1) }
65+
.map{ sid, t1 -> [ [id: sid], t1 ] }
6666
emit:
6767
dwi = dwi_channel
6868
rev = rev_channel
@@ -118,7 +118,7 @@ workflow get_data {
118118
// ** Loading all files. ** //
119119
dwi_channel = Channel.fromFilePairs("$input/**/*dwi.{nii.gz,bval,bvec}", size: 3, flat: true)
120120
{ it.parent.name }
121-
.map{ sid, bvals, bvecs, dwi -> tuple([id: sid], dwi, bvals, bvecs) } // Reordering the inputs.
121+
.map{ sid, bvals, bvecs, dwi -> [ [id: sid], dwi, bvals, bvecs ] } // Reordering the inputs.
122122
rev_channel = Channel.fromFilePairs("$input/**/*revb0.nii.gz", size: 1, flat: true)
123123
{ it.parent.name }
124124
anat_channel = Channel.fromFilePairs("$input/**/*t1.nii.gz", size: 1, flat: true)

docs/environment/DEVCONTAINER.md

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
# Using `nf-neuro` development containers
1+
# Using `nf-neuro` development containers<!-- omit in toc -->
22

33
`nf-neuro` comes preloaded with a set of development containers destined at streamlining
44
your development. They provide `pre-installed` environments for you to start programming
55
new `pipelines` or `nf-neuro components`.
66

7-
- [Using `nf-neuro` development containers](#using-nf-neuro-development-containers)
8-
- [Requirements](#requirements)
9-
- [Configuring Docker for easy usage](#configuring-docker-for-easy-usage)
10-
- [Prototyping environment](#prototyping-environment)
11-
- [Usage](#usage)
12-
- [Available in the container](#available-in-the-container)
13-
- [Available in the VS Code IDE through extensions](#available-in-the-vs-code-ide-through-extensions)
14-
- [Production environment](#production-environment)
15-
- [Development environment](#development-environment)
16-
- [Usage](#usage-1)
17-
- [Available in the container](#available-in-the-container-1)
18-
- [Available in the VS Code IDE through extensions](#available-in-the-vs-code-ide-through-extensions-1)
7+
- [Requirements](#requirements)
8+
- [Configuring Docker for easy usage](#configuring-docker-for-easy-usage)
9+
- [Prototyping environment](#prototyping-environment)
10+
- [Usage](#usage)
11+
- [Available in the container](#available-in-the-container)
12+
- [Available in the VS Code IDE through extensions](#available-in-the-vs-code-ide-through-extensions)
13+
- [Production environment](#production-environment)
14+
- [Development environment](#development-environment)
15+
- [Usage](#usage-1)
16+
- [Available in the container](#available-in-the-container-1)
17+
- [Available in the VS Code IDE through extensions](#available-in-the-vs-code-ide-through-extensions-1)
1918

2019
## Requirements
2120

docs/environment/DEVOPS.md

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
# Developing within `nf-neuro`
2-
3-
- [Developing within `nf-neuro`](#developing-within-nf-neuro)
4-
- [Development container](#development-container)
5-
- [Manual installation](#manual-installation)
6-
- [Dependencies](#dependencies)
7-
- [Python environment](#python-environment)
8-
- [Loading the project's environment](#loading-the-projects-environment)
9-
- [Global environment](#global-environment)
10-
- [Working with VS Code](#working-with-vs-code)
1+
# Developing within `nf-neuro`<!-- omit in toc -->
2+
3+
- [Development container](#development-container)
4+
- [Manual installation](#manual-installation)
5+
- [Dependencies](#dependencies)
6+
- [Python environment](#python-environment)
7+
- [Loading the project's environment](#loading-the-projects-environment)
8+
- [Global environment](#global-environment)
9+
- [Working with VS Code](#working-with-vs-code)
1110
- [Installing Prettier and editorconfig](#installing-prettier-and-editorconfig)
1211

1312
## Development container
@@ -106,7 +105,7 @@ This will make it so the `nf-core` commands target the right repository by defau
106105
The `nf-neuro` project curates a bundle of useful extensions for Visual Studio Code, the `nf-neuro-extensions` package. You can find it easily on the [extension
107106
marketplace](https://marketplace.visualstudio.com/items?itemName=nf-neuro.nf-neuro-extensionpack).
108107

109-
# Installing Prettier and editorconfig
108+
## Installing Prettier and editorconfig
110109

111110
To install **Prettier** and **editorconfig** for the project, you need to have `node` and `npm` installed on your system to at least version 14. On Ubuntu, you can do it using snap :
112111

docs/environment/NFCORE.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# Basic environment setup
1+
# Basic environment setup<!-- omit in toc -->
22

3-
- [Basic environment setup](#basic-environment-setup)
4-
- [Development container](#development-container)
5-
- [Manual installation](#manual-installation)
6-
- [Dependencies](#dependencies)
7-
- [Configuration](#configuration)
3+
- [Development container](#development-container)
4+
- [Manual installation](#manual-installation)
5+
- [Dependencies](#dependencies)
6+
- [Configuration](#configuration)
87

98
## Development container
109

53.8 KB
Loading
29.1 KB
Loading
91 KB
Loading
25.6 KB
Loading

0 commit comments

Comments
 (0)