single_cell_parser ❭ reader ❭ read_hoc_file
read_hoc_file¶
- single_cell_parser.reader.read_hoc_file(fname='')¶
Reads a hoc file and returns a list of Edge objects.
This list of sections is parsed to a
CellParserobject usingspatialgraph_to_cell().See .hoc for more information on the hoc file format.
See also
The module
singlecell_input_mapperalso contains a methodread_hoc_file(). A notable difference is that this method reads in axon sections, while thesinglecell_input_mappervariant does not.- Parameters:¶
fname (str) – The name of the file to be read.
- Raises:¶
IOError – If the input file does not have a .hoc or .HOC suffix.
- Returns:¶
A list of
Edgeobjects.- Return type:¶
list
Example
>>> read\_hoc\_file(hoc\_file) [ \_Edge( label='Soma', hocLabel='soma', edgePts=[(1.93339, 221.367004, -450.04599), ... , (13.9619, 210.149002, -447.901001)], diameterList=[12.542, 13.3094, ... , 3.5997), parentID=None, parentConnect=None), \_Edge( label='BasalDendrite\_1\_0', hocLabel='BasalDendrite\_1\_0', edgePts=[(6.36964, 224.735992, -452.399994), (6.34155, 222.962997, -451.906006), ...], diameterList=[2.04, 2.04, ... , 2.04), parentID=0, parentConnect=0.009696), ... ]