Generating an example dataset#
In case you don’t have an entire experiment’s worth of NWB files, you can generate an example dataset by running:
nwb2bids tutorial ephys dataset
Tip
Lost in the CLI? Can’t remember the exact phrase to type when navigating through the command groups? No worries!
Simply add the --help to any command to see detailed descriptions, expected inputs, and optional flags.
You can also see a layout of the command structure by calling each level at a time, for example nwb2bids,
nwb2bids tutorial, and so on.
Try it out on nwb2bids tutorial to see all the types of tutorial data we can generate for you.
import nwb2bids
tutorial_directory = nwb2bids.testing.generate_ephys_tutorial(
mode="dataset"
)
Tip
Lost in the Python library? Can’t remember the exact inputs to pass to an imported function? No worries!
Simply add the ? at the end of any module or function to see a detailed description of imports or
expected inputs. Try it out on nwb2bids? to see the library’s welcome message.
The nwb2bids library is also designed for easy auto-completion in interactive environments like
IPython or Jupyter notebooks; try it out on by hitting your tab button after typing nwb2bids.testing. to
see all the functions exposed to that submodule.
Now we should have a directory that looks something like:
ecephys_tutorial_dataset/
├── ecephys_session_3.nwb
├── DO_NOT_CONVERT.nwb
└── some_sessions/
├── ecephys_session_1.nwb
└── ecephys_session_1.nwb
Note
Don’t like overwhelming your home directory with lots of small files?
You can control where tutorial data is generated by using the --output-directory flag (or -o for
short):
nwb2bids tutorial ephys file --output-directory path/to/some/directory
You can control where tutorial data is generated by using the output_directory keyword argument:
import nwb2bids
tutorial_directory = nwb2bids.testing.generate_ephys_tutorial(
mode="file",
output_directory=path_to_some_directory,
)
Other modalities#
You can also generate example NWB files for other modalities, such as icephys!
nwb2bids tutorial ephys dataset --modality icephys
import nwb2bids
tutorial_file = nwb2bids.testing.generate_ephys_tutorial(mode="dataset", modality="icephys")