as.neuronlist.neuronlistz converts a neuronlistz to a regular (in memory) neuronlist

neuronlistz(zip, patt = NULL, df = NULL, ...)

# S3 method for neuronlistz
as.neuronlist(l, ...)

Arguments

zip

Path to the zip file

patt

Optional regex pattern or function to specify a subset of files.

df

A data.frame of metadata that will be attached to the neuronlistz and will define the order of the objects inside it.

...

Additional arguments currently ignored

l

An existing list or a single neuron to start a list

Value

A neuronlist object with additional class neuronlistz

Details

neuronlistz is designed to wrap zip files containing neurons saved in the RDS or faster/smaller qs format for rapid access. You should be able to read typical files in <20 ms. For files of ~3 GB there is a fixed cost of the order of 10-15ms per read.

Examples

# \donttest{
write.neurons(Cell07PNs[1:5], tf <- tempfile(fileext = '.zip'), format='rds')
nz=neuronlistz(tf)
nz[[1]]
#> 'neuron' with 180 vertices in 1 tree
nz[1:5]
#> 'neuronlist' containing 5 'neuron' objects and 'data.frame' with 1 vars [184.7 kB]
# }
if (FALSE) {
write.neurons(Cell07PNs[1:5], tf <- tempfile(fileext = '.zip'), format='qs')
nz2=neuronlistz(tf)
all.equal(nz2[1:3], nz[1:3])
}