Skip to content

Commit

Permalink
Typos and corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
pvandyken committed Apr 3, 2023
1 parent 7827605 commit 11c998f
Show file tree
Hide file tree
Showing 3 changed files with 1,267 additions and 1,254 deletions.
10 changes: 5 additions & 5 deletions docs/bids_app/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Snakebids workflow features

The [](#snakebids.bids) function generates a properly-formatted BIDS filename with the specified entities, as documented in more detail elsewhere in this documentation.

[](#snakebids.generate_inputs) returns an instance of [](#snakebids.BidsDataset), a special [](#dict) with keys mapping to the {class}`~snakebids.BidsComponents` defined in [the config file](/bids_app/config). Each {class}`~snakebids.BidsComponent` contains a number of attributes to assist processing a BIDS dataset with snakemake. {func}`~snakebids.generate_inputs` should be called at the beginning of the workflow and assigned to a variable called `inputs`.
[](#snakebids.generate_inputs) returns an instance of [](#snakebids.BidsDataset), a special <inv:*:*:class#dict> with keys mapping to the {class}`BidsComponents <snakebids.BidsComponent>` defined in [the config file](/bids_app/config). Each {class}`~snakebids.BidsComponent` contains a number of attributes to assist processing a BIDS dataset with snakemake. {func}`~snakebids.generate_inputs` should be called at the beginning of the workflow and assigned to a variable called `inputs`.

The {attr}`~snakebids.BidsComponent.path` member of [](#snakebids.BidsComponent) is generated by snakebids and contains a list of matched files for every input type. Often, the first rule to be invoked will use one or more entries in `inputs.path` as the input file specification.
The {attr}`~snakebids.BidsComponent.path` member of {class}`~snakebids.BidsComponent` is generated by snakebids and contains a list of matched files for every input type. Often, the first rule to be invoked will use one or more entries in `inputs.path` as the input file specification.

The {attr}`~snakebids.BidsComponent.zip_lists` member of [](#snakebids.BidsComponent) is used with [`bids()`](#snakebids.bids) and [`expand()`](#snakefiles_expand) to fill the wildcards with corresponding values from input files. The usage pattern is as follows:
The {attr}`~snakebids.BidsComponent.zip_lists` member of {class}`~snakebids.BidsComponent` is used with [`bids()`](#snakebids.bids) and [`expand()`](#snakefiles_expand) to fill the wildcards with corresponding values from input files. The usage pattern is as follows:

```py
expand(
Expand All @@ -49,9 +49,9 @@ expand(
)
```

The {attr}`~snakebids.BidsComponent.wildcards` member of {class}`snakebids.BidsComponent` is generated by snakebids and contains a dictionary mapping the wildcards for each input type to snakemake-formatted wildcards, for convenient use in the ``bids`` function.
The {attr}`~snakebids.BidsComponent.wildcards` member of {class}`~snakebids.BidsComponent` is generated by snakebids and contains a dictionary mapping the wildcards for each input type to snakemake-formatted wildcards, for convenient use in the ``bids`` function.


## Accessing the underlying *pybids* dataset

In addition to mapping all of the {class}`~snakebids.BidsComponents` to their names, {class}`~snakebids.BidsDataset` also has a {attr}`~snakebids.BidsDataset.layout` member which gives access to the underlying {class}`BIDSLayout <bids.layout.BIDSLayout>`. This can be used to access advanced pybids features not covered by `snakebids`. Note that if `custom_paths` are specified for every {class}`BidsComponent <snakebids.BidsComponent>`, pybids indexing will be skipped and `layout` will be set to `None`. If your workflow relies on accessing this `layout`, you must ensure your users do not provide a `custom_path` for every single component, either in the config file or [via the CLI](/running_snakebids/overview) (``--path_{component}``).
In addition to mapping all of the {class}`BidsComponents <snakebids.BidsComponent>` to their names, {class}`~snakebids.BidsDataset` also has a {attr}`~snakebids.BidsDataset.layout` member which gives access to the underlying {class}`BIDSLayout <bids.layout.BIDSLayout>`. This can be used to access advanced pybids features not covered by `snakebids`. Note that if `custom_paths` are specified for every {class}`BidsComponent <snakebids.BidsComponent>`, pybids indexing will be skipped and {attr}`~snakebids.BidsDataset.layout` will be set to `None`. If your workflow relies on accessing this {attr}`~snakebids.BidsDataset.layout`, you must ensure your users do not provide a `custom_path` for every single component, either in the config file or [via the CLI](/running_snakebids/overview) (``--path_{component}``).
10 changes: 5 additions & 5 deletions docs/tutorial/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,11 @@ $ snakemake -nq
BidsDataset({
"bold": BidsComponent(
name="bold",
path="/path/to/bids_bold/sub-{subject}/func/sub-{subject}_task-{task}_run-{run}_bold.nii.gz",
path="/path/to/data/sub-{subject}/func/sub-{subject}_task-{task}_run-{run}_bold.nii.gz",
zip_lists={
"subject": ["1", "2", "2" ],
"task": ["rest", "rest", "rest"],
"run": ["1", "1", "2" ],
"subject": ["001", "001" ],
"task": ["rest", "rest"],
"run": ["1", "2" ],
},
),
})
Expand Down Expand Up @@ -413,7 +413,7 @@ inputs['bold'].wildcards == {
}
```

This is super useful when combined with {func}`bids() <snakebids.bids>`, as we can use the keyword expansion (`**inputs[<input_name>].wildcards`{l=python} to set all the wildcard parameters to the {func}`bids() <snakebids.bids>` function. Thus, we can make our workflow even more general, by replacing this:
This is super useful when combined with {func}`bids() <snakebids.bids>`, as we can use the keyword expansion `**inputs["<input_name>"].wildcards`{l=python} to set all the wildcard parameters to the {func}`bids() <snakebids.bids>` function. Thus, we can make our workflow even more general, by replacing this:

```{literalinclude} step6/Snakefile
:language: python
Expand Down
Loading

0 comments on commit 11c998f

Please sign in to comment.