affyfusion-109/src/affymetrix/gcos/chp/ResequencingResults.java

Code
Comments
Other
Rev Date Author Line
11 13 Sep 07 nicklas 1 /////////////////////////////////////////////////////////////////
11 13 Sep 07 nicklas 2 //
11 13 Sep 07 nicklas 3 // Copyright (C) 2005 Affymetrix, Inc.
11 13 Sep 07 nicklas 4 //
11 13 Sep 07 nicklas 5 // This library is free software; you can redistribute it and/or modify
11 13 Sep 07 nicklas 6 // it under the terms of the GNU Lesser General Public License as published
11 13 Sep 07 nicklas 7 // by the Free Software Foundation; either version 2.1 of the License,
11 13 Sep 07 nicklas 8 // or (at your option) any later version.
11 13 Sep 07 nicklas 9 //
11 13 Sep 07 nicklas 10 // This library is distributed in the hope that it will be useful, but
11 13 Sep 07 nicklas 11 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 13 Sep 07 nicklas 12 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11 13 Sep 07 nicklas 13 // for more details.
11 13 Sep 07 nicklas 14 //
11 13 Sep 07 nicklas 15 // You should have received a copy of the GNU Lesser General Public License
11 13 Sep 07 nicklas 16 // along with this library; if not, write to the Free Software Foundation, Inc.,
11 13 Sep 07 nicklas 17 // 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 25 /** 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 28     /** The called bases. */
11 13 Sep 07 nicklas 29     private AffxCharVector /*char*/ calledBases;
11 13 Sep 07 nicklas 30
11 13 Sep 07 nicklas 31     /** Base call scores. */
11 13 Sep 07 nicklas 32     private AffxFloatVector /*float*/ scores;
11 13 Sep 07 nicklas 33
11 13 Sep 07 nicklas 34     /** 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 37     /** An array of original calls. The calledBases contained the results of the algorithm and user edits.
11 13 Sep 07 nicklas 38      * 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 42     /** 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 50     /** 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 66     /** Gets the called bases.
11 13 Sep 07 nicklas 67      * @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 71     /** Gets the called base at the given index.
11 13 Sep 07 nicklas 72      * @param index The index to the called bases array.
11 13 Sep 07 nicklas 73      * @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 77     /** Gets the size of the called bases array.
11 13 Sep 07 nicklas 78      * @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 82     /** Resizes the called bases array.
11 13 Sep 07 nicklas 83      * @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 90     /** Sets the called base.
11 13 Sep 07 nicklas 91      * @param index The index to the array.
11 13 Sep 07 nicklas 92      * @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 96     /** Gets the scores.
11 13 Sep 07 nicklas 97      * @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 101     /** Gets the score at the given index.
11 13 Sep 07 nicklas 102      * @param index The index to the scores array.
11 13 Sep 07 nicklas 103      * @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 107     /** Gets the size of the scores array.
11 13 Sep 07 nicklas 108      * @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 112     /** setSizes the scores array.
11 13 Sep 07 nicklas 113      * @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 120     /** Sets the score.
11 13 Sep 07 nicklas 121      * @param index The index to the array.
11 13 Sep 07 nicklas 122      * @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 126     /** Gets the force calls.
11 13 Sep 07 nicklas 127      * @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 131     /** Gets the force call at the given index.
11 13 Sep 07 nicklas 132      * @param index The index to the force calls array.
11 13 Sep 07 nicklas 133      * @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 137     /** Gets the size of the force calls array.
11 13 Sep 07 nicklas 138      * @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 142     /** Resizes the force calls array.
11 13 Sep 07 nicklas 143      * @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 150     /** Sets the force call.
11 13 Sep 07 nicklas 151      * @param index The index to the array.
11 13 Sep 07 nicklas 152      * @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 156     /** Gets the original called bases.
11 13 Sep 07 nicklas 157      * @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 161     /** Gets the original called base at the given index.
11 13 Sep 07 nicklas 162      * @param index The index to the original calls array.
11 13 Sep 07 nicklas 163      * @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 167     /** Gets the size of the original calls array.
11 13 Sep 07 nicklas 168      * @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 172     /** Resizes the original calls array.
11 13 Sep 07 nicklas 173      * @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 180     /** Sets the original call.
11 13 Sep 07 nicklas 181      * @param index The index to the array.
11 13 Sep 07 nicklas 182      * @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 }