knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

Overview

gabaclassifier classifies a given neuronal morphology into one of seven types (see below), such as Chandelier or Martinotti.

For example, it classifies cell C030502A as a nest basket cell.

library(gabaclassifier) 
file <- system.file('extdata', 'C030502A.swc', package = 'gabaclassifier')
classify_interneuron(file = file, layer  = '23')

The output is short code for the type name. The codes for the seven types are:

knitr::kable(data.frame(short = get_type_codes(), long = get_type_names())  )

See this paper for descriptions of the types.

Installing

gabaclassifier requires neurostr and neurostrplus to be installed. The following installs all three packages (install the devtools package with install.packages('devtools') if you don't have it):

# install.packages('devtools')
devtools::install_github("ComputationalIntelligenceGroup/neurostrr")
devtools::install_github("ComputationalIntelligenceGroup/neurostrplus")
devtools::install_github("ComputationalIntelligenceGroup/gabaclassifier") 

These packages have only been tested on Ubuntu 16.04.

Usage

Cells are classified with the classify_interneuron function. The inputs are

The path must be fully expanded, that is /home/user/neuron.swc will work while ~/neuron.swc will not.

The model has been trained with layer L2/3 to layer L6 interneurons and thus only interneurons from those layers are allowed as input to classify_interneuron.

classify_interneuron(file = file, layer  = '1')

gabaclassifier will only classify a morphology reconstruction that passes the following quality checks:

So, it will not classify the following cell:

file <- system.file('extdata', 'C170501A2.swc', package = 'gabaclassifier')
classify_interneuron(file = file, layer  = '4')

The underlying model has been trained and tested with rat somatosensory cortex interneurons (see below). Classifying interneurons from other species, brain area etc. may be less reliable.

Model

The classification is based on a model trained in a supervised fashion. The model is a random forest with 2000 trees trained on r length(gabaclassifier:::cell_ids) cells with r length(gabaclassifier:::features) morphometrics for each. The morphometrics were computed with the neuorstrplus and neurostr packages. All cells are hind-limb somatosensory cortex interneurons from two-week-old male Wistar rats reconcstructed by the Markam laboratory. The ids of the cells are available with gabaclassifier:::cell_ids. The cells are from layers L2/3, L4, L5, or L6 cell and fullfill the above-listed morphology quality criteria.

The 10-fold cross-validated accuracy of the model is r sum(diag(gabaclassifier:::confusion_matrix)) / sum(gabaclassifier:::confusion_matrix). The types with highest sensitivity are Martinotti, Large basket, and nest basket. The model in unable to recognizes bitufted cells.

knitr::kable(gabaclassifier:::confusion_matrix)


ComputationalIntelligenceGroup/gabaclassifier documentation built on May 24, 2019, 8:56 a.m.