Blog

Crudely converting OpenEphys to Neurodata Without Borders

Our lab is toying with the idea of moving our data to Neurodata Without Borders. Turns out it won’t be such a monumental task after all. I figured someone would have written a guide for converting the old OpenEphys .continuous style of data, but I couldn’t find any. Behold, converting my lab’s cryptic metadata and OE data to NWB.

Links

The Outcome…

Before we wade into some code, let us fortify ourselves with the satisfaction of our endpoint.

/root
β”œβ”€β”€ acquisition
β”‚Β Β  β”œβ”€β”€ CH5
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ data
β”‚Β Β  β”‚Β Β  └── starting_time
β”‚Β Β  β”œβ”€β”€ CH6
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ data
β”‚Β Β  β”‚Β Β  └── starting_time
β”‚Β Β  β”œβ”€β”€ CH7
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ data
β”‚Β Β  β”‚Β Β  └── starting_time
β”‚Β Β  └── CH8
β”‚Β Β      β”œβ”€β”€ data
β”‚Β Β      └── starting_time
β”œβ”€β”€ analysis
β”œβ”€β”€ file_create_date
β”œβ”€β”€ general
β”‚Β Β  β”œβ”€β”€ experimenter
β”‚Β Β  β”œβ”€β”€ institution
β”‚Β Β  β”œβ”€β”€ lab
β”‚Β Β  β”œβ”€β”€ pharmacology
β”‚Β Β  └── subject
β”‚Β Β      β”œβ”€β”€ date_of_birth
β”‚Β Β      β”œβ”€β”€ genotype
β”‚Β Β      β”œβ”€β”€ sex
β”‚Β Β      β”œβ”€β”€ species
β”‚Β Β      └── subject_id
β”œβ”€β”€ identifier
β”œβ”€β”€ intervals
β”‚Β Β  └── trials
β”‚Β Β      β”œβ”€β”€ LaserOnOff
β”‚Β Β      β”œβ”€β”€ amplitude
β”‚Β Β      β”œβ”€β”€ duration
β”‚Β Β      β”œβ”€β”€ gapdelay
β”‚Β Β      β”œβ”€β”€ gapdur
β”‚Β Β      β”œβ”€β”€ id
β”‚Β Β      β”œβ”€β”€ laser
β”‚Β Β      β”œβ”€β”€ loop_flg
β”‚Β Β      β”œβ”€β”€ next
β”‚Β Β      β”œβ”€β”€ pulseamp
β”‚Β Β      β”œβ”€β”€ pulsedur
β”‚Β Β      β”œβ”€β”€ ramp
β”‚Β Β      β”œβ”€β”€ seamless
β”‚Β Β      β”œβ”€β”€ soa
β”‚Β Β      β”œβ”€β”€ soaflag
β”‚Β Β      β”œβ”€β”€ start_time
β”‚Β Β      β”œβ”€β”€ stop_time
β”‚Β Β      └── type
β”œβ”€β”€ processing
β”œβ”€β”€ session_description
β”œβ”€β”€ session_start_time
β”œβ”€β”€ stimulus
β”‚Β Β  β”œβ”€β”€ presentation
β”‚Β Β  └── templates
β”œβ”€β”€ timestamps_reference_time
└── units
    β”œβ”€β”€ channel
    β”œβ”€β”€ cluster
    β”œβ”€β”€ id
    β”œβ”€β”€ spike_times
    β”œβ”€β”€ spike_times_index
    └── tetrode

11 directories, 50 files

ooo aaaaahhhh…

so without further ado.

The Code…


bad at programming and neuroscience in beautiful Oregon.