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.gcos.chp; |
11 |
13 Sep 07 |
nicklas |
22 |
import affymetrix.vector.*; |
11 |
13 Sep 07 |
nicklas |
23 |
import java.util.*; |
11 |
13 Sep 07 |
nicklas |
24 |
|
11 |
13 Sep 07 |
nicklas |
/** Stores results for a resequencing analysis. */ |
11 |
13 Sep 07 |
nicklas |
26 |
public class ResequencingResults { |
11 |
13 Sep 07 |
nicklas |
27 |
|
11 |
13 Sep 07 |
nicklas |
/** The called bases. */ |
11 |
13 Sep 07 |
nicklas |
29 |
private AffxCharVector /*char*/ calledBases; |
11 |
13 Sep 07 |
nicklas |
30 |
|
11 |
13 Sep 07 |
nicklas |
/** Base call scores. */ |
11 |
13 Sep 07 |
nicklas |
32 |
private AffxFloatVector /*float*/ scores; |
11 |
13 Sep 07 |
nicklas |
33 |
|
11 |
13 Sep 07 |
nicklas |
/** An array of force calls - base calls the algorithm would have made if the thresholds were removed. */ |
11 |
13 Sep 07 |
nicklas |
35 |
private Vector /*ForceCallType*/ forceCalls; |
11 |
13 Sep 07 |
nicklas |
36 |
|
11 |
13 Sep 07 |
nicklas |
/** An array of original calls. The calledBases contained the results of the algorithm and user edits. |
11 |
13 Sep 07 |
nicklas |
* If a user edits a base the original algorithm called base is stored in this vector. |
11 |
13 Sep 07 |
nicklas |
39 |
*/ |
11 |
13 Sep 07 |
nicklas |
40 |
private Vector /*BaseCallType*/ origCalls; |
11 |
13 Sep 07 |
nicklas |
41 |
|
11 |
13 Sep 07 |
nicklas |
/** Creates a new instance of ResequencingResults */ |
11 |
13 Sep 07 |
nicklas |
43 |
public ResequencingResults() { |
11 |
13 Sep 07 |
nicklas |
44 |
calledBases = null; |
11 |
13 Sep 07 |
nicklas |
45 |
scores = null; |
11 |
13 Sep 07 |
nicklas |
46 |
forceCalls = null; |
11 |
13 Sep 07 |
nicklas |
47 |
origCalls = null; |
11 |
13 Sep 07 |
nicklas |
48 |
} |
11 |
13 Sep 07 |
nicklas |
49 |
|
11 |
13 Sep 07 |
nicklas |
/** Clears the members. */ |
11 |
13 Sep 07 |
nicklas |
51 |
public void clear() { |
11 |
13 Sep 07 |
nicklas |
52 |
if (calledBases != null) |
11 |
13 Sep 07 |
nicklas |
53 |
calledBases.clear(); |
11 |
13 Sep 07 |
nicklas |
54 |
if (scores != null) |
11 |
13 Sep 07 |
nicklas |
55 |
scores.clear(); |
11 |
13 Sep 07 |
nicklas |
56 |
if (forceCalls != null) |
11 |
13 Sep 07 |
nicklas |
57 |
forceCalls.clear(); |
11 |
13 Sep 07 |
nicklas |
58 |
if (origCalls != null) |
11 |
13 Sep 07 |
nicklas |
59 |
origCalls.clear(); |
11 |
13 Sep 07 |
nicklas |
60 |
calledBases = null; |
11 |
13 Sep 07 |
nicklas |
61 |
scores = null; |
11 |
13 Sep 07 |
nicklas |
62 |
forceCalls = null; |
11 |
13 Sep 07 |
nicklas |
63 |
origCalls = null; |
11 |
13 Sep 07 |
nicklas |
64 |
} |
11 |
13 Sep 07 |
nicklas |
65 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the called bases. |
11 |
13 Sep 07 |
nicklas |
* @return The array of called bases. |
11 |
13 Sep 07 |
nicklas |
68 |
*/ |
11 |
13 Sep 07 |
nicklas |
69 |
public Vector getCalledBases() { return calledBases; } |
11 |
13 Sep 07 |
nicklas |
70 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the called base at the given index. |
11 |
13 Sep 07 |
nicklas |
* @param index The index to the called bases array. |
11 |
13 Sep 07 |
nicklas |
* @return The called base. |
11 |
13 Sep 07 |
nicklas |
74 |
*/ |
11 |
13 Sep 07 |
nicklas |
75 |
public char getCalledBase(int index) { return calledBases.getChar(index); } |
11 |
13 Sep 07 |
nicklas |
76 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the size of the called bases array. |
11 |
13 Sep 07 |
nicklas |
* @return The size of the called bases array. |
11 |
13 Sep 07 |
nicklas |
79 |
*/ |
11 |
13 Sep 07 |
nicklas |
80 |
public int getCalledBasesSize() { return (calledBases == null ? 0 : calledBases.size()); } |
11 |
13 Sep 07 |
nicklas |
81 |
|
11 |
13 Sep 07 |
nicklas |
/** Resizes the called bases array. |
11 |
13 Sep 07 |
nicklas |
* @param size The size of the array. |
11 |
13 Sep 07 |
nicklas |
84 |
*/ |
11 |
13 Sep 07 |
nicklas |
85 |
public void resizeCalledBases(int size) { |
11 |
13 Sep 07 |
nicklas |
86 |
calledBases = new AffxCharVector(); |
11 |
13 Sep 07 |
nicklas |
87 |
calledBases.setSize(size); |
11 |
13 Sep 07 |
nicklas |
88 |
} |
11 |
13 Sep 07 |
nicklas |
89 |
|
11 |
13 Sep 07 |
nicklas |
/** Sets the called base. |
11 |
13 Sep 07 |
nicklas |
* @param index The index to the array. |
11 |
13 Sep 07 |
nicklas |
* @param call The call. |
11 |
13 Sep 07 |
nicklas |
93 |
*/ |
11 |
13 Sep 07 |
nicklas |
94 |
public void setCalledBase(int index, char call) { calledBases.setChar(index, call); } |
11 |
13 Sep 07 |
nicklas |
95 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the scores. |
11 |
13 Sep 07 |
nicklas |
* @return The array of scores. |
11 |
13 Sep 07 |
nicklas |
98 |
*/ |
11 |
13 Sep 07 |
nicklas |
99 |
public Vector getScores() { return scores; } |
11 |
13 Sep 07 |
nicklas |
100 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the score at the given index. |
11 |
13 Sep 07 |
nicklas |
* @param index The index to the scores array. |
11 |
13 Sep 07 |
nicklas |
* @return The score. |
11 |
13 Sep 07 |
nicklas |
104 |
*/ |
11 |
13 Sep 07 |
nicklas |
105 |
public float getScore(int index) { return scores.getFloat(index); } |
11 |
13 Sep 07 |
nicklas |
106 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the size of the scores array. |
11 |
13 Sep 07 |
nicklas |
* @return The size of the scores array. |
11 |
13 Sep 07 |
nicklas |
109 |
*/ |
11 |
13 Sep 07 |
nicklas |
110 |
public int getScoresSize() { return (scores == null ? 0 : scores.size()); } |
11 |
13 Sep 07 |
nicklas |
111 |
|
11 |
13 Sep 07 |
nicklas |
/** setSizes the scores array. |
11 |
13 Sep 07 |
nicklas |
* @param size The size of the array. |
11 |
13 Sep 07 |
nicklas |
114 |
*/ |
11 |
13 Sep 07 |
nicklas |
115 |
public void resizeScores(int size) { |
11 |
13 Sep 07 |
nicklas |
116 |
scores = new AffxFloatVector(); |
11 |
13 Sep 07 |
nicklas |
117 |
scores.setSize(size); |
11 |
13 Sep 07 |
nicklas |
118 |
} |
11 |
13 Sep 07 |
nicklas |
119 |
|
11 |
13 Sep 07 |
nicklas |
/** Sets the score. |
11 |
13 Sep 07 |
nicklas |
* @param index The index to the array. |
11 |
13 Sep 07 |
nicklas |
* @param score The score. |
11 |
13 Sep 07 |
nicklas |
123 |
*/ |
11 |
13 Sep 07 |
nicklas |
124 |
public void setScore(int index, float score) { scores.setFloat(index, score); } |
11 |
13 Sep 07 |
nicklas |
125 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the force calls. |
11 |
13 Sep 07 |
nicklas |
* @return The array of force calls. |
11 |
13 Sep 07 |
nicklas |
128 |
*/ |
11 |
13 Sep 07 |
nicklas |
129 |
public Vector getForceCalls() { return forceCalls; } |
11 |
13 Sep 07 |
nicklas |
130 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the force call at the given index. |
11 |
13 Sep 07 |
nicklas |
* @param index The index to the force calls array. |
11 |
13 Sep 07 |
nicklas |
* @return The force call. |
11 |
13 Sep 07 |
nicklas |
134 |
*/ |
11 |
13 Sep 07 |
nicklas |
135 |
public ForceCallType getForceCall(int index) { return (ForceCallType) forceCalls.elementAt(index); } |
11 |
13 Sep 07 |
nicklas |
136 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the size of the force calls array. |
11 |
13 Sep 07 |
nicklas |
* @return The size of the force calls array. |
11 |
13 Sep 07 |
nicklas |
139 |
*/ |
11 |
13 Sep 07 |
nicklas |
140 |
public int getForceCallsSize() { return (forceCalls == null ? 0 : forceCalls.size()); } |
11 |
13 Sep 07 |
nicklas |
141 |
|
11 |
13 Sep 07 |
nicklas |
/** Resizes the force calls array. |
11 |
13 Sep 07 |
nicklas |
* @param size The size of the array. |
11 |
13 Sep 07 |
nicklas |
144 |
*/ |
11 |
13 Sep 07 |
nicklas |
145 |
public void resizeForceCalls(int size) { |
11 |
13 Sep 07 |
nicklas |
146 |
forceCalls = new Vector(); |
11 |
13 Sep 07 |
nicklas |
147 |
forceCalls.setSize(size); |
11 |
13 Sep 07 |
nicklas |
148 |
} |
11 |
13 Sep 07 |
nicklas |
149 |
|
11 |
13 Sep 07 |
nicklas |
/** Sets the force call. |
11 |
13 Sep 07 |
nicklas |
* @param index The index to the array. |
11 |
13 Sep 07 |
nicklas |
* @param call The force call. |
11 |
13 Sep 07 |
nicklas |
153 |
*/ |
11 |
13 Sep 07 |
nicklas |
154 |
public void setForceCall(int index, ForceCallType call) { forceCalls.set(index, call); } |
11 |
13 Sep 07 |
nicklas |
155 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the original called bases. |
11 |
13 Sep 07 |
nicklas |
* @return The array of original calls. |
11 |
13 Sep 07 |
nicklas |
158 |
*/ |
11 |
13 Sep 07 |
nicklas |
159 |
public Vector getOrigCalls() { return origCalls; } |
11 |
13 Sep 07 |
nicklas |
160 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the original called base at the given index. |
11 |
13 Sep 07 |
nicklas |
* @param index The index to the original calls array. |
11 |
13 Sep 07 |
nicklas |
* @return The original call. |
11 |
13 Sep 07 |
nicklas |
164 |
*/ |
11 |
13 Sep 07 |
nicklas |
165 |
public BaseCallType getOrigCall(int index) { return (BaseCallType) origCalls.elementAt(index); } |
11 |
13 Sep 07 |
nicklas |
166 |
|
11 |
13 Sep 07 |
nicklas |
/** Gets the size of the original calls array. |
11 |
13 Sep 07 |
nicklas |
* @return The size of the original calls array. |
11 |
13 Sep 07 |
nicklas |
169 |
*/ |
11 |
13 Sep 07 |
nicklas |
170 |
public int getOrigCallsSize() { return (origCalls == null ? 0 : origCalls.size()); } |
11 |
13 Sep 07 |
nicklas |
171 |
|
11 |
13 Sep 07 |
nicklas |
/** Resizes the original calls array. |
11 |
13 Sep 07 |
nicklas |
* @param size The size of the array. |
11 |
13 Sep 07 |
nicklas |
174 |
*/ |
11 |
13 Sep 07 |
nicklas |
175 |
public void resizeOrigCalls(int size) { |
11 |
13 Sep 07 |
nicklas |
176 |
origCalls = new AffxCharVector(); |
11 |
13 Sep 07 |
nicklas |
177 |
origCalls.setSize(size); |
11 |
13 Sep 07 |
nicklas |
178 |
} |
11 |
13 Sep 07 |
nicklas |
179 |
|
11 |
13 Sep 07 |
nicklas |
/** Sets the original call. |
11 |
13 Sep 07 |
nicklas |
* @param index The index to the array. |
11 |
13 Sep 07 |
nicklas |
* @param call The original call. |
11 |
13 Sep 07 |
nicklas |
183 |
*/ |
11 |
13 Sep 07 |
nicklas |
184 |
public void setOrigCall(int index, BaseCallType call) { origCalls.set(index, call); } |
11 |
13 Sep 07 |
nicklas |
185 |
|
11 |
13 Sep 07 |
nicklas |
186 |
} |