{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\nAll Analysis\n============\n\nRun all analyses on NWB file\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import os\n\nfrom allensdk.api.queries.cell_types_api import CellTypesApi\nfrom ipfx.data_set_utils import create_data_set\nfrom ipfx.data_set_features import extract_data_set_features\n\n# Download and access the experimental data\nct = CellTypesApi()\nnwb_file = os.path.join(\n    os.path.dirname(os.getcwd()), \n    \"data\",\n    \"nwb2_H17.03.008.11.03.05.nwb\"\n)\nspecimen_id = 595570553\nsweep_info = ct.get_ephys_sweeps(specimen_id)\nsweep_info = [\n    sweep for sweep in sweep_info \n    if sweep[\"stimulus_name\"] != \"Test\"\n]\n\n# remove test sweeps\nsweep_info = [\n    sweep for sweep in sweep_info \n    if sweep[\"stimulus_name\"] != \"Test\"\n]\n\ndata_set = create_data_set(sweep_info=sweep_info, nwb_file=nwb_file)\n\ncell_features, sweep_features, cell_record, sweep_records = \\\n    extract_data_set_features(data_set, subthresh_min_amp=-100.0)\n\nprint(cell_record)"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.7.3"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}