1 |
duarte |
123 |
package proteinstructure; |
2 |
|
|
import java.util.HashMap; |
3 |
|
|
import java.util.ArrayList; |
4 |
|
|
|
5 |
|
|
public class AA { |
6 |
|
|
|
7 |
duarte |
195 |
public static String[] contactTypes() { |
8 |
duarte |
194 |
// NOTE: whenever a new contact type is added it needs to be added here as well as in ct2atoms |
9 |
duarte |
195 |
String[] cts ={"ALL","BB","SC","Ca","Cb","Cg","C"}; |
10 |
duarte |
194 |
return cts; |
11 |
duarte |
126 |
} |
12 |
duarte |
123 |
|
13 |
duarte |
200 |
public static String[] singleAtomContactTypes() { |
14 |
|
|
// NOTE: whenever a new contact type is added it needs to be added here as well as in ct2atoms |
15 |
|
|
String[] cts ={"Ca","Cb","Cg","C"}; |
16 |
|
|
return cts; |
17 |
|
|
} |
18 |
|
|
|
19 |
|
|
public static String[] multiAtomContactTypes() { |
20 |
|
|
// NOTE: whenever a new contact type is added it needs to be added here as well as in ct2atoms |
21 |
|
|
String[] cts ={"ALL","BB","SC"}; |
22 |
|
|
return cts; |
23 |
|
|
} |
24 |
duarte |
194 |
|
25 |
duarte |
200 |
/** |
26 |
|
|
* Returns true if given contact type is a valid one |
27 |
|
|
* @param ct |
28 |
|
|
* @return |
29 |
|
|
*/ |
30 |
|
|
public static boolean isValidCT(String ct){ |
31 |
|
|
for (String validCt:contactTypes()){ |
32 |
|
|
if (ct.equals(validCt)) return true; |
33 |
|
|
} |
34 |
|
|
return false; |
35 |
|
|
} |
36 |
|
|
|
37 |
|
|
/** |
38 |
|
|
* Returns true if given contact type is a valid single atom contact type |
39 |
|
|
* @param ct |
40 |
|
|
* @return |
41 |
|
|
*/ |
42 |
|
|
public static boolean isValidSingleAtomCT(String ct) { |
43 |
|
|
for (String validCt:singleAtomContactTypes()){ |
44 |
|
|
if (ct.equals(validCt)) return true; |
45 |
|
|
} |
46 |
|
|
return false; |
47 |
|
|
} |
48 |
|
|
|
49 |
|
|
/** |
50 |
|
|
* Returns true if given contact type is a valid multiple atom contact type |
51 |
|
|
* @param ct |
52 |
|
|
* @return |
53 |
|
|
*/ |
54 |
|
|
public static boolean isValidMultiAtomCT(String ct) { |
55 |
|
|
for (String validCt:multiAtomContactTypes()){ |
56 |
|
|
if (ct.equals(validCt)) return true; |
57 |
|
|
} |
58 |
|
|
return false; |
59 |
|
|
} |
60 |
|
|
|
61 |
duarte |
194 |
private static HashMap<String,String> getThreeletter2oneletter() { |
62 |
duarte |
123 |
HashMap<String,String> three2oneletter = new HashMap<String,String>(); |
63 |
|
|
three2oneletter.put("CYS", "C"); |
64 |
|
|
three2oneletter.put("ASP", "D"); |
65 |
|
|
three2oneletter.put("SER", "S"); |
66 |
|
|
three2oneletter.put("GLN", "Q"); |
67 |
|
|
three2oneletter.put("LYS", "K"); |
68 |
|
|
three2oneletter.put("ILE", "I"); |
69 |
|
|
three2oneletter.put("PRO", "P"); |
70 |
|
|
three2oneletter.put("THR", "T"); |
71 |
|
|
three2oneletter.put("PHE", "F"); |
72 |
|
|
three2oneletter.put("ALA", "A"); |
73 |
|
|
three2oneletter.put("GLY", "G"); |
74 |
|
|
three2oneletter.put("HIS", "H"); |
75 |
|
|
three2oneletter.put("GLU", "E"); |
76 |
|
|
three2oneletter.put("LEU", "L"); |
77 |
|
|
three2oneletter.put("ARG", "R"); |
78 |
|
|
three2oneletter.put("TRP", "W"); |
79 |
|
|
three2oneletter.put("VAL", "V"); |
80 |
|
|
three2oneletter.put("ASN", "N"); |
81 |
|
|
three2oneletter.put("TYR", "Y") ; |
82 |
|
|
three2oneletter.put("MET", "M"); |
83 |
|
|
return three2oneletter; |
84 |
|
|
} |
85 |
|
|
|
86 |
|
|
public static String threeletter2oneletter(String three) { |
87 |
|
|
HashMap<String,String> three2oneletter = getThreeletter2oneletter(); |
88 |
|
|
return three2oneletter.get(three); |
89 |
|
|
} |
90 |
|
|
|
91 |
duarte |
194 |
private static HashMap<String,String> getOneletter2Threeletter(){ |
92 |
duarte |
135 |
HashMap<String,String> one2threeletter = new HashMap<String,String>(); |
93 |
|
|
one2threeletter.put("C", "CYS"); |
94 |
|
|
one2threeletter.put("D", "ASP"); |
95 |
|
|
one2threeletter.put("S", "SER"); |
96 |
|
|
one2threeletter.put("Q", "GLN"); |
97 |
|
|
one2threeletter.put("K", "LYS"); |
98 |
|
|
one2threeletter.put("I", "ILE"); |
99 |
|
|
one2threeletter.put("P", "PRO"); |
100 |
|
|
one2threeletter.put("T", "THR"); |
101 |
|
|
one2threeletter.put("F", "PHE"); |
102 |
|
|
one2threeletter.put("A", "ALA"); |
103 |
|
|
one2threeletter.put("G", "GLY"); |
104 |
|
|
one2threeletter.put("H", "HIS"); |
105 |
|
|
one2threeletter.put("E", "GLU"); |
106 |
|
|
one2threeletter.put("L", "LEU"); |
107 |
|
|
one2threeletter.put("R", "ARG"); |
108 |
|
|
one2threeletter.put("W", "TRP"); |
109 |
|
|
one2threeletter.put("V", "VAL"); |
110 |
|
|
one2threeletter.put("N", "ASN"); |
111 |
|
|
one2threeletter.put("Y", "TYR"); |
112 |
|
|
one2threeletter.put("M", "MET"); |
113 |
|
|
return one2threeletter; |
114 |
|
|
} |
115 |
|
|
|
116 |
|
|
public static String oneletter2threeletter(String one) { |
117 |
|
|
HashMap<String,String> one2threeletter = getOneletter2Threeletter(); |
118 |
|
|
return one2threeletter.get(one); |
119 |
|
|
} |
120 |
|
|
|
121 |
duarte |
123 |
public static ArrayList<String> aas() { |
122 |
|
|
HashMap<String,String> three2oneletter = getThreeletter2oneletter(); |
123 |
|
|
ArrayList<String> aas = new ArrayList<String>(); |
124 |
|
|
for (String aa:three2oneletter.keySet()) { |
125 |
|
|
aas.add(aa); |
126 |
|
|
} |
127 |
|
|
return aas; |
128 |
|
|
} |
129 |
|
|
|
130 |
|
|
public static HashMap<String,ArrayList<String>> getaas2atoms() { |
131 |
|
|
HashMap<String,ArrayList<String>> aas2atoms = new HashMap<String,ArrayList<String>>(); |
132 |
duarte |
198 |
aas2atoms.put("CYS", new ArrayList<String>()); |
133 |
|
|
aas2atoms.get("CYS").add("SG"); |
134 |
|
|
aas2atoms.get("CYS").add("CB"); |
135 |
|
|
aas2atoms.get("CYS").add("O"); |
136 |
|
|
aas2atoms.get("CYS").add("CA"); |
137 |
|
|
aas2atoms.get("CYS").add("C"); |
138 |
|
|
aas2atoms.get("CYS").add("N"); |
139 |
|
|
aas2atoms.put("ASP", new ArrayList<String>()); |
140 |
|
|
aas2atoms.get("ASP").add("N"); |
141 |
|
|
aas2atoms.get("ASP").add("CB"); |
142 |
|
|
aas2atoms.get("ASP").add("OD2"); |
143 |
|
|
aas2atoms.get("ASP").add("CG"); |
144 |
|
|
aas2atoms.get("ASP").add("CA"); |
145 |
|
|
aas2atoms.get("ASP").add("C"); |
146 |
|
|
aas2atoms.get("ASP").add("O"); |
147 |
|
|
aas2atoms.get("ASP").add("OD1"); |
148 |
|
|
aas2atoms.put("SER", new ArrayList<String>()); |
149 |
|
|
aas2atoms.get("SER").add("C"); |
150 |
|
|
aas2atoms.get("SER").add("N"); |
151 |
|
|
aas2atoms.get("SER").add("CA"); |
152 |
|
|
aas2atoms.get("SER").add("O"); |
153 |
|
|
aas2atoms.get("SER").add("CB"); |
154 |
|
|
aas2atoms.get("SER").add("OG"); |
155 |
|
|
aas2atoms.put("GLN", new ArrayList<String>()); |
156 |
|
|
aas2atoms.get("GLN").add("CA"); |
157 |
|
|
aas2atoms.get("GLN").add("CG"); |
158 |
|
|
aas2atoms.get("GLN").add("N"); |
159 |
|
|
aas2atoms.get("GLN").add("NE2"); |
160 |
|
|
aas2atoms.get("GLN").add("OE1"); |
161 |
|
|
aas2atoms.get("GLN").add("CD"); |
162 |
|
|
aas2atoms.get("GLN").add("C"); |
163 |
|
|
aas2atoms.get("GLN").add("O"); |
164 |
|
|
aas2atoms.get("GLN").add("CB"); |
165 |
|
|
aas2atoms.put("LYS", new ArrayList<String>()); |
166 |
|
|
aas2atoms.get("LYS").add("C"); |
167 |
|
|
aas2atoms.get("LYS").add("CA"); |
168 |
|
|
aas2atoms.get("LYS").add("N"); |
169 |
|
|
aas2atoms.get("LYS").add("O"); |
170 |
|
|
aas2atoms.get("LYS").add("CB"); |
171 |
|
|
aas2atoms.get("LYS").add("CG"); |
172 |
|
|
aas2atoms.get("LYS").add("CD"); |
173 |
|
|
aas2atoms.get("LYS").add("CE"); |
174 |
|
|
aas2atoms.get("LYS").add("NZ"); |
175 |
|
|
aas2atoms.put("ASN", new ArrayList<String>()); |
176 |
|
|
aas2atoms.get("ASN").add("ND2"); |
177 |
|
|
aas2atoms.get("ASN").add("OD1"); |
178 |
|
|
aas2atoms.get("ASN").add("CB"); |
179 |
|
|
aas2atoms.get("ASN").add("O"); |
180 |
|
|
aas2atoms.get("ASN").add("CG"); |
181 |
|
|
aas2atoms.get("ASN").add("C"); |
182 |
|
|
aas2atoms.get("ASN").add("CA"); |
183 |
|
|
aas2atoms.get("ASN").add("N"); |
184 |
|
|
aas2atoms.put("PRO", new ArrayList<String>()); |
185 |
|
|
aas2atoms.get("PRO").add("O"); |
186 |
|
|
aas2atoms.get("PRO").add("C"); |
187 |
|
|
aas2atoms.get("PRO").add("CB"); |
188 |
|
|
aas2atoms.get("PRO").add("CG"); |
189 |
|
|
aas2atoms.get("PRO").add("CA"); |
190 |
|
|
aas2atoms.get("PRO").add("CD"); |
191 |
|
|
aas2atoms.get("PRO").add("N"); |
192 |
|
|
aas2atoms.put("THR", new ArrayList<String>()); |
193 |
|
|
aas2atoms.get("THR").add("CA"); |
194 |
|
|
aas2atoms.get("THR").add("N"); |
195 |
|
|
aas2atoms.get("THR").add("C"); |
196 |
|
|
aas2atoms.get("THR").add("CG2"); |
197 |
|
|
aas2atoms.get("THR").add("OG1"); |
198 |
|
|
aas2atoms.get("THR").add("CB"); |
199 |
|
|
aas2atoms.get("THR").add("O"); |
200 |
|
|
aas2atoms.put("PHE", new ArrayList<String>()); |
201 |
|
|
aas2atoms.get("PHE").add("O"); |
202 |
|
|
aas2atoms.get("PHE").add("CE2"); |
203 |
|
|
aas2atoms.get("PHE").add("CE1"); |
204 |
|
|
aas2atoms.get("PHE").add("CG"); |
205 |
|
|
aas2atoms.get("PHE").add("C"); |
206 |
|
|
aas2atoms.get("PHE").add("N"); |
207 |
|
|
aas2atoms.get("PHE").add("CA"); |
208 |
|
|
aas2atoms.get("PHE").add("CB"); |
209 |
|
|
aas2atoms.get("PHE").add("CD2"); |
210 |
|
|
aas2atoms.get("PHE").add("CD1"); |
211 |
|
|
aas2atoms.get("PHE").add("CZ"); |
212 |
|
|
aas2atoms.put("ALA", new ArrayList<String>()); |
213 |
|
|
aas2atoms.get("ALA").add("CA"); |
214 |
|
|
aas2atoms.get("ALA").add("C"); |
215 |
|
|
aas2atoms.get("ALA").add("N"); |
216 |
|
|
aas2atoms.get("ALA").add("CB"); |
217 |
|
|
aas2atoms.get("ALA").add("O"); |
218 |
|
|
aas2atoms.put("HIS", new ArrayList<String>()); |
219 |
|
|
aas2atoms.get("HIS").add("CE1"); |
220 |
|
|
aas2atoms.get("HIS").add("CD2"); |
221 |
|
|
aas2atoms.get("HIS").add("ND1"); |
222 |
|
|
aas2atoms.get("HIS").add("CG"); |
223 |
|
|
aas2atoms.get("HIS").add("CB"); |
224 |
|
|
aas2atoms.get("HIS").add("O"); |
225 |
|
|
aas2atoms.get("HIS").add("C"); |
226 |
|
|
aas2atoms.get("HIS").add("CA"); |
227 |
|
|
aas2atoms.get("HIS").add("N"); |
228 |
|
|
aas2atoms.get("HIS").add("NE2"); |
229 |
|
|
aas2atoms.put("GLY", new ArrayList<String>()); |
230 |
|
|
aas2atoms.get("GLY").add("N"); |
231 |
|
|
aas2atoms.get("GLY").add("CA"); |
232 |
|
|
aas2atoms.get("GLY").add("C"); |
233 |
|
|
aas2atoms.get("GLY").add("O"); |
234 |
|
|
aas2atoms.put("ILE", new ArrayList<String>()); |
235 |
|
|
aas2atoms.get("ILE").add("CG2"); |
236 |
|
|
aas2atoms.get("ILE").add("CD1"); |
237 |
|
|
aas2atoms.get("ILE").add("O"); |
238 |
|
|
aas2atoms.get("ILE").add("N"); |
239 |
|
|
aas2atoms.get("ILE").add("CA"); |
240 |
|
|
aas2atoms.get("ILE").add("C"); |
241 |
|
|
aas2atoms.get("ILE").add("CB"); |
242 |
|
|
aas2atoms.get("ILE").add("CG1"); |
243 |
|
|
aas2atoms.put("LEU", new ArrayList<String>()); |
244 |
|
|
aas2atoms.get("LEU").add("N"); |
245 |
|
|
aas2atoms.get("LEU").add("CA"); |
246 |
|
|
aas2atoms.get("LEU").add("C"); |
247 |
|
|
aas2atoms.get("LEU").add("O"); |
248 |
|
|
aas2atoms.get("LEU").add("CB"); |
249 |
|
|
aas2atoms.get("LEU").add("CG"); |
250 |
|
|
aas2atoms.get("LEU").add("CD2"); |
251 |
|
|
aas2atoms.get("LEU").add("CD1"); |
252 |
|
|
aas2atoms.put("ARG", new ArrayList<String>()); |
253 |
|
|
aas2atoms.get("ARG").add("NH2"); |
254 |
|
|
aas2atoms.get("ARG").add("CZ"); |
255 |
|
|
aas2atoms.get("ARG").add("NE"); |
256 |
|
|
aas2atoms.get("ARG").add("CD"); |
257 |
|
|
aas2atoms.get("ARG").add("CG"); |
258 |
|
|
aas2atoms.get("ARG").add("C"); |
259 |
|
|
aas2atoms.get("ARG").add("CA"); |
260 |
|
|
aas2atoms.get("ARG").add("N"); |
261 |
|
|
aas2atoms.get("ARG").add("NH1"); |
262 |
|
|
aas2atoms.get("ARG").add("CB"); |
263 |
|
|
aas2atoms.get("ARG").add("O"); |
264 |
|
|
aas2atoms.put("TRP", new ArrayList<String>()); |
265 |
|
|
aas2atoms.get("TRP").add("CE2"); |
266 |
|
|
aas2atoms.get("TRP").add("CA"); |
267 |
|
|
aas2atoms.get("TRP").add("C"); |
268 |
|
|
aas2atoms.get("TRP").add("O"); |
269 |
|
|
aas2atoms.get("TRP").add("CB"); |
270 |
|
|
aas2atoms.get("TRP").add("CG"); |
271 |
|
|
aas2atoms.get("TRP").add("CD1"); |
272 |
|
|
aas2atoms.get("TRP").add("CD2"); |
273 |
|
|
aas2atoms.get("TRP").add("CH2"); |
274 |
|
|
aas2atoms.get("TRP").add("CZ3"); |
275 |
|
|
aas2atoms.get("TRP").add("CZ2"); |
276 |
|
|
aas2atoms.get("TRP").add("CE3"); |
277 |
|
|
aas2atoms.get("TRP").add("NE1"); |
278 |
|
|
aas2atoms.get("TRP").add("N"); |
279 |
|
|
aas2atoms.put("VAL", new ArrayList<String>()); |
280 |
|
|
aas2atoms.get("VAL").add("CG1"); |
281 |
|
|
aas2atoms.get("VAL").add("CB"); |
282 |
|
|
aas2atoms.get("VAL").add("O"); |
283 |
|
|
aas2atoms.get("VAL").add("C"); |
284 |
|
|
aas2atoms.get("VAL").add("CA"); |
285 |
|
|
aas2atoms.get("VAL").add("N"); |
286 |
|
|
aas2atoms.get("VAL").add("CG2"); |
287 |
|
|
aas2atoms.put("GLU", new ArrayList<String>()); |
288 |
|
|
aas2atoms.get("GLU").add("C"); |
289 |
|
|
aas2atoms.get("GLU").add("N"); |
290 |
|
|
aas2atoms.get("GLU").add("CA"); |
291 |
|
|
aas2atoms.get("GLU").add("OE2"); |
292 |
|
|
aas2atoms.get("GLU").add("OE1"); |
293 |
|
|
aas2atoms.get("GLU").add("CD"); |
294 |
|
|
aas2atoms.get("GLU").add("CG"); |
295 |
|
|
aas2atoms.get("GLU").add("CB"); |
296 |
|
|
aas2atoms.get("GLU").add("O"); |
297 |
|
|
aas2atoms.put("TYR", new ArrayList<String>()); |
298 |
|
|
aas2atoms.get("TYR").add("CD2"); |
299 |
|
|
aas2atoms.get("TYR").add("CD1"); |
300 |
|
|
aas2atoms.get("TYR").add("OH"); |
301 |
|
|
aas2atoms.get("TYR").add("CZ"); |
302 |
|
|
aas2atoms.get("TYR").add("CE2"); |
303 |
|
|
aas2atoms.get("TYR").add("N"); |
304 |
|
|
aas2atoms.get("TYR").add("CA"); |
305 |
|
|
aas2atoms.get("TYR").add("C"); |
306 |
|
|
aas2atoms.get("TYR").add("O"); |
307 |
|
|
aas2atoms.get("TYR").add("CB"); |
308 |
|
|
aas2atoms.get("TYR").add("CG"); |
309 |
|
|
aas2atoms.get("TYR").add("CE1"); |
310 |
|
|
aas2atoms.put("MET", new ArrayList<String>()); |
311 |
|
|
aas2atoms.get("MET").add("CA"); |
312 |
|
|
aas2atoms.get("MET").add("O"); |
313 |
|
|
aas2atoms.get("MET").add("C"); |
314 |
|
|
aas2atoms.get("MET").add("CB"); |
315 |
|
|
aas2atoms.get("MET").add("CE"); |
316 |
|
|
aas2atoms.get("MET").add("N"); |
317 |
|
|
aas2atoms.get("MET").add("CG"); |
318 |
|
|
aas2atoms.get("MET").add("SD"); |
319 |
duarte |
123 |
return aas2atoms; |
320 |
|
|
|
321 |
|
|
} |
322 |
|
|
|
323 |
|
|
public static HashMap<String,String[]> ct2atoms(String ct) { |
324 |
|
|
ArrayList<String> aas = aas(); |
325 |
|
|
HashMap<String,String[]> ct2atoms = new HashMap<String,String[]>(); |
326 |
|
|
if (ct.equals("Ca")){ |
327 |
|
|
String[] atoms = {"CA"}; |
328 |
|
|
for (String aa:aas) { |
329 |
|
|
ct2atoms.put(aa, atoms); |
330 |
|
|
} |
331 |
|
|
} |
332 |
|
|
else if (ct.equals("Cb")){ |
333 |
|
|
String[] atoms = {"CB"}; |
334 |
|
|
for (String aa:aas) { |
335 |
|
|
ct2atoms.put(aa, atoms); |
336 |
|
|
} |
337 |
|
|
atoms = new String[1]; |
338 |
|
|
atoms[0]="CA"; |
339 |
|
|
ct2atoms.put("GLY", atoms); |
340 |
|
|
} |
341 |
|
|
else if (ct.equals("C")){ |
342 |
|
|
String[] atoms = {"C"}; |
343 |
|
|
for (String aa:aas) { |
344 |
|
|
ct2atoms.put(aa, atoms); |
345 |
|
|
} |
346 |
|
|
} |
347 |
|
|
else if (ct.equals("Cg")){ |
348 |
|
|
String[] atoms = {"SG"}; |
349 |
|
|
ct2atoms.put("CYS", atoms); |
350 |
|
|
atoms = new String[1]; |
351 |
|
|
atoms[0]= "CG"; |
352 |
|
|
ct2atoms.put("ASP", atoms); |
353 |
|
|
atoms = new String[1]; |
354 |
|
|
atoms[0]="OG"; |
355 |
|
|
ct2atoms.put("SER", atoms); |
356 |
|
|
atoms = new String[1]; |
357 |
|
|
atoms[0]="CG"; |
358 |
|
|
ct2atoms.put("GLN", atoms); |
359 |
|
|
atoms = new String[1]; |
360 |
|
|
atoms[0]="CD"; |
361 |
|
|
ct2atoms.put("LYS", atoms); |
362 |
|
|
atoms = new String[1]; |
363 |
|
|
atoms[0]="CG1"; |
364 |
|
|
ct2atoms.put("ILE", atoms); |
365 |
|
|
atoms = new String[1]; |
366 |
|
|
atoms[0]="CG"; |
367 |
|
|
ct2atoms.put("PRO", atoms); |
368 |
|
|
atoms = new String[1]; |
369 |
|
|
atoms[0]="OG1"; |
370 |
|
|
ct2atoms.put("THR", atoms); |
371 |
|
|
atoms = new String[1]; |
372 |
|
|
atoms[0]="CG"; |
373 |
|
|
ct2atoms.put("PHE", atoms); |
374 |
|
|
ct2atoms.put("ALA", new String[0]); |
375 |
|
|
ct2atoms.put("GLY", new String[0]); |
376 |
|
|
atoms = new String[1]; |
377 |
|
|
atoms[0]="CG"; |
378 |
|
|
ct2atoms.put("HIS", atoms); |
379 |
|
|
atoms = new String[1]; |
380 |
|
|
atoms[0]="CG"; |
381 |
|
|
ct2atoms.put("GLU", atoms); |
382 |
|
|
atoms = new String[1]; |
383 |
|
|
atoms[0]="CG"; |
384 |
|
|
ct2atoms.put("LEU", atoms); |
385 |
|
|
atoms = new String[1]; |
386 |
|
|
atoms[0]="NE"; |
387 |
|
|
ct2atoms.put("ARG", atoms); |
388 |
|
|
atoms = new String[1]; |
389 |
|
|
atoms[0]="CD2"; |
390 |
|
|
ct2atoms.put("TRP", atoms); |
391 |
|
|
atoms = new String[1]; |
392 |
|
|
atoms[0]="CG1"; |
393 |
|
|
ct2atoms.put("VAL", atoms); |
394 |
|
|
atoms = new String[1]; |
395 |
|
|
atoms[0]="CG"; |
396 |
|
|
ct2atoms.put("ASN", atoms); |
397 |
|
|
atoms = new String[1]; |
398 |
|
|
atoms[0]="CG"; |
399 |
|
|
ct2atoms.put("TYR", atoms); |
400 |
|
|
atoms = new String[1]; |
401 |
|
|
atoms[0]="CG"; |
402 |
|
|
ct2atoms.put("MET", atoms); |
403 |
|
|
} |
404 |
|
|
else if (ct.equals("BB")){ |
405 |
|
|
String[] atoms = {"CA", "N", "C", "O"}; |
406 |
|
|
for (String aa:aas) { |
407 |
|
|
ct2atoms.put(aa, atoms); |
408 |
|
|
} |
409 |
|
|
} |
410 |
|
|
else if (ct.equals("SC")){ |
411 |
|
|
HashMap<String,ArrayList<String>> aas2atoms = getaas2atoms(); |
412 |
|
|
for (String aa:aas) { |
413 |
|
|
ArrayList<String> SCatoms =aas2atoms.get(aa); |
414 |
|
|
SCatoms.remove("CA"); |
415 |
|
|
SCatoms.remove("N"); |
416 |
|
|
SCatoms.remove("C"); |
417 |
|
|
SCatoms.remove("O"); |
418 |
|
|
String[] SCatomsar= new String[SCatoms.size()]; |
419 |
|
|
SCatomsar=SCatoms.toArray(SCatomsar); |
420 |
|
|
ct2atoms.put(aa, SCatomsar); |
421 |
|
|
} |
422 |
|
|
} |
423 |
|
|
else if (ct.equals("ALL")){ |
424 |
|
|
HashMap<String,ArrayList<String>> aas2atoms = getaas2atoms(); |
425 |
|
|
for (String aa:aas) { |
426 |
|
|
ArrayList<String> ALLatoms = aas2atoms.get(aa); |
427 |
|
|
String[] ALLatomsar= new String[ALLatoms.size()]; |
428 |
|
|
ALLatomsar=ALLatoms.toArray(ALLatomsar); |
429 |
|
|
ct2atoms.put(aa,ALLatomsar); |
430 |
|
|
} |
431 |
|
|
} |
432 |
|
|
return ct2atoms; |
433 |
|
|
} |
434 |
|
|
} |