neuronlistz: A neuronlist object that will read neurons from a zip file on...

View source: R/neuronlistz.R

neuronlistzR Documentation

A neuronlist object that will read neurons from a zip file on demand

Description

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

Usage

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

## S3 method for class '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

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.

Value

A neuronlist object with additional class neuronlistz

See Also

neuronlist, neuronlistfh, write.neurons

Other neuronlist: *.neuronlist(), is.neuronlist(), neuronlist-dataframe-methods, neuronlistfh(), neuronlist(), nlapply(), read.neurons(), write.neurons()

Examples


write.neurons(Cell07PNs[1:5], tf <- tempfile(fileext = '.zip'), format='rds')
nz=neuronlistz(tf)
nz[[1]]
nz[1:5]

## Not run: 
write.neurons(Cell07PNs[1:5], tf <- tempfile(fileext = '.zip'), format='qs')
nz2=neuronlistz(tf)
all.equal(nz2[1:3], nz[1:3])

## End(Not run)

natverse/nat documentation built on Feb. 19, 2024, 7:19 a.m.