-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathchannelanalysis.py
More file actions
37 lines (32 loc) · 1.03 KB
/
channelanalysis.py
File metadata and controls
37 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#Author D.Kufel
#Date: 09/08/2016
'''
File to analyze the data from the Monte Carlo simulation - calculating the average fraction of channels in any state. Used to find the fraction of unbound channels (Figure 4).
'''
statelist=["C0","C1","C2","C3","C4","O1","O2","O3","O4","D1","D2","D3","D4"]
for state in statelist:
file=open("Average_AMPA_"+state+"_25.dat",'w')
import csv
listaverages=[]
csv_reader0=csv.reader(open("AMPAR_"+state+"_001_001.dat"),delimiter=" ")
for row in csv_reader0:
listaverages.append(float(row[1]))
for vesicle in range(1,10):
for run_number in range(1,41):
if vesicle!=1 and run_number!=1:
nStrv=str(vesicle).rjust(3, '0')
nStrr=str(run_number).rjust(3, '0')
name="AMPAR_"+state+"_"+nStrv+"_"+nStrr+".dat"
print(name)
csv_reader=csv.reader(open(name), delimiter=" ")
counter=0
for row in csv_reader:
listaverages[counter]+=float(row[1])
counter+=1
i=0
for k in listaverages:
file.write(str(i))
file.write(" ")
file.write(str(k/360.))
file.write("\n")
i+=1