Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
flycircuit neurons with nat
library(flycircuit)
# download NBLAST all by all score matrix (used e.g. for hierarchical clustering)
# this downloads a single 2Gb file to your machine as a one-off
fc_download_data('http://flybrain.mrc-lmb.cam.ac.uk/si/nblast/flycircuit/allbyallblastcv4.5.ff',
type='ff')
# set that as default all by all score matrix
options('flycircuit.scoremat'="allbyallblastcv4.5.ff")
# load neuron list
# the actual neuron data will be downloaded and cached to your machine on demand
dps<-read.neuronlistfh("http://flybrain.mrc-lmb.cam.ac.uk/si/nblast/flycircuit/dpscanon.rds",
localdir=getOption('flycircuit.datadir'))
# set default neuronlist
options('nat.default.neuronlist'='dps')
@jefferis

This comment has been minimized.

Copy link
Owner Author

@jefferis jefferis commented Oct 9, 2015

If you want you can run the gist like this:

if(!require("devtools")) install.packages("devtools")
devtools::source_gist("bbaf5d53353b3944c090")

There is a bug in devtools::source_gist v 1.12.0 (current 2016-08-14), so you may need to do this:

devtools::source_gist("bbaf5d53353b3944c090", filename = "FlyCircuitStartupNat.R")

Then try e.g.

# plot a single neuron
plot3dfc("fru-M-200266")

# plot top 10 nblast matches for that neuron
clear3d()
plot3dfc("fru-M-200266", col='black', lwd=3)
sc=fc_nblast("fru-M-200266")
top10sc=sort(sc, decreasing = T)[1:10]
plot3dfc(names(top10sc), soma=T)
@jefferis

This comment has been minimized.

Copy link
Owner Author

@jefferis jefferis commented Oct 9, 2015

See also package installation instructions at https://github.com/jefferis/flycircuit

@jefferis

This comment has been minimized.

Copy link
Owner Author

@jefferis jefferis commented Jun 20, 2016

If you want to download all the neurons then it will be painful if you do this automatically because each neuron will be downloaded one at a time. It is much better to download them all in one go (with a nice progress bar). This can be done as follows:

dps<-read.neuronlistfh("http://flybrain.mrc-lmb.cam.ac.uk/si/nblast/flycircuit/dpscanon.rds",
    localdir=getOption('flycircuit.datadir'))
remotesync(dps,download.missing = TRUE)

It will still take a while (15m to overnight depending on location in the world).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment