1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package mc_view; |
22 |
|
|
23 |
|
import jalview.schemes.ResidueProperties; |
24 |
|
|
25 |
|
import java.awt.Color; |
26 |
|
|
|
|
| 0% |
Uncovered Elements: 39 (39) |
Complexity: 8 |
Complexity Density: 0.29 |
|
27 |
|
public class Atom |
28 |
|
{ |
29 |
|
public float x; |
30 |
|
|
31 |
|
public float y; |
32 |
|
|
33 |
|
public float z; |
34 |
|
|
35 |
|
public int number; |
36 |
|
|
37 |
|
public String name; |
38 |
|
|
39 |
|
public String resName; |
40 |
|
|
41 |
|
public int resNumber; |
42 |
|
|
43 |
|
public char insCode = ' '; |
44 |
|
|
45 |
|
public String resNumIns = null; |
46 |
|
|
47 |
|
public int type; |
48 |
|
|
49 |
|
Color color = Color.lightGray; |
50 |
|
|
51 |
|
public String chain; |
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
public int alignmentMapping = -1; |
60 |
|
|
61 |
|
public int atomIndex; |
62 |
|
|
63 |
|
public float occupancy = 0; |
64 |
|
|
65 |
|
public float tfactor = 0; |
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
public boolean isSelected = false; |
70 |
|
|
|
|
| 0% |
Uncovered Elements: 23 (23) |
Complexity: 3 |
Complexity Density: 0.16 |
|
71 |
0 |
public Atom(String str)... |
72 |
|
{ |
73 |
0 |
atomIndex = Integer.parseInt(str.substring(6, 11).trim()); |
74 |
|
|
75 |
0 |
name = str.substring(12, 15).trim(); |
76 |
|
|
77 |
0 |
resName = str.substring(17, 20); |
78 |
|
|
79 |
0 |
resName = ResidueProperties.getCanonicalAminoAcid(resName); |
80 |
|
|
81 |
0 |
chain = str.substring(21, 22); |
82 |
|
|
83 |
0 |
resNumber = Integer.parseInt(str.substring(22, 26).trim()); |
84 |
0 |
resNumIns = str.substring(22, 27).trim(); |
85 |
0 |
insCode = str.substring(26, 27).charAt(0); |
86 |
0 |
this.x = (new Float(str.substring(30, 38).trim()).floatValue()); |
87 |
0 |
this.y = (new Float(str.substring(38, 46).trim()).floatValue()); |
88 |
0 |
this.z = (new Float(str.substring(47, 55).trim()).floatValue()); |
89 |
|
|
90 |
0 |
String tm = str.substring(54, 60).trim(); |
91 |
0 |
if (tm.length() > 0) |
92 |
|
{ |
93 |
0 |
occupancy = (new Float(tm)).floatValue(); |
94 |
|
} |
95 |
|
else |
96 |
|
{ |
97 |
0 |
occupancy = 1f; |
98 |
|
|
99 |
|
} |
100 |
0 |
tm = str.substring(60, 66).trim(); |
101 |
0 |
if (tm.length() > 0) |
102 |
|
{ |
103 |
0 |
tfactor = (new Float(tm).floatValue()); |
104 |
|
} |
105 |
|
else |
106 |
|
{ |
107 |
0 |
tfactor = 1f; |
108 |
|
|
109 |
|
} |
110 |
|
} |
111 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
112 |
0 |
@Override... |
113 |
|
public boolean equals(Object that) |
114 |
|
{ |
115 |
0 |
if (this == that || that == null) |
116 |
|
{ |
117 |
0 |
return true; |
118 |
|
} |
119 |
0 |
if (that instanceof Atom) |
120 |
|
{ |
121 |
0 |
Atom other = (Atom) that; |
122 |
0 |
return other.resName.equals(this.resName) |
123 |
|
&& other.resNumber == this.resNumber |
124 |
|
&& other.resNumIns.equals(this.resNumIns) |
125 |
|
&& other.chain.equals(this.chain); |
126 |
|
} |
127 |
0 |
return false; |
128 |
|
} |
129 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
130 |
0 |
public Atom(float x, float y, float z)... |
131 |
|
{ |
132 |
0 |
this.x = x; |
133 |
0 |
this.y = y; |
134 |
0 |
this.z = z; |
135 |
|
} |
136 |
|
} |