R Markdown documents used to produce figures for Costa et al. (2014) NBLAST: Rapid, sensitive comparison of neuronal structure and construction of neuron family databases
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


NBLAST figures

Build Status

This repository contains the knitr documents used to make the figure panels for Costa et al. (2014) NBLAST: Rapid, sensitive comparison of neuronal structure and construction of neuron family databases.

Watch a video demo of how to run code here. Read on for the details.


All of our analyses use the statistical programming environment, R. RStudio is a convenient cross-platform IDE with excellent support for authoring R Markdown documents, which combine text written in Markdown with embedded R code chunks.

Some scripts depend on an installation of the image registration toolkit CMTK in order to transform neurons from one space to another.

  1. Install R from http://www.r-project.org/ (you need at least R 3.2.0, latest R recommended).
  2. Install RStudio from http://www.rstudio.com.
  3. Optionally on MacOS X install XQuartz to use X11 for 3D visualisation (this used to be packaged with MacOS X but is now available only from http://xquartz.macosforge.org/)
  4. CMTK from http://www.nitrc.org/projects/cmtk is necesary for some scripts. (it is used to transform neurons between template brains). A full set of binaries is available here: http://www.nitrc.org/frs/?group_id=212. We recommend the lastest version of CMTK and certainly CMTK>=3.2.2.

Setting Up

  1. Download and unzip this repository (or git clone if you prefer).
  2. Double click on NBLAST_figures.Rproj to start a clean R session in RStudio.
  3. Open R/Startup.R and source it (Code ... Source File) or press the button with a pale blue arrow at top right (details here).
  4. Check that there were no error messages while installing packages or downloading data.

Running a report

  1. Double click on NBLAST_figures.Rproj to start RStudio.
  2. Open one of the Rmd files under the fig/ folder.
  3. Click the 'Knit HTML' button to begin. When this process has finished, a web page containing text and images will be produced.
  4. You can also run the chunks in the report one by one in an interactive R session.
  5. Use the green "Chunks" button at the top right of the source file window. Choose for example "Run Current Chunk".
  6. You can step through the whole report chunk by chunk or line by line inspecting the intermediate results in R.
  7. This includes interactive 3D renderings of the plots of neurons which you can rotate and zoom; this will likely reveal additional information beyond the static projection view in the HTML report created earlier.


We are presently running an automated build of these figures using the online travis ci service. This confirms that the figures can be built completely independently of our own computer setups. If you wish you could fork the repository and switch on travis for your fork and use that to build new variants of the figures. Don't forget to update the url for the badge at the top of this file if you want it to reflect the status of your fork.


Please feel free to:

  • submit a bug report (recommended for faster response from team),
  • or contact Greg directly (details in paper)

should you have any difficulties.