{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# All Analysis\n\nRun analysis for all stimulus types on data in the NWB file\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import os\n\nfrom ipfx.dataset.create import create_ephys_data_set\nfrom ipfx.data_set_features import extract_data_set_features\nfrom ipfx.utilities import drop_failed_sweeps\n\n# Download and access the experimental data from DANDI archive per instructions in the documentation\n# Example below will use an nwb file provided with the package\n\nnwb_file = os.path.join(\n    os.path.dirname(os.getcwd()),\n    \"data\",\n    \"nwb2_H17.03.008.11.03.05.nwb\"\n)\n\n# Create Ephys Data Set\ndata_set = create_ephys_data_set(nwb_file=nwb_file)\n\n# Drop failed sweeps: sweeps with incomplete recording or failing QC criteria\ndrop_failed_sweeps(data_set)\n\n# Calculate ephys features\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.6.8"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}