NWB Conversion

From onice-wiki
Jump to navigation Jump to search

Converting all of our data to Docs For::NWB so that they can later be uploaded to DANDI

Process

Overview

  1. Collect and make a sample dataset available. Either upload to the ION NAS, upload here, or provide some link down below
  2. Add your conversion code to the onice-conversion git repository
    • Ask Jonny for an invitation to the organization if you aren't already in it!
    • Make a directory within the examples directory, and then put your code there -- script files, notebooks, anything is fine!
  3. Write documentation and add it here (feel free to make your own page) or add it to the docs folder so it can be rendered on the ReadTheDocs page by Sphinx
  4. Once you're done, upload your finished NWB Sample somewhere to compare the input data with the result!

Adding Examples to the onice-conversion Docs

To add to the docs, you can use either Restructured Text or Markdown (with MyST).

Say we have these files:

./onice-conversion
├── docs
│   ├── examples
│   │   └── wehr
│   │       ├── wehr-ira.nblink
│   │       ├── wehr-nick.nblink
│   │       └── wehr.md
│   ├── index.rst
├── examples
    └── wehr
        ├── nwbfile.nwb
        ├── wehr-ira.ipynb
        └── wehr-nick.ipynb

Write some Markdown

First we can write some textual documentation (in Markdown) explaining the examples in /docs/examples/wehr/wehr.md

# Wehr Lab Examples

Here we have two mighty fine example of how to convert wehrlab 
data to NWB! 

## [Nick](wehr-nick)

This example has multiple video files as well as electrophysiology!

## [Ira](wehr-ira)

```{toctree}
wehr-ira
wehr-nick
```

A few things to notice:

  • we used # Single and ## double hashes to make headers!
  • You make links like [Link Text](link) -- in this case, we're linking to the two files in the same directory wehr-nick (no file extension is needed)
  • Finally, you add the two pages to the table of contents using the toctree directive

Add notebooks and links

Then we can add our notebooks in the /examples/wehr folder. To render them we make a .nblink file like this:

/docs/examples/wehr/wehr-nick.nblink

{
    "path": "../../../examples/wehr/wehr-nick.ipynb"
}

To link to our notebook in /examples/wehr/wehr-nick.ipynb from the documentation file /docs/examples/wehr/wehr-nick.nblink we use relative links to go up three directories and then back down!

Add to the main TOC in RST

Finally, to add our new pages to the main table of contents (and thus make them available in the docs), we add the link to our markdown (/docs/examples/wehr/wehr.md) file from the main docs index (/docs/index.rst). This could also be markdown, but for the sake of illustrating that MyST is just a friendlier representation of the same concepts in ReST, we'll show that here.

ONICE NWB Conversion Tools
============================================

.. toctree::
   :maxdepth: 2
   :caption: User Guide

   guide/contributing

.. toctree::
   :maxdepth: 3
   :caption: Examples

   Wehr Lab <examples/wehr/wehr>

Commit, and readthedocs will automatically render it!

Sample Datasets

Jonny Dataset!

  • to acces go here...
  • ion-nas.uoregon.edu:/volume2/wehrlab/Rig2/maddie
  • You need access to ION NAS
  • (or it's uploaded directly to the wiki)

Conversion Guides

Wehr Lab