-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcounting_subclasses.py
162 lines (150 loc) · 3.86 KB
/
counting_subclasses.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#This will count all the sequences and isotypes in the _pep files. It will print them.
#[email protected]:/srv/gsfs0/projects/snyder/slancast/repertoire
import sys
print("###################")
print("###################")
print("###################")
print(sys.argv[4])
print("###################")
print("###################")
print("###################")
####################################################################
filehandle=open(sys.argv[1], "r")
Totcount = 0
Mcount = 0
Gcount = 0
Acount = 0
Dcount = 0
Ecount = 0
G1count = 0
G2count = 0
G3count = 0
G4count = 0
a = None
while (a is None or len(a) >1):
a=filehandle.readline()
a=a.split(",")
if len(a)>21 and a[0] != "CDR3(pep)":
if len(a[16]) > 3:
Totcount = Totcount + 1
if a[16][4] == "M":
Mcount = Mcount + 1
if a[16][4] == "G":
Gcount = Gcount + 1
if a[16][5] == "1":
G1count = G1count + 1
if a[16][5] == "2":
G2count = G2count + 1
if a[16][5] == "3":
G3count = G3count + 1
if a[16][5] == "4":
G4count = G4count + 1
if a[16][4] == "A":
Acount = Acount + 1
if a[16][4] == "D":
Dcount = Dcount + 1
if a[16][4] == "E":
Ecount = Ecount + 1
print("T1 IgM count: " + str(Mcount))
print("T1 IgG count: " + str(Gcount))
print("T1 IgG1 count: " + str(G1count))
print("T1 IgG2 count: " + str(G2count))
print("T1 IgG3 count: " + str(G3count))
print("T1 IgG4 count: " + str(G4count))
print("T1 IgA count: " + str(Acount))
print("T1 IgD count: " + str(Dcount))
print("T1 IgE count: " + str(Ecount))
print("")
####################################################################
filehandle=open(sys.argv[2], "r")
Totcount = 0
Mcount = 0
Gcount = 0
Acount = 0
Dcount = 0
Ecount = 0
G1count = 0
G2count = 0
G3count = 0
G4count = 0
a = None
while (a is None or len(a) >1):
a=filehandle.readline()
a=a.split(",")
if len(a)>21 and a[0] != "CDR3(pep)":
if len(a[16]) > 3:
Totcount = Totcount + 1
if a[16][4] == "M":
Mcount = Mcount + 1
if a[16][4] == "G":
Gcount = Gcount + 1
if a[16][5] == "1":
G1count = G1count + 1
if a[16][5] == "2":
G2count = G2count + 1
if a[16][5] == "3":
G3count = G3count + 1
if a[16][5] == "4":
G4count = G4count + 1
if a[16][4] == "A":
Acount = Acount + 1
if a[16][4] == "D":
Dcount = Dcount + 1
if a[16][4] == "E":
Ecount = Ecount + 1
print("T2 IgM count: " + str(Mcount))
print("T2 IgG count: " + str(Gcount))
print("T2 IgG1 count: " + str(G1count))
print("T2 IgG2 count: " + str(G2count))
print("T2 IgG3 count: " + str(G3count))
print("T2 IgG4 count: " + str(G4count))
print("T2 IgA count: " + str(Acount))
print("T2 IgD count: " + str(Dcount))
print("T2 IgE count: " + str(Ecount))
print("")
####################################################################
filehandle=open(sys.argv[3], "r")
Totcount = 0
Mcount = 0
Gcount = 0
Acount = 0
Dcount = 0
Ecount = 0
G1count = 0
G2count = 0
G3count = 0
G4count = 0
a = None
while (a is None or len(a) >1):
a=filehandle.readline()
a=a.split(",")
if len(a)>21 and a[0] != "CDR3(pep)":
if len(a[16]) > 3:
Totcount = Totcount + 1
if a[16][4] == "M":
Mcount = Mcount + 1
if a[16][4] == "G":
Gcount = Gcount + 1
if a[16][5] == "1":
G1count = G1count + 1
if a[16][5] == "2":
G2count = G2count + 1
if a[16][5] == "3":
G3count = G3count + 1
if a[16][5] == "4":
G4count = G4count + 1
if a[16][4] == "A":
Acount = Acount + 1
if a[16][4] == "D":
Dcount = Dcount + 1
if a[16][4] == "E":
Ecount = Ecount + 1
print("T3 IgM count: " + str(Mcount))
print("T3 IgG count: " + str(Gcount))
print("T3 IgG1 count: " + str(G1count))
print("T3 IgG2 count: " + str(G2count))
print("T3 IgG3 count: " + str(G3count))
print("T3 IgG4 count: " + str(G4count))
print("T3 IgA count: " + str(Acount))
print("T3 IgD count: " + str(Dcount))
print("T3 IgE count: " + str(Ecount))