Skip to content

Commit 7870dfc

Browse files
Improve transpose and groupTuple examples in the docs (#3685) [ci skip]
Signed-off-by: Llewellyn vd Berg <[email protected]> Signed-off-by: Marcel Ribeiro-Dantas <[email protected]> Co-authored-by: Llewellyn vd Berg <[email protected]>
1 parent af03f46 commit 7870dfc

File tree

2 files changed

+41
-20
lines changed

2 files changed

+41
-20
lines changed

docs/cli.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,11 +1252,11 @@ facilitates rapid iterations, inspections of any pipeline as well as debugging.
12521252
"beta": "foo"
12531253
}
12541254

1255-
Is equivalent to the following command line::
1255+
Is equivalent to this command in CLI::
12561256

12571257
$ nextflow run main.nf --alpha 1 --beta foo
12581258

1259-
The parameters which are specified through this mechanism are merged with the resolved configuration (base configuration and profiles). The values provided via params file overwrites the ones with the same name in the Nextflow configuration file.
1259+
The parameters specified with this mechanism are merged with the resolved configuration (base configuration and profiles). The values provided via a params file overwrite those of the same name in the Nextflow configuration file.
12601260

12611261
--------------------
12621262
self-update
@@ -1295,7 +1295,7 @@ Update Nextflow. ::
12951295
view
12961296
--------------------
12971297

1298-
View a projects script file(s).
1298+
View a project's script file(s).
12991299

13001300
**Usage**
13011301

@@ -1305,8 +1305,8 @@ View a projects script file(s).
13051305

13061306
**Description**
13071307

1308-
The ``view`` command is used to inspect the pipelines which are already stored in the global nextflow cache.
1309-
For downloading a pipeline into the global cache ``~/.nextflow/assets``, please refer to the ``pull`` command.
1308+
The ``view`` command is used to inspect the pipelines that are already stored in the global nextflow cache.
1309+
For downloading a pipeline into the global cache ``~/.nextflow/assets``, refer to the ``pull`` command.
13101310

13111311
**Options**
13121312

@@ -1345,7 +1345,7 @@ Viewing the contents of a downloaded pipeline. ::
13451345
Channel.of('Bonjour', 'Ciao', 'Hello', 'Hola') | sayHello | view
13461346
}
13471347

1348-
Listing the folder structure of the downloaded pipeline. ::
1348+
List the folder structure of the downloaded pipeline. ::
13491349

13501350
$ nextflow view -l nextflow-io/hello
13511351

@@ -1360,7 +1360,7 @@ Listing the folder structure of the downloaded pipeline. ::
13601360
.travis.yml
13611361
main.nf
13621362

1363-
Viewing the contents of a downloaded pipeline without omitting the header. ::
1363+
View the contents of a downloaded pipeline without omitting the header. ::
13641364

13651365
$ nextflow view -q nextflow-io/hello
13661366

@@ -1388,21 +1388,21 @@ Viewing the contents of a downloaded pipeline without omitting the header. ::
13881388
Pipeline parameters
13891389
====================
13901390

1391-
Pipeline script can use an arbitrary number of parameters that can be overridden either
1391+
Pipeline scripts can use an arbitrary number of parameters that can be overridden, either
13921392
using the command line or the Nextflow configuration file. Any script parameter can be specified
1393-
on the command line prefixing the parameter name with double dash characters e.g.::
1393+
on the command line, prefixing the parameter name with double dash characters, e.g.::
13941394

13951395
nextflow run <my script> --foo Hello
13961396

13971397
Then, the parameter can be accessed in the pipeline script using the ``params.foo`` identifier.
13981398

13991399
.. note::
14001400
When the parameter name is formatted using ``camelCase``, a second parameter
1401-
is created with the same value using ``kebab-case``, and the other way around.
1401+
is created with the same value using ``kebab-case``, and vice versa.
14021402

14031403
.. warning::
14041404
When a command line parameter includes one or more glob characters, i.e. wildcards like ``*`` or ``?``,
1405-
the parameter value needs to be enclosed in quotes to prevent Bash expansion and preserve
1405+
the parameter value must to be enclosed in quotes to prevent Bash expansion and preserve
14061406
the glob characters. For example::
14071407

14081408
nextflow run <my script> --files "*.fasta"

docs/operator.rst

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,15 @@ In other words, the operator transforms a sequence of tuple like *(K, V, W, ..)*
808808
For example::
809809

810810
Channel
811-
.of( [1,'A'], [1,'B'], [2,'C'], [3, 'B'], [1,'C'], [2, 'A'], [3, 'D'] )
811+
.of(
812+
[1, 'A'],
813+
[1, 'B'],
814+
[2, 'C'],
815+
[3, 'B'],
816+
[1, 'C'],
817+
[2, 'A'],
818+
[3, 'D']
819+
)
812820
.groupTuple()
813821
.view()
814822

@@ -823,7 +831,15 @@ By default the first entry in the tuple is used as grouping key. A different key
823831
grouping by the second value in each tuple::
824832

825833
Channel
826-
.of( [1,'A'], [1,'B'], [2,'C'], [3, 'B'], [1,'C'], [2, 'A'], [3, 'D'] )
834+
.of(
835+
[1, 'A'],
836+
[1, 'B'],
837+
[2, 'C'],
838+
[3, 'B'],
839+
[1, 'C'],
840+
[2, 'A'],
841+
[3, 'D']
842+
)
827843
.groupTuple(by: 1)
828844
.view()
829845

@@ -1773,19 +1789,24 @@ transpose
17731789
The ``transpose`` operator transforms a channel in such a way that the emitted items are the result of a transposition
17741790
of all tuple elements in each item. For example::
17751791

1776-
Channel.of(
1777-
['a', ['p', 'q'], ['u','v']],
1778-
['b', ['s', 't'], ['x','y']]
1792+
Channel
1793+
.of(
1794+
[1, ['A', 'B', 'C']],
1795+
[2, ['C', 'A']],
1796+
[3, ['B', 'D']]
17791797
)
17801798
.transpose()
17811799
.view()
17821800

17831801
The above snippet prints::
17841802

1785-
[a, p, u]
1786-
[a, q, v]
1787-
[b, s, x]
1788-
[b, t, y]
1803+
[1, A]
1804+
[1, B]
1805+
[1, C]
1806+
[2, C]
1807+
[2, A]
1808+
[3, B]
1809+
[3, D]
17891810

17901811
Available parameters:
17911812

0 commit comments

Comments
 (0)