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 |
|
11 |
13 Sep 07 |
nicklas |
22 |
package affymetrix.fusion.chp; |
11 |
13 Sep 07 |
nicklas |
23 |
|
11 |
13 Sep 07 |
nicklas |
24 |
import affymetrix.gcos.chp.*; |
11 |
13 Sep 07 |
nicklas |
25 |
import affymetrix.calvin.data.*; |
11 |
13 Sep 07 |
nicklas |
26 |
|
11 |
13 Sep 07 |
nicklas |
/** Stores results for a genotyping probe set. */ |
11 |
13 Sep 07 |
nicklas |
28 |
public class FusionGenotypeProbeSetResults { |
11 |
13 Sep 07 |
nicklas |
29 |
|
11 |
13 Sep 07 |
nicklas |
/** The AA allele call */ |
11 |
13 Sep 07 |
nicklas |
31 |
public static final byte ALLELE_A_CALL = 6; |
11 |
13 Sep 07 |
nicklas |
32 |
|
11 |
13 Sep 07 |
nicklas |
/** The BB allele call */ |
11 |
13 Sep 07 |
nicklas |
34 |
public static final byte ALLELE_B_CALL = 7; |
11 |
13 Sep 07 |
nicklas |
35 |
|
11 |
13 Sep 07 |
nicklas |
/** The AB allele call */ |
11 |
13 Sep 07 |
nicklas |
37 |
public static final byte ALLELE_AB_CALL = 8; |
11 |
13 Sep 07 |
nicklas |
38 |
|
11 |
13 Sep 07 |
nicklas |
/** The no call allele call */ |
11 |
13 Sep 07 |
nicklas |
40 |
public static final byte ALLELE_NO_CALL = 11; |
11 |
13 Sep 07 |
nicklas |
41 |
|
11 |
13 Sep 07 |
nicklas |
/** The GCOS probe set results object. */ |
11 |
13 Sep 07 |
nicklas |
43 |
private GenotypeProbeSetResults gcosResult; |
11 |
13 Sep 07 |
nicklas |
44 |
|
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 |
47 |
*/ |
11 |
13 Sep 07 |
nicklas |
48 |
public void setGCOSObject(GenotypeProbeSetResults r) { gcosResult=r; } |
11 |
13 Sep 07 |
nicklas |
49 |
|
11 |
13 Sep 07 |
nicklas |
/** The calvin probe set results object. */ |
11 |
13 Sep 07 |
nicklas |
51 |
private CHPGenotypeEntry calvinResult; |
11 |
13 Sep 07 |
nicklas |
52 |
|
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 |
55 |
*/ |
11 |
13 Sep 07 |
nicklas |
56 |
public void setCalvinObject(CHPGenotypeEntry r) { calvinResult=r; } |
11 |
13 Sep 07 |
nicklas |
57 |
|
11 |
13 Sep 07 |
nicklas |
/** Clears the members. */ |
11 |
13 Sep 07 |
nicklas |
59 |
public void clear() { |
11 |
13 Sep 07 |
nicklas |
60 |
gcosResult = null; |
11 |
13 Sep 07 |
nicklas |
61 |
calvinResult = null; |
11 |
13 Sep 07 |
nicklas |
62 |
} |
11 |
13 Sep 07 |
nicklas |
63 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the allele call |
11 |
13 Sep 07 |
nicklas |
* @return The allele call. |
11 |
13 Sep 07 |
nicklas |
66 |
*/ |
11 |
13 Sep 07 |
nicklas |
67 |
public byte getAlleleCall() { |
11 |
13 Sep 07 |
nicklas |
68 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
69 |
return gcosResult.getAlleleCall(); |
11 |
13 Sep 07 |
nicklas |
70 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
71 |
return calvinResult.getCall(); |
11 |
13 Sep 07 |
nicklas |
72 |
return 0; |
11 |
13 Sep 07 |
nicklas |
73 |
} |
11 |
13 Sep 07 |
nicklas |
74 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the confidence |
11 |
13 Sep 07 |
nicklas |
* @return The confidence. |
11 |
13 Sep 07 |
nicklas |
77 |
*/ |
11 |
13 Sep 07 |
nicklas |
78 |
public float getConfidence() { |
11 |
13 Sep 07 |
nicklas |
79 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
80 |
return gcosResult.getConfidence(); |
11 |
13 Sep 07 |
nicklas |
81 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
82 |
return calvinResult.getConfidence(); |
11 |
13 Sep 07 |
nicklas |
83 |
return 0.0f; |
11 |
13 Sep 07 |
nicklas |
84 |
} |
11 |
13 Sep 07 |
nicklas |
85 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the RAS1 value |
11 |
13 Sep 07 |
nicklas |
* @return The RAS1 value. |
11 |
13 Sep 07 |
nicklas |
88 |
*/ |
11 |
13 Sep 07 |
nicklas |
89 |
public float getRAS1() { |
11 |
13 Sep 07 |
nicklas |
90 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
91 |
return gcosResult.getRAS1(); |
11 |
13 Sep 07 |
nicklas |
92 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
93 |
return calvinResult.getRAS1(); |
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 RAS2 value |
11 |
13 Sep 07 |
nicklas |
* @return The RAS2 value. |
11 |
13 Sep 07 |
nicklas |
99 |
*/ |
11 |
13 Sep 07 |
nicklas |
100 |
public float getRAS2() { |
11 |
13 Sep 07 |
nicklas |
101 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
102 |
return gcosResult.getRAS2(); |
11 |
13 Sep 07 |
nicklas |
103 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
104 |
return calvinResult.getRAS2(); |
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 AA p-value |
11 |
13 Sep 07 |
nicklas |
* @return The AA p-value. |
11 |
13 Sep 07 |
nicklas |
110 |
*/ |
11 |
13 Sep 07 |
nicklas |
111 |
public float getPValue_AA() { |
11 |
13 Sep 07 |
nicklas |
112 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
113 |
return gcosResult.getPValue_AA(); |
11 |
13 Sep 07 |
nicklas |
114 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
115 |
return calvinResult.getAACall(); |
11 |
13 Sep 07 |
nicklas |
116 |
return 0.0f; |
11 |
13 Sep 07 |
nicklas |
117 |
} |
11 |
13 Sep 07 |
nicklas |
118 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the AB p-value |
11 |
13 Sep 07 |
nicklas |
* @return The AB p-value. |
11 |
13 Sep 07 |
nicklas |
121 |
*/ |
11 |
13 Sep 07 |
nicklas |
122 |
public float getPValue_AB() { |
11 |
13 Sep 07 |
nicklas |
123 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
124 |
return gcosResult.getPValue_AB(); |
11 |
13 Sep 07 |
nicklas |
125 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
126 |
return calvinResult.getABCall(); |
11 |
13 Sep 07 |
nicklas |
127 |
return 0.0f; |
11 |
13 Sep 07 |
nicklas |
128 |
} |
11 |
13 Sep 07 |
nicklas |
129 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the BB p-value |
11 |
13 Sep 07 |
nicklas |
* @return The BB p-value. |
11 |
13 Sep 07 |
nicklas |
132 |
*/ |
11 |
13 Sep 07 |
nicklas |
133 |
public float getPValue_BB() { |
11 |
13 Sep 07 |
nicklas |
134 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
135 |
return gcosResult.getPValue_BB(); |
11 |
13 Sep 07 |
nicklas |
136 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
137 |
return calvinResult.getBBCall(); |
11 |
13 Sep 07 |
nicklas |
138 |
return 0.0f; |
11 |
13 Sep 07 |
nicklas |
139 |
} |
11 |
13 Sep 07 |
nicklas |
140 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the NoCall p-value |
11 |
13 Sep 07 |
nicklas |
* @return The NoCall p-value. |
11 |
13 Sep 07 |
nicklas |
143 |
*/ |
11 |
13 Sep 07 |
nicklas |
144 |
public float getPValue_NoCall() { |
11 |
13 Sep 07 |
nicklas |
145 |
if (gcosResult != null) |
11 |
13 Sep 07 |
nicklas |
146 |
return gcosResult.getPValue_NoCall(); |
11 |
13 Sep 07 |
nicklas |
147 |
else if (calvinResult != null) |
11 |
13 Sep 07 |
nicklas |
148 |
return calvinResult.getNoCall(); |
11 |
13 Sep 07 |
nicklas |
149 |
return 0.0f; |
11 |
13 Sep 07 |
nicklas |
150 |
} |
11 |
13 Sep 07 |
nicklas |
151 |
|
11 |
13 Sep 07 |
nicklas |
/** Returns a string representation of the allele call. |
11 |
13 Sep 07 |
nicklas |
* @return The allele call as a string. |
11 |
13 Sep 07 |
nicklas |
154 |
*/ |
11 |
13 Sep 07 |
nicklas |
155 |
public String getAlleleCallString() { |
11 |
13 Sep 07 |
nicklas |
156 |
switch (getAlleleCall()) |
11 |
13 Sep 07 |
nicklas |
157 |
{ |
11 |
13 Sep 07 |
nicklas |
158 |
case ALLELE_A_CALL: |
11 |
13 Sep 07 |
nicklas |
159 |
return "A"; |
11 |
13 Sep 07 |
nicklas |
160 |
|
11 |
13 Sep 07 |
nicklas |
161 |
case ALLELE_B_CALL: |
11 |
13 Sep 07 |
nicklas |
162 |
return "B"; |
11 |
13 Sep 07 |
nicklas |
163 |
|
11 |
13 Sep 07 |
nicklas |
164 |
case ALLELE_AB_CALL: |
11 |
13 Sep 07 |
nicklas |
165 |
return "AB"; |
11 |
13 Sep 07 |
nicklas |
166 |
|
11 |
13 Sep 07 |
nicklas |
167 |
default: |
11 |
13 Sep 07 |
nicklas |
168 |
return "No Call"; |
11 |
13 Sep 07 |
nicklas |
169 |
} |
11 |
13 Sep 07 |
nicklas |
170 |
} |
11 |
13 Sep 07 |
nicklas |
171 |
|
11 |
13 Sep 07 |
nicklas |
/** Creates a new instance of GenotypeProbeSetResults */ |
11 |
13 Sep 07 |
nicklas |
173 |
public FusionGenotypeProbeSetResults() { |
11 |
13 Sep 07 |
nicklas |
174 |
clear(); |
11 |
13 Sep 07 |
nicklas |
175 |
} |
11 |
13 Sep 07 |
nicklas |
176 |
|
11 |
13 Sep 07 |
nicklas |
177 |
} |