You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/snakefiles/rules.rst
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ It is not clear whether ``dataset=101.B`` and ``group=normal`` or ``dataset=101`
70
70
Hence wildcards can be constrained to given regular expressions.
71
71
Here we could restrict the wildcard ``dataset`` to consist of digits only using ``\d+`` as the corresponding regular expression.
72
72
With Snakemake 3.8.0, there are three ways to constrain wildcards.
73
-
First, a wildcard can be constrained within the file pattern, by appending a regular expression separated by a comma
73
+
First, a wildcard can be constrained within the file pattern, by appending a regular expression separated by a comma
74
74
(you might want to use the `r` prefix for a raw string to avoid having to escape backslashes, particularly for more complex regular expressions):
75
75
76
76
.. code-block:: python
@@ -214,7 +214,7 @@ These restrictions do not apply when using ``unpack()``.
214
214
Helpers for defining rules
215
215
--------------------------
216
216
217
-
Snakemake provides a number of helpers that can be used to define rules and drastically simplify over using
217
+
Snakemake provides a number of helpers that can be used to define rules and drastically simplify over using
218
218
:ref:`input functions <snakefiles-input_functions>` or :ref:`plain python expressions <snakefiles_aggregation>`.
219
219
Below, we will first start with describing two basic helper functions for specifying aggregations and multiple output files.
220
220
Afterwards, we will further show a set of semantic helper functions should increase readability and simplify code (see :ref:`snakefiles-semantic-helpers`).
@@ -346,14 +346,14 @@ The lookup function
346
346
347
347
The ``lookup`` function can be used to look up a value in a python mapping (e.g. a ``dict``) or a `pandas dataframe or series <https://pandas.pydata.org>`_.
348
348
It is especially useful for looking up information based on wildcard values.
349
-
The ``lookup`` function has the signature
349
+
The ``lookup`` function has the signature
350
350
351
351
.. code-block:: python
352
352
353
353
lookup(
354
-
dpath: Optional[str| Callable] =None,
355
-
query: Optional[str| Callable] =None,
356
-
cols: Optional[List[str]] =None,
354
+
dpath: Optional[str| Callable] =None,
355
+
query: Optional[str| Callable] =None,
356
+
cols: Optional[List[str]] =None,
357
357
is_nrows: Optional[int],
358
358
within=None,
359
359
default=NODEFAULT
@@ -2668,8 +2668,9 @@ Assuming that the checkpoint is named ``somestep`` as above, the output files fo
2668
2668
2669
2669
.. note::
2670
2670
2671
-
Note that output files of checkpoints that are accessed via this mechanism should not be marked as temporary.
2672
-
Otherwise, they would require to trigger reruns of the checkpoint whenever the DAG shall be reevaluated (because they are already missing at that point).
2671
+
Note that output files of checkpoints that are accessed via this mechanism will not be marked as temporary.
2672
+
Even you try to mark them as temporary, Snakemake will ignore the label and keep the output files of the checkpoint.
2673
+
Reruns will not be triggered if the output file do not exist.
2673
2674
2674
2675
Thereby, the ``get`` method throws ``snakemake.exceptions.IncompleteCheckpointException`` if the checkpoint has not yet been executed for these particular wildcard value(s).
2675
2676
Inside an input function, the exception will be automatically handled by Snakemake, and leads to a re-evaluation after the checkpoint has been successfully passed.
@@ -3195,7 +3196,7 @@ The name is optional and can be left out, creating an anonymous rule. It can als
0 commit comments