ALLEN INSTITUTE

# bmtk.builder.bionet package

## Submodules

## bmtk.builder.bionet.swc_reader module

class bmtk.builder.bionet.swc_reader.SWCReader(swc_path, rng_seed=None)

  Bases: `object`

  choose_sections(section_names, distance_range, n_sections=1)

    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:

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

  delete_axon()
  find_sections(section_names, distance_range)

    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.

  fix_axon()

    Removes and refixes axon

  get_coords(sec_id, sec_x)
  get_section(section_idx)
  get_swc_id(sec_id, sec_x)
  move_and_rotate(soma_coords=None, rotation_angles=None, inplace=False)
  property n_sections
  property nseg
  sec_type_swc = {'apic': 4, 'apical': 4, 'axon': 2, 'axonal': 2, 'basal': 3, 'dend': 3, 'soma': 1, 'somatic': 1}
  property sections
  property seg_coords
  property seg_props
  set_segment_dl(dl)

    Define number of segments in a cell

  property soma_position
  property swc_map

class bmtk.builder.bionet.swc_reader.SegmentCoords(p0, p1, p05)

  Bases: `tuple`

  p0

    Alias for field number 0

  p05

    Alias for field number 2

  p1

    Alias for field number 1

class bmtk.builder.bionet.swc_reader.SegmentProps(type, area, x, dist, length, dist0, dist1, sec_id)

  Bases: `tuple`

  area

    Alias for field number 1

  dist

    Alias for field number 3

  dist0

    Alias for field number 5

  dist1

    Alias for field number 6

  length

    Alias for field number 4

  sec_id

    Alias for field number 7

  type

    Alias for field number 0

  x

    Alias for field number 2

bmtk.builder.bionet.swc_reader.get_swc(cell, morphology_dir=None, use_cache=False, dL=None)

bmtk.builder.bionet.swc_reader.rotation_matrix(axis, theta)

  Return the rotation matrix associated with counterclockwise rotation about the given axis by theta radians.

## Module contents

bmtk.builder.bionet.rand_syn_locations(src, trg, sections=('soma', 'apical', 'basal'), distance_range=(0.0, 1e+20), morphology_dir='./components/morphologies', return_coords=False, dL=None)