bmtk.builder.bionet package

Submodules

bmtk.builder.bionet.swc_reader module

class bmtk.builder.bionet.swc_reader.SWCReader(swc_file, random_seed=10, fix_axon=True)[source]

Bases: object

A class for pulling out section id, section locations, coordinates from a SWC file. Useful when building a network that requires exact locations of pre- or post-synaptic locations. Requires NEURON.

Attributes
swc_file - path to a SWC morphology file
fix_axon - If set to true, the axon will be removed and replaced with a 30 um stub, as defined for all Allen

Cell-Type models (default: True).

random_seed - integer value to seed the random genator, used by choose_sections method.
choose_sections(section_names, distance_range, n_sections=1)[source]

Similar to find_sections, but will only N=n_section number of sections_ids/x values randomly selected (may return less if there aren’t as many sections

Parameters
  • section_names – ‘soma’, ‘dend’, ‘apic’, ‘axon’

  • distance_range – [float, float]: distance range of sections from the soma, in um.

  • n_sections – int: maximum number of sections to select

Returns

[float], [float]: A list of all section_ids and a list of all segment_x values (as defined by NEURON) that meet the given critera.

find_sections(section_names, distance_range)[source]

Retrieves a list of sections ids and section x’s given a section name/type (eg axon, soma, apic, dend) and the distance from the soma.

Parameters
  • section_names – ‘soma’, ‘dend’, ‘apic’, ‘axon’

  • distance_range – [float, float]: distance range of sections from the soma, in um.

Returns

[float], [float]: A list of all section_ids and a list of all segment_x values (as defined by NEURON) that meet the given critera.

get_coord(sec_ids, sec_xs, soma_center=(0.0, 0.0, 0.0), rotations=None)[source]

Takes in a list of section_ids and section_x values and returns a list of coordinates, assuming the soma is at the center of the system.

Parameters
  • sec_ids – [float]: list of N section_ids

  • sec_xs – [float]: list of N cooresponding section_x’s

  • soma_center – location of soma in respect to the coordinate system. (default (0, 0, 0)).

  • rotations – List of rotations (not yet implemented)

Returns

[(float, float, float)]: for seach sec_ids/sec_xs returna the x,y,z coordinates as a tuple

get_dist(sec_ids)[source]

Returns arc-length distance from soma for a list of section_ids

get_type(sec_ids)[source]

For each section_id returns the type (1: soma, 2: axon, 3: dend, 4: apic

Module contents