Ejemplo n.º 1
0
#	 goal: Figure out how to get the cell specimen data specifically for nm3 session A stimuli associated
#         with ophy_experiment_id: 570305847, experiment_container_id: 566759225

##	 Remember: you have downloaded the NWB data for an experiment. You need to get the fluorecent traces
##   of the cells from this data

# 1: begin analysis using the
# 	 natural_movie class. nm3 will be a NaturalMovie object.
##   It will be important to ensure whether or not passing in the moview_name arguement
##   is necessary for data analysis of information 'I know' is recorded from the
##   natural movie three stimulus. I believe the 'movie_name' param is neccessary
##   because of the whole tuning analysis to a specific movie which is a big part of this class
nm3_object = NaturalMovie(session_A_data, stim_info.NATURAL_MOVIE_THREE)

#  2: grab the sweep response from the nm3_object and convert it to a pandas dataframe
sweep_response = nm3_object.get_sweep_response()
sweep_response = pd.DataFrame.from_records(sweep_response)

# print len(sweep_response.iloc[0][0])
# print sweep_response.iloc[1][0]
# __________________________________________________________________________________
print '\n##############'
print ' Part IV'
print '##############\n'

# 	 goal: using the sweep responce information, create traces of a cell for all 10 trials

# 	 remember: the sweep_response dataframe is a trial(i) X cell matrix(j), 0 = i < 10, and 0 = j < 181.
#    Also, Response(ij) in the matrix is an array. for each Response(ij), there are 3622 point in the array,
#    which represents 3622 frames, and is approx 2 minutes worth of data. Since there are 10 rows, for 10
#	 trials, we have a total of 19.921 minutes worth of data.
Ejemplo n.º 2
0
# ___________________________________________________________________________________________________
# PART III: Mess around with the Natural Movie class
print '\n******************'
print '     PART III     '
print '******************\n'

# access the NaturalMovie class
nm = NaturalMovie(data_set, stim_info.NATURAL_MOVIE_THREE)
# print 'Natural Movie class has the following characteristics'
# print nm.movie_name
# print nm._sweeplength
# print nm._sweep_response
# print str(nm.__dict__)
# print '----------------------------'
sweep_response = pd.DataFrame.from_records(
    nm.get_sweep_response())  #turned the numpy array into a pandas dataframe
# print sweep_response #the sweep response numpy array contains the dF/F response for each cell
# print 'sweep length is: ' + str(nm.sweeplength)
# print ' lets try this peak thing again \n' + str(pd.DataFrame.from_records(nm.get_peak()))

# with sweep response, we can export that to a csv file to get a good look at it
sweep_response.to_csv('Sweep_Response_Data.csv', index=True, header=True)

# try to grab some of the information from sweep_response
# print 'here is the 0 col:'
# print sweep_response['0']

# print '\nhere is the 1 col'
# print sweep_response['1']

# print 'here is the 0 row:'