-
Notifications
You must be signed in to change notification settings - Fork 1
/
ca-cmp2.py
executable file
·59 lines (40 loc) · 1.58 KB
/
ca-cmp2.py
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python
# coding=utf-8
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import argparse
import pandas as pd
import matplotlib.pyplot as plt
from ca.util import get_nb_condition
from ca.cmd import RangedAction
from ca.nix import *
from ca.img import *
pulses = [1, 3, 10, 25]
def main():
parser = argparse.ArgumentParser(description="")
parser.add_argument('--style', nargs='*', type=str, default=['ck'])
parser.add_argument("imaging")
parser.add_argument('x', type=str)
parser.add_argument('y', type=str)
parser.add_argument("--pulse", choices=map(lambda p: 'ap'+str(p), pulses), default='ap25')
parser.add_argument("--age", action=RangedAction, type=str, default=None)
parser.add_argument("--noisebox", default=False, action='store_true')
args = parser.parse_args()
plt.style.use(args.style)
result = pd.read_csv(args.imaging)
if args.age is not None:
result = result.loc[result['Age'].isin(list(map(lambda a: int(a), args.age)))]
nbcond = get_nb_condition(result)
noisebox = result.loc[result['Condition'] == nbcond]
result = result.loc[result['Condition'] == "control"]
plt.scatter(result[args.x], result[args.y], c=result[args.pulse], cmap='plasma')
if args.noisebox:
plt.scatter(noisebox[args.x], noisebox[args.y], c=noisebox[args.pulse],
facecolors='none', marker='+', lw=1.2, cmap='plasma')
plt.xlabel(args.x)
plt.ylabel(args.y)
plt.colorbar()
plt.show()
if __name__ == "__main__":
main()