11 |
13 Sep 07 |
nicklas |
1 |
///////////////////////////////////////////////////////////////// |
11 |
13 Sep 07 |
nicklas |
2 |
// |
11 |
13 Sep 07 |
nicklas |
// Copyright (C) 2005 Affymetrix, Inc. |
11 |
13 Sep 07 |
nicklas |
4 |
// |
11 |
13 Sep 07 |
nicklas |
// This library is free software; you can redistribute it and/or modify |
11 |
13 Sep 07 |
nicklas |
// it under the terms of the GNU Lesser General Public License as published |
11 |
13 Sep 07 |
nicklas |
// by the Free Software Foundation; either version 2.1 of the License, |
11 |
13 Sep 07 |
nicklas |
// or (at your option) any later version. |
11 |
13 Sep 07 |
nicklas |
9 |
// |
11 |
13 Sep 07 |
nicklas |
// This library is distributed in the hope that it will be useful, but |
11 |
13 Sep 07 |
nicklas |
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
11 |
13 Sep 07 |
nicklas |
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License |
11 |
13 Sep 07 |
nicklas |
// for more details. |
11 |
13 Sep 07 |
nicklas |
14 |
// |
11 |
13 Sep 07 |
nicklas |
// You should have received a copy of the GNU Lesser General Public License |
11 |
13 Sep 07 |
nicklas |
// along with this library; if not, write to the Free Software Foundation, Inc., |
11 |
13 Sep 07 |
nicklas |
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
11 |
13 Sep 07 |
nicklas |
18 |
// |
11 |
13 Sep 07 |
nicklas |
19 |
///////////////////////////////////////////////////////////////// |
11 |
13 Sep 07 |
nicklas |
20 |
|
11 |
13 Sep 07 |
nicklas |
21 |
package affymetrix.fusion.chp; |
11 |
13 Sep 07 |
nicklas |
22 |
|
11 |
13 Sep 07 |
nicklas |
23 |
import affymetrix.gcos.chp.*; |
11 |
13 Sep 07 |
nicklas |
24 |
import affymetrix.calvin.data.*; |
11 |
13 Sep 07 |
nicklas |
25 |
|
11 |
13 Sep 07 |
nicklas |
/** Expression analysis probe set results for the MAS5 algorithm */ |
11 |
13 Sep 07 |
nicklas |
27 |
public class FusionExpressionProbeSetResults { |
11 |
13 Sep 07 |
nicklas |
28 |
|
11 |
13 Sep 07 |
nicklas |
/** Present call for expression analysis */ |
11 |
13 Sep 07 |
nicklas |
30 |
public static final byte ABS_PRESENT_CALL = 0; |
11 |
13 Sep 07 |
nicklas |
31 |
|
11 |
13 Sep 07 |
nicklas |
/** Marginal call for expression analysis */ |
11 |
13 Sep 07 |
nicklas |
33 |
public static final byte ABS_MARGINAL_CALL = 1; |
11 |
13 Sep 07 |
nicklas |
34 |
|
11 |
13 Sep 07 |
nicklas |
/** Absent call for expression analysis */ |
11 |
13 Sep 07 |
nicklas |
36 |
public static final byte ABS_ABSENT_CALL = 2; |
11 |
13 Sep 07 |
nicklas |
37 |
|
11 |
13 Sep 07 |
nicklas |
/** No call call for expression analysis */ |
11 |
13 Sep 07 |
nicklas |
39 |
public static final byte ABS_NO_CALL = 3; |
11 |
13 Sep 07 |
nicklas |
40 |
|
11 |
13 Sep 07 |
nicklas |
/** Increase call for expression comparison analysis */ |
11 |
13 Sep 07 |
nicklas |
42 |
public static final byte COMP_INCREASE_CALL = 1; |
11 |
13 Sep 07 |
nicklas |
43 |
|
11 |
13 Sep 07 |
nicklas |
/** Decrease call for expression comparison analysis */ |
11 |
13 Sep 07 |
nicklas |
45 |
public static final byte COMP_DECREASE_CALL = 2; |
11 |
13 Sep 07 |
nicklas |
46 |
|
11 |
13 Sep 07 |
nicklas |
/** Moderate increase call for expression comparison analysis */ |
11 |
13 Sep 07 |
nicklas |
48 |
public static final byte COMP_MOD_INCREASE_CALL = 3; |
11 |
13 Sep 07 |
nicklas |
49 |
|
11 |
13 Sep 07 |
nicklas |
/** Moderate decrease call for expression comparison analysis */ |
11 |
13 Sep 07 |
nicklas |
51 |
public static final byte COMP_MOD_DECREASE_CALL = 4; |
11 |
13 Sep 07 |
nicklas |
52 |
|
11 |
13 Sep 07 |
nicklas |
/** No change call for expression comparison analysis */ |
11 |
13 Sep 07 |
nicklas |
54 |
public static final byte COMP_NO_CHANGE_CALL = 5; |
11 |
13 Sep 07 |
nicklas |
55 |
|
11 |
13 Sep 07 |
nicklas |
/** No call call for expression comparison analysis */ |
11 |
13 Sep 07 |
nicklas |
57 |
public static final byte COMP_NO_CALL = 6; |
11 |
13 Sep 07 |
nicklas |
58 |
|
11 |
13 Sep 07 |
nicklas |
/** Creates a new instance of FusionExpressionProbeSetResults */ |
11 |
13 Sep 07 |
nicklas |
60 |
public FusionExpressionProbeSetResults() { |
11 |
13 Sep 07 |
nicklas |
61 |
clear(); |
11 |
13 Sep 07 |
nicklas |
62 |
} |
11 |
13 Sep 07 |
nicklas |
63 |
|
11 |
13 Sep 07 |
nicklas |
/** The GCOS probe set results object. */ |
11 |
13 Sep 07 |
nicklas |
65 |
private ExpressionProbeSetResults gcosResult; |
11 |
13 Sep 07 |
nicklas |
66 |
|
11 |
13 Sep 07 |
nicklas |
/** Sets the GCOS probe set results object. |
11 |
13 Sep 07 |
nicklas |
* @param r The GCOS probe set results object. |
11 |
13 Sep 07 |
nicklas |
69 |
*/ |
11 |
13 Sep 07 |
nicklas |
70 |
public void setGCOSObject(ExpressionProbeSetResults r) { gcosResult=r; } |
11 |
13 Sep 07 |
nicklas |
71 |
|
11 |
13 Sep 07 |
nicklas |
/** The calvin probe set results object. */ |
11 |
13 Sep 07 |
nicklas |
73 |
private CHPExpressionEntry calvinResult; |
11 |
13 Sep 07 |
nicklas |
74 |
|
11 |
13 Sep 07 |
nicklas |
/** Sets the calvin object. |
11 |
13 Sep 07 |
nicklas |
* @param r The calvin probe set object. |
11 |
13 Sep 07 |
nicklas |
77 |
*/ |
11 |
13 Sep 07 |
nicklas |
78 |
public void setCalvinObject(CHPExpressionEntry r) { calvinResult=r; } |
11 |
13 Sep 07 |
nicklas |
79 |
|
11 |
13 Sep 07 |
nicklas |
/** Clears the members. */ |
11 |
13 Sep 07 |
nicklas |
81 |
public void clear() { |
11 |
13 Sep 07 |
nicklas |
82 |
gcosResult = null; |
11 |
13 Sep 07 |
nicklas |
83 |
calvinResult = null; |
11 |
13 Sep 07 |
nicklas |
84 |
} |
11 |
13 Sep 07 |
nicklas |
85 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets detection pvalue |
11 |
13 Sep 07 |
nicklas |
* return Detection pvalue. |
11 |
13 Sep 07 |
nicklas |
88 |
*/ |
11 |
13 Sep 07 |
nicklas |
89 |
public float getDetectionPValue() { |
11 |
13 Sep 07 |
nicklas |
90 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
91 |
return gcosResult.getDetectionPValue(); |
11 |
13 Sep 07 |
nicklas |
92 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
93 |
return calvinResult.getDetectionPValue(); |
11 |
13 Sep 07 |
nicklas |
94 |
return 0.0f; |
11 |
13 Sep 07 |
nicklas |
95 |
} |
11 |
13 Sep 07 |
nicklas |
96 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the signal. |
11 |
13 Sep 07 |
nicklas |
* return Signal. |
11 |
13 Sep 07 |
nicklas |
99 |
*/ |
11 |
13 Sep 07 |
nicklas |
100 |
public float getSignal() { |
11 |
13 Sep 07 |
nicklas |
101 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
102 |
return gcosResult.getSignal(); |
11 |
13 Sep 07 |
nicklas |
103 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
104 |
return calvinResult.getSignal(); |
11 |
13 Sep 07 |
nicklas |
105 |
return 0.0f; |
11 |
13 Sep 07 |
nicklas |
106 |
} |
11 |
13 Sep 07 |
nicklas |
107 |
|
11 |
13 Sep 07 |
nicklas |
/** gets the number of pairs. |
11 |
13 Sep 07 |
nicklas |
* return Number of pairs. |
11 |
13 Sep 07 |
nicklas |
110 |
*/ |
11 |
13 Sep 07 |
nicklas |
111 |
public short getNumPairs() { |
11 |
13 Sep 07 |
nicklas |
112 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
113 |
return gcosResult.getNumPairs(); |
11 |
13 Sep 07 |
nicklas |
114 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
115 |
return calvinResult.getNumPairs(); |
11 |
13 Sep 07 |
nicklas |
116 |
return 0; |
11 |
13 Sep 07 |
nicklas |
117 |
} |
11 |
13 Sep 07 |
nicklas |
118 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the number used pairs. |
11 |
13 Sep 07 |
nicklas |
* return Number of used pairs. |
11 |
13 Sep 07 |
nicklas |
121 |
*/ |
11 |
13 Sep 07 |
nicklas |
122 |
public short getNumUsedPairs() { |
11 |
13 Sep 07 |
nicklas |
123 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
124 |
return gcosResult.getNumUsedPairs(); |
11 |
13 Sep 07 |
nicklas |
125 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
126 |
return calvinResult.getNumPairsUsed(); |
11 |
13 Sep 07 |
nicklas |
127 |
return 0; |
11 |
13 Sep 07 |
nicklas |
128 |
} |
11 |
13 Sep 07 |
nicklas |
129 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the detection. |
11 |
13 Sep 07 |
nicklas |
* return Detection. |
11 |
13 Sep 07 |
nicklas |
132 |
*/ |
11 |
13 Sep 07 |
nicklas |
133 |
public byte getDetection() { |
11 |
13 Sep 07 |
nicklas |
134 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
135 |
return gcosResult.getDetection(); |
11 |
13 Sep 07 |
nicklas |
136 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
137 |
return calvinResult.getDetection(); |
11 |
13 Sep 07 |
nicklas |
138 |
return 0; |
11 |
13 Sep 07 |
nicklas |
139 |
} |
11 |
13 Sep 07 |
nicklas |
140 |
|
11 |
13 Sep 07 |
nicklas |
/** Determines if comp results exsist. |
11 |
13 Sep 07 |
nicklas |
* return True if comp results exsist. |
11 |
13 Sep 07 |
nicklas |
143 |
*/ |
11 |
13 Sep 07 |
nicklas |
144 |
public boolean hasCompResults() { |
11 |
13 Sep 07 |
nicklas |
145 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
146 |
return gcosResult.getHasCompResults(); |
11 |
13 Sep 07 |
nicklas |
147 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
148 |
return calvinResult.getHasComparisonData(); |
11 |
13 Sep 07 |
nicklas |
149 |
return false; |
11 |
13 Sep 07 |
nicklas |
150 |
} |
11 |
13 Sep 07 |
nicklas |
151 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the change pvalue. |
11 |
13 Sep 07 |
nicklas |
* return Cahnge pvalue. |
11 |
13 Sep 07 |
nicklas |
154 |
*/ |
11 |
13 Sep 07 |
nicklas |
155 |
public float getChangePValue() { |
11 |
13 Sep 07 |
nicklas |
156 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
157 |
return gcosResult.getChangePValue(); |
11 |
13 Sep 07 |
nicklas |
158 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
159 |
return calvinResult.getChangePValue(); |
11 |
13 Sep 07 |
nicklas |
160 |
return 0.0f; |
11 |
13 Sep 07 |
nicklas |
161 |
} |
11 |
13 Sep 07 |
nicklas |
162 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the signal log ratio. |
11 |
13 Sep 07 |
nicklas |
* return Signal log ratio. |
11 |
13 Sep 07 |
nicklas |
165 |
*/ |
11 |
13 Sep 07 |
nicklas |
166 |
public float getSignalLogRatio() { |
11 |
13 Sep 07 |
nicklas |
167 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
168 |
return gcosResult.getSignalLogRatio(); |
11 |
13 Sep 07 |
nicklas |
169 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
170 |
return calvinResult.getSigLogRatio(); |
11 |
13 Sep 07 |
nicklas |
171 |
return 0.0f; |
11 |
13 Sep 07 |
nicklas |
172 |
} |
11 |
13 Sep 07 |
nicklas |
173 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the signal log ratio low |
11 |
13 Sep 07 |
nicklas |
* return Signal log ratio low. |
11 |
13 Sep 07 |
nicklas |
176 |
*/ |
11 |
13 Sep 07 |
nicklas |
177 |
public float getSignalLogRatioLow() { |
11 |
13 Sep 07 |
nicklas |
178 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
179 |
return gcosResult.getSignalLogRatioLow(); |
11 |
13 Sep 07 |
nicklas |
180 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
181 |
return calvinResult.getSigLogRatioLo(); |
11 |
13 Sep 07 |
nicklas |
182 |
return 0.0f; |
11 |
13 Sep 07 |
nicklas |
183 |
} |
11 |
13 Sep 07 |
nicklas |
184 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the signal log ratio high |
11 |
13 Sep 07 |
nicklas |
* return Signal log ratio high. |
11 |
13 Sep 07 |
nicklas |
187 |
*/ |
11 |
13 Sep 07 |
nicklas |
188 |
public float getSignalLogRatioHigh() { |
11 |
13 Sep 07 |
nicklas |
189 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
190 |
return gcosResult.getSignalLogRatioHigh(); |
11 |
13 Sep 07 |
nicklas |
191 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
192 |
return calvinResult.getSigLogRatioHi(); |
11 |
13 Sep 07 |
nicklas |
193 |
return 0.0f; |
11 |
13 Sep 07 |
nicklas |
194 |
} |
11 |
13 Sep 07 |
nicklas |
195 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the number of common pairs |
11 |
13 Sep 07 |
nicklas |
* return Number of common pairs. |
11 |
13 Sep 07 |
nicklas |
198 |
*/ |
11 |
13 Sep 07 |
nicklas |
199 |
public short getNumCommonPairs() { |
11 |
13 Sep 07 |
nicklas |
200 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
201 |
return gcosResult.getNumCommonPairs(); |
11 |
13 Sep 07 |
nicklas |
202 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
203 |
return calvinResult.getCommonPairs(); |
11 |
13 Sep 07 |
nicklas |
204 |
return 0; |
11 |
13 Sep 07 |
nicklas |
205 |
} |
11 |
13 Sep 07 |
nicklas |
206 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the change. |
11 |
13 Sep 07 |
nicklas |
* return Change. |
11 |
13 Sep 07 |
nicklas |
209 |
*/ |
11 |
13 Sep 07 |
nicklas |
210 |
public byte getChange() { |
11 |
13 Sep 07 |
nicklas |
211 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
212 |
return gcosResult.getChange(); |
11 |
13 Sep 07 |
nicklas |
213 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
214 |
return calvinResult.getChange(); |
11 |
13 Sep 07 |
nicklas |
215 |
return 0; |
11 |
13 Sep 07 |
nicklas |
216 |
} |
11 |
13 Sep 07 |
nicklas |
217 |
|
11 |
13 Sep 07 |
nicklas |
/** Returns a string representation of the detection call. |
11 |
13 Sep 07 |
nicklas |
* @return The detection call |
11 |
13 Sep 07 |
nicklas |
220 |
*/ |
11 |
13 Sep 07 |
nicklas |
221 |
public String getDetectionString() { |
11 |
13 Sep 07 |
nicklas |
222 |
switch (getDetection()) |
11 |
13 Sep 07 |
nicklas |
223 |
{ |
11 |
13 Sep 07 |
nicklas |
224 |
case ABS_PRESENT_CALL: |
11 |
13 Sep 07 |
nicklas |
225 |
return "P"; |
11 |
13 Sep 07 |
nicklas |
226 |
|
11 |
13 Sep 07 |
nicklas |
227 |
case ABS_MARGINAL_CALL: |
11 |
13 Sep 07 |
nicklas |
228 |
return "M"; |
11 |
13 Sep 07 |
nicklas |
229 |
|
11 |
13 Sep 07 |
nicklas |
230 |
case ABS_ABSENT_CALL: |
11 |
13 Sep 07 |
nicklas |
231 |
return "A"; |
11 |
13 Sep 07 |
nicklas |
232 |
|
11 |
13 Sep 07 |
nicklas |
233 |
case ABS_NO_CALL: |
11 |
13 Sep 07 |
nicklas |
234 |
return "No Call"; |
11 |
13 Sep 07 |
nicklas |
235 |
} |
11 |
13 Sep 07 |
nicklas |
236 |
return null; |
11 |
13 Sep 07 |
nicklas |
237 |
} |
11 |
13 Sep 07 |
nicklas |
238 |
|
11 |
13 Sep 07 |
nicklas |
/** Returns a string representation of the change call. |
11 |
13 Sep 07 |
nicklas |
* @return The change call |
11 |
13 Sep 07 |
nicklas |
241 |
*/ |
11 |
13 Sep 07 |
nicklas |
242 |
public String getChangeString() { |
11 |
13 Sep 07 |
nicklas |
243 |
switch (getChange()) |
11 |
13 Sep 07 |
nicklas |
244 |
{ |
11 |
13 Sep 07 |
nicklas |
245 |
case COMP_INCREASE_CALL: |
11 |
13 Sep 07 |
nicklas |
246 |
return "I"; |
11 |
13 Sep 07 |
nicklas |
247 |
|
11 |
13 Sep 07 |
nicklas |
248 |
case COMP_DECREASE_CALL: |
11 |
13 Sep 07 |
nicklas |
249 |
return "D"; |
11 |
13 Sep 07 |
nicklas |
250 |
|
11 |
13 Sep 07 |
nicklas |
251 |
case COMP_MOD_INCREASE_CALL: |
11 |
13 Sep 07 |
nicklas |
252 |
return "MI"; |
11 |
13 Sep 07 |
nicklas |
253 |
|
11 |
13 Sep 07 |
nicklas |
254 |
case COMP_MOD_DECREASE_CALL: |
11 |
13 Sep 07 |
nicklas |
255 |
return "MD"; |
11 |
13 Sep 07 |
nicklas |
256 |
|
11 |
13 Sep 07 |
nicklas |
257 |
case COMP_NO_CHANGE_CALL: |
11 |
13 Sep 07 |
nicklas |
258 |
return "NC"; |
11 |
13 Sep 07 |
nicklas |
259 |
|
11 |
13 Sep 07 |
nicklas |
260 |
case COMP_NO_CALL: |
11 |
13 Sep 07 |
nicklas |
261 |
return "No Call"; |
11 |
13 Sep 07 |
nicklas |
262 |
} |
11 |
13 Sep 07 |
nicklas |
263 |
return null; |
11 |
13 Sep 07 |
nicklas |
264 |
} |
11 |
13 Sep 07 |
nicklas |
265 |
} |