singlecell_input_mapperevoked_PSTH_from_spike_timescreate_evoked_PSTH

create_evoked_PSTH

singlecell_input_mapper.evoked_PSTH_from_spike_times.create_evoked_PSTH(spikeTimesName, cellType, ongoingRate, outFileName)

Reads in spike times and creates a PSTH for evoked activity for each whisker.

Parameters:
  • spikeTimesName (str) – Filepath of the .cluster file containing spike time recordings.

  • cellType (str) – Cell type.

  • ongoingRate (float) – The ongoing firing rate for this cell type.

  • outFileName (str) – Filename to write to.

Example

>>> create\_evoked\_PSTH(
    'getting\_started/example\_data/functional\_constraints/evoked\_activity/L5tt/L5tt\_84/C1\_040929-129-ctx.cluster1',
    cellType='L5tt',
    ongoingrate=2.64,
    outFileName='PSTH.param')
>>> with open('PSTH.param', 'r) as f:
...     content = f.readlines()
>>> print(content)
{
    "L5tt\_B1": {
        "distribution": "PSTH",
        "intervals": [(0.0,1.0),(1.0,2.0),(2.0,3.0),(3.0,4.0),(4.0,5.0),(5.0,6.0),(6.0,7.0),(7.0,8.0),(8.0,9.0),(9.0,10.0),(10.0,11.0),(11.0,12.0),(12.0,13.0),(13.0,14.0),(14.0,15.0),(15.0,16.0),(16.0,17.0),(17.0,18.0),(18.0,19.0),(19.0,20.0),(20.0,21.0),(21.0,22.0),(22.0,23.0),(23.0,24.0),(24.0,25.0),(25.0,26.0),(26.0,27.0),(27.0,28.0),(28.0,29.0),(29.0,30.0),(30.0,31.0),(31.0,32.0),(32.0,33.0),(33.0,34.0),(34.0,35.0),(35.0,36.0),(36.0,37.0),(37.0,38.0),(38.0,39.0),(39.0,40.0),(40.0,41.0),(41.0,42.0),(42.0,43.0),(43.0,44.0),(44.0,45.0),(45.0,46.0),(46.0,47.0),(47.0,48.0),(48.0,49.0),(49.0,50.0)],
        "probabilities": [-0.0000,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,0.0227,-0.0000,0.0227,0.0227,0.0227,-0.0000,-0.0000,-0.0000,-0.0000],
    },
    "L5tt\_B2": {
        "distribution": "PSTH",
        "intervals": [(0.0,1.0),(1.0,2.0),(2.0,3.0),(3.0,4.0),(4.0,5.0),(5.0,6.0),(6.0,7.0),(7.0,8.0),(8.0,9.0),(9.0,10.0),(10.0,11.0),(11.0,12.0),(12.0,13.0),(13.0,14.0),(14.0,15.0),(15.0,16.0),(16.0,17.0),(17.0,18.0),(18.0,19.0),(19.0,20.0),(20.0,21.0),(21.0,22.0),(22.0,23.0),(23.0,24.0),(24.0,25.0),(25.0,26.0),(26.0,27.0),(27.0,28.0),(28.0,29.0),(29.0,30.0),(30.0,31.0),(31.0,32.0),(32.0,33.0),(33.0,34.0),(34.0,35.0),(35.0,36.0),(36.0,37.0),(37.0,38.0),(38.0,39.0),(39.0,40.0),(40.0,41.0),(41.0,42.0),(42.0,43.0),(43.0,44.0),(44.0,45.0),(45.0,46.0),(46.0,47.0),(47.0,48.0),(48.0,49.0),(49.0,50.0)],
        "probabilities": [0.1363,0.0227,0.0227,0.0227,0.0909,0.0909,0.1136,0.0227,0.0227,0.0227,0.0227,0.0227,0.0454,0.0454,0.0227,0.0682,0.0909,0.0454,0.0454,0.0227,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000,-0.0000],
    },
    "L5tt\_B3": {...},
    ...
}