Beispiel #1
0
Script analyzes HVC-RA neuron population activity in the network
"""
import matplotlib.pyplot as plt
import reading
import os
import numpy as np
import utils

dirname = "/home/eugene/Output/networks/chainGrowth/testGrowthDelays/"
trial_number = 350
fileActivityHistory = os.path.join(
    dirname, "activity_history_" + str(trial_number) + ".bin")
fileTraining = os.path.join(dirname, "training_neurons.bin")

(_, _, activity_history) = reading.read_activity_history(fileActivityHistory)
training_neurons = reading.read_training_neurons(fileTraining)

np.set_printoptions(threshold=np.nan)

#print activity_history[0][0:10]
#print activity_history[0:100,0:100]

#print activity_history

# check that activity is reasonable
print "Negative numbers in activity: ", np.any(activity_history < 0)
print "Large positive numbers in activity: ", np.any(activity_history > 10)

num_neurons = activity_history.shape[0]
history_size = activity_history.shape[1]
Beispiel #2
0
(_, _, axonal_delays_I2RA_from_delay_file_after
 ) = reading.read_axonal_delays(fileAxonalDelaysI2RAAfter)

(_, _, axonal_delays_RA2RA_from_delay_file_before
 ) = reading.read_axonal_delays(fileAxonalDelaysRA2RABefore)
(_, _, axonal_delays_RA2RA_from_delay_file_after
 ) = reading.read_axonal_delays(fileAxonalDelaysRA2RAAfter)

(_, _, axonal_delays_RA2I_from_delay_file_before
 ) = reading.read_axonal_delays(fileAxonalDelaysRA2IBefore)
(_, _, axonal_delays_RA2I_from_delay_file_after
 ) = reading.read_axonal_delays(fileAxonalDelaysRA2IAfter)

################## Activity History ###################
(_, _, activity_history_before
 ) = reading.read_activity_history(fileActivityHistoryBefore)
(_, _, activity_history_after
 ) = reading.read_activity_history(fileActivityHistoryAfter)

################# Replacement History ##################
(_, _, replacement_history_before
 ) = reading.read_replacement_history(fileReplacementHistoryBefore)
(_, _, replacement_history_after
 ) = reading.read_replacement_history(fileReplacementHistoryAfter)

################# Axon-remodeling indicators ###########
(_, _, remodeled_indicators_before
 ) = reading.read_remodeled_indicators(fileRemodeledIndicatorsBefore)
(_, _, remodeled_indicators_after
 ) = reading.read_remodeled_indicators(fileRemodeledIndicatorsAfter)
Beispiel #3
0
def analyze_inhibitory_input_history(dataDir, testDataDir, trial):
    """
    Function compares inhibitory conductance of neurons with 
    conductances of the neurons that burst later
    """
    N_RA, N_I = reading.read_num_neurons(
        os.path.join(dataDir, "num_neurons.bin"))
    training_neurons = set(
        reading.read_training_neurons(
            os.path.join(dataDir, "training_neurons.bin")))

    _, _, activity_history = reading.read_activity_history(
        os.path.join(dataDir, "activity_history_" + str(trial) + ".bin"))

    smoothWindowSize = 25
    smooth_activity_history = np.apply_along_axis(moving_average, 1,
                                                  activity_history,
                                                  smoothWindowSize)

    #print np.any(smooth_activity_history[4] >= 1.0)
    recruited_candidates = np.where(
        np.any(smooth_activity_history[:, smoothWindowSize:] >= 1, axis=1))[0]

    recruited = [c for c in recruited_candidates if c not in training_neurons]
    print training_neurons

    smooth_activity_history = smooth_activity_history[:, trial:
                                                      smoothWindowSize:-1]

    recruitment_time = []
    for r in recruited:
        recruitment_time.append(
            np.where(smooth_activity_history[r] >= 1)[0][0])

    #print recruitment_time



    _, _, \
        _, _, mean_first_soma_spike_time, _,\
        _, _, _, _ = reading.read_jitter(os.path.join(testDataDir, "jitter.bin"))

    recruitment_time, recruited = zip(
        *sorted(zip(recruitment_time, recruited)))

    first_soma_spike_time_recruited = mean_first_soma_spike_time[recruited]

    print zip(recruited, recruitment_time, first_soma_spike_time_recruited)

    trialsBefore = 95
    laterSpiking = 20.0

    for rid, rtime, rfirstSpikeTime in zip(recruited, recruitment_time,
                                           first_soma_spike_time_recruited):
        laterSpikedNeurons = set(
            np.array(recruited)[first_soma_spike_time_recruited >=
                                rfirstSpikeTime + laterSpiking])

        for trialNum in range(rtime - trialsBefore, rtime):
            t, Ginh_d = reading.read_inhibitory_conductance_during_trial(
                os.path.join(dataDir, "Ginh_trial_" + str(trialNum) + ".bin"))

            for nid in laterSpikeNeurons:
                pass

        break