Exemplo n.º 1
0
#write csvs
def write_csv(fh, data, description, units='connection probability %'):
    """Used to generate csv file accompanying figure.
    """
    if isinstance(data, Trace):
        write_csv(fh, data, description + "distance(um)")
        write_csv(fh, data, description + " %s" % units)
    else:
        cols = ['"' + description + '"'] + list(data)
        line = ','.join(map(str, cols))
        fh.write(line)
        fh.write('\n')


all_expts = ExperimentList(cache=cache_file)

mouse_expts = all_expts.select(calcium='high', age='40-1000', organism='mouse')
human_expts = all_expts.select(organism='human')

pg.mkQApp()

mouse_ee_types = OrderedDict([
    (('2/3', 'unknown'), 'L23pyr'),
    ((None, 'rorb'), 'rorb'),
    ((None, 'sim1'), 'sim1'),
    ((None, 'tlx3'), 'tlx3'),
    ((None, 'ntsr1'), 'ntsr1'),
])

human_types = OrderedDict([
Exemplo n.º 2
0
parser.add_argument('--list-stims', action='store_true', default=False, dest='list_stims',
                    help='print a list of each connection and the stimulus sets acquired')
parser.add_argument('--sweep-threshold', nargs = '*', type=int, action='store', default=[5,10], dest='sweep_threshold',
                    help='Combined with --list-stims, for each connection type, prints the number of connections '
                         'for which there are >= sweep_threshold number of sweeps/stimulus set. Two thresholds '
                         'are set one for induction protocols (default=5) and one for recovery (default=10')
parser.add_argument('files', nargs='*', type=os.path.abspath)
parser.add_argument('--cre-type', nargs=2, type=str)
parser.add_argument('--calcium', type=str,
                    help='define external calcium concentration as "Low", "High"')
parser.add_argument('--age', type=str, help='Define age as a range from min to max.  Ex age=30-40')
parser.add_argument('--temp', type=int)

args = parser.parse_args(sys.argv[1:])

all_expts = ExperimentList(cache=cache_file)

if args.reload:
    all_expts.load_from_server()

if args.reload_old:
    files = config.summary_files
    if len(files) == 0:
        print("No old-format summary files given in config.yml:summary_files")
        sys.exit(-1)
    for f in files:
        all_expts.load(f)
    
for f in args.files:
    all_expts.load(f)
Exemplo n.º 3
0
import sys
import pyqtgraph as pg
from multipatch_analysis.experiment_list import ExperimentList
from multipatch_analysis.synaptic_dynamics import DynamicsAnalyzer

if __name__ == '__main__':
    app = pg.mkQApp()
    pg.dbg()

    expt_ind = sys.argv[1]
    all_expts = ExperimentList(cache='expts_cache.pkl')
    expt = all_expts[expt_ind]

    pre_cell = int(sys.argv[2])
    post_cell = int(sys.argv[3])

    method = 'fit' if '--no-deconv' in sys.argv else 'deconv'

    analyzer = DynamicsAnalyzer(expt, pre_cell, post_cell, method=method)
    if len(analyzer.pulse_responses) == 0:
        raise Exception(
            "No suitable data found for cell %d -> cell %d in expt %s" %
            (pre_cell, post_cell, expt_ind))

    # Plot all individual and averaged train responses for all sets of stimulus parameters
    train_plots = analyzer.plot_train_responses()

    if '--no-fit' in sys.argv:
        sys.exit(0)  # user requested no fitting; bail out early

    if '--no-deconv' in sys.argv:
Exemplo n.º 4
0
                    action='store_true',
                    default=False,
                    dest='trains',
                    help='plot 50Hz train and deconvolution')
parser.add_argument('--link-y-axis',
                    action='store_true',
                    default=False,
                    dest='link-y-axis',
                    help='link all y-axis down a column')

args = vars(parser.parse_args(sys.argv[1:]))
plot_sweeps = args['sweeps']
plot_trains = args['trains']
link_y_axis = args['link-y-axis']
expt_cache = 'C:/Users/Stephanies/multipatch_analysis/tools/expts_cache.pkl'
all_expts = ExperimentList(cache=expt_cache)

test = PlotGrid()
test.set_shape(len(connection_types.keys()), 1)
test.show()
grid = PlotGrid()
if plot_trains is True:
    grid.set_shape(len(connection_types.keys()), 3)
    grid[0, 1].setTitle(title='50 Hz Train')
    grid[0, 2].setTitle(title='Exponential Deconvolution')
    tau = 15e-3
    lp = 1000
else:
    grid.set_shape(len(connection_types.keys()), 2)
grid.show()
row = 0
parser.add_argument('--list-stims', action='store_true', default=False, dest='list_stims',
                    help='print a list of each connection and the stimulus sets acquired')
parser.add_argument('--sweep-threshold', nargs = '*', type=int, action='store', default=[5,10], dest='sweep_threshold',
                    help='Combined with --list-stims, for each connection type, prints the number of connections '
                         'for which there are >= sweep_threshold number of sweeps/stimulus set. Two thresholds '
                         'are set one for induction protocols (default=5) and one for recovery (default=10')
parser.add_argument('files', nargs='*', type=os.path.abspath)
parser.add_argument('--cre-type', nargs=2, type=str)
parser.add_argument('--calcium', type=str,
                    help='define external calcium concentration as "Low", "High"')
parser.add_argument('--age', type=str, help='Define age as a range from min to max.  Ex age=30-40')
parser.add_argument('--temp', type=int)

args = parser.parse_args(sys.argv[1:])

all_expts = ExperimentList(cache=cache_file)

if args.reload:
    all_expts.load_from_server()

if args.reload_old:
    files = config.summary_files
    if len(files) == 0:
        print("No old-format summary files given in config.yml:summary_files")
        sys.exit(-1)
    for f in files:
        all_expts.load(f)
    
for f in args.files:
    all_expts.load(f)