affyfusion-109/src/affymetrix/calvin/data/CHPData.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.calvin.data;
11 13 Sep 07 nicklas 22
11 13 Sep 07 nicklas 23 import java.util.*;
11 13 Sep 07 nicklas 24 import affymetrix.calvin.parameter.*;
11 13 Sep 07 nicklas 25
11 13 Sep 07 nicklas 26 /** Defines a base class for older CHP file data. */ 
11 13 Sep 07 nicklas 27 public class CHPData
11 13 Sep 07 nicklas 28 {
11 13 Sep 07 nicklas 29
11 13 Sep 07 nicklas 30     /** The id for the expression CHP files. */
11 13 Sep 07 nicklas 31     public static final String CHP_EXPRESSION_ASSAY_TYPE = "affymetrix-expression-probeset-analysis";
11 13 Sep 07 nicklas 32
11 13 Sep 07 nicklas 33     /** The id for the expression CHP file data group. */
11 13 Sep 07 nicklas 34     public static final String CHP_EXPR_GROUP = "Expression Results";
11 13 Sep 07 nicklas 35
11 13 Sep 07 nicklas 36     /** The id for the resequencing CHP files. */
11 13 Sep 07 nicklas 37     public static final String CHP_RESEQUENCING_ASSAY_TYPE = "affymetrix-resequencing-probeset-analysis";
11 13 Sep 07 nicklas 38
11 13 Sep 07 nicklas 39     /** The id for the resequencing CHP file data group. */
11 13 Sep 07 nicklas 40     public static final String CHP_RESEQ_GROUP = "Resequencing Results";
11 13 Sep 07 nicklas 41
11 13 Sep 07 nicklas 42     /** The id for the genotyping CHP files. */
11 13 Sep 07 nicklas 43     public static final String CHP_GENOTYPING_ASSAY_TYPE = "affymetrix-genotyping-probeset-analysis";
11 13 Sep 07 nicklas 44
11 13 Sep 07 nicklas 45     /** The id for the genotyping CHP file data group. */
11 13 Sep 07 nicklas 46     public static final String CHP_GENO_GROUP = "Genotyping Results";
11 13 Sep 07 nicklas 47
11 13 Sep 07 nicklas 48     /** The id for the universal CHP files. */
11 13 Sep 07 nicklas 49     public static final String CHP_UNIVERSAL_ASSAY_TYPE = "affymetrix-universal-probeset-analysis";
11 13 Sep 07 nicklas 50
11 13 Sep 07 nicklas 51     /** The id for the universal CHP file data group. */
11 13 Sep 07 nicklas 52     public static final String CHP_UNIV_GROUP = "Universal Results";
11 13 Sep 07 nicklas 53
11 13 Sep 07 nicklas 54     /** The id for the number of rows of features. */
11 13 Sep 07 nicklas 55     public static final String CHP_ROWS = "affymetrix-cel-rows";
11 13 Sep 07 nicklas 56
11 13 Sep 07 nicklas 57     /** The id for the number of columns of features. */
11 13 Sep 07 nicklas 58     public static final String CHP_COLS = "affymetrix-cel-cols";
11 13 Sep 07 nicklas 59
11 13 Sep 07 nicklas 60     /** The id for the prog ID. */
11 13 Sep 07 nicklas 61     public static final String CHP_PROGID = "affymetrix-progid";
11 13 Sep 07 nicklas 62
11 13 Sep 07 nicklas 63     /** The id for the array type. */
11 13 Sep 07 nicklas 64     public static final String CHP_ARRAY_TYPE = "affymetrix-array-type";
11 13 Sep 07 nicklas 65
11 13 Sep 07 nicklas 66     /** The id for the algorithm name. */
11 13 Sep 07 nicklas 67     public static final String CHP_ALG_NAME = "affymetrix-algorithm-name";
11 13 Sep 07 nicklas 68
11 13 Sep 07 nicklas 69     /** The id for the algorithm version. */
11 13 Sep 07 nicklas 70     public static final String CHP_ALG_VERSION = "affymetrix-algorithm-version";
11 13 Sep 07 nicklas 71
11 13 Sep 07 nicklas 72     /** A prefix for algorithm parameter ids. */
11 13 Sep 07 nicklas 73     public static final String CHP_ALG_PARAM = "affymetrix-algorithm-param-";
11 13 Sep 07 nicklas 74
11 13 Sep 07 nicklas 75     /** A prefix for chip summary parameter ids. */
11 13 Sep 07 nicklas 76     public static final String CHP_CHIP_SUM = "affymetrix-chipsummary-"; 
11 13 Sep 07 nicklas 77
11 13 Sep 07 nicklas 78     /** The id for the parent cel file. */
11 13 Sep 07 nicklas 79     public static final String CHP_PARENT_CELL = "affymetrix-parent-celfile";
11 13 Sep 07 nicklas 80
11 13 Sep 07 nicklas 81     /** The group name for the background zone group. */
11 13 Sep 07 nicklas 82     public static final String CHP_BG_ZONE_GROUP = "Background Zone Data";
11 13 Sep 07 nicklas 83
11 13 Sep 07 nicklas 84     /** The group name for the force call group (for resequencing only). */
11 13 Sep 07 nicklas 85     public static final String CHP_RESEQ_FORCE_CALL_GROUP = "Force Call Data";
11 13 Sep 07 nicklas 86
11 13 Sep 07 nicklas 87     /** The group name for the orig call group (for resequencing only). */
11 13 Sep 07 nicklas 88     public static final String CHP_RESEQ_ORIG_CALL_GROUP = "Orig Call Data";
11 13 Sep 07 nicklas 89
11 13 Sep 07 nicklas 90
11 13 Sep 07 nicklas 91     // Constant column names.
11 13 Sep 07 nicklas 92     private static final String CallColName = "Call";
11 13 Sep 07 nicklas 93     private static final String ScoreColName = "Score";
11 13 Sep 07 nicklas 94     private static final String BackgroundColName = "Background";
11 13 Sep 07 nicklas 95     private static final String ConfidenceColName = "Confidence";
11 13 Sep 07 nicklas 96     private static final String RAS1ColName = "RAS1";
11 13 Sep 07 nicklas 97     private static final String RAS2ColName = "RAS2";
11 13 Sep 07 nicklas 98     private static final String AAColName = "AA Call p-value";
11 13 Sep 07 nicklas 99     private static final String ABColName = "AB Call p-value";
11 13 Sep 07 nicklas 100     private static final String BBColName = "BB Call p-value";
11 13 Sep 07 nicklas 101     private static final String NoCallColName = "No Call p-value";
11 13 Sep 07 nicklas 102     private static final String ProbeSetNameColName = "Probe Set Name";
11 13 Sep 07 nicklas 103     private static final String DetectionColName = "Detection";
11 13 Sep 07 nicklas 104     private static final String DetectionPValueColName = "Detection p-value";
11 13 Sep 07 nicklas 105     private static final String SignalColName = "Signal";
11 13 Sep 07 nicklas 106     private static final String NumberPairsColName = "Number of Pairs";
11 13 Sep 07 nicklas 107     private static final String NumberPairsUsedColName = "Number of Pairs Used";
11 13 Sep 07 nicklas 108     private static final String ChangeColName = "Change";
11 13 Sep 07 nicklas 109     private static final String ChangePValueColName = "Change p-value";
11 13 Sep 07 nicklas 110     private static final String SignalLogRatioColName = "Signal Log Ratio";
11 13 Sep 07 nicklas 111     private static final String SignalLogRatioLowColName = "Signal Log Ratio Low";
11 13 Sep 07 nicklas 112     private static final String SignalLogRatioHighColName = "Signal Log Ratio High";
11 13 Sep 07 nicklas 113     private static final String CommonPairsColName = "Common Pairs";
11 13 Sep 07 nicklas 114     private static final String CenterXColName = "Center X";
11 13 Sep 07 nicklas 115     private static final String CenterYColName = "Center Y";
11 13 Sep 07 nicklas 116     private static final String SmoothFactorColName = "Smooth Factor";
11 13 Sep 07 nicklas 117     private static final String PositionColName = "Position";
11 13 Sep 07 nicklas 118     private static final String ReasonColName = "Reason";
11 13 Sep 07 nicklas 119     private static final String ForceCallColName = "Force Call";
11 13 Sep 07 nicklas 120     private static final String OriginalCallColName = "Original Call";
11 13 Sep 07 nicklas 121
11 13 Sep 07 nicklas 122     /** Constructor */
11 13 Sep 07 nicklas 123     public CHPData() {
11 13 Sep 07 nicklas 124         entriesExp = null;
11 13 Sep 07 nicklas 125   entriesGeno = null;
11 13 Sep 07 nicklas 126   entriesUniv = null;
11 13 Sep 07 nicklas 127   entriesReseq = null;
11 13 Sep 07 nicklas 128   bgZones = null;
11 13 Sep 07 nicklas 129   forceSet = null;
11 13 Sep 07 nicklas 130   origSet = null;
11 13 Sep 07 nicklas 131         wideProbeSetNames = false;
11 13 Sep 07 nicklas 132   genericData = new GenericData();
11 13 Sep 07 nicklas 133   clear();
11 13 Sep 07 nicklas 134     }
11 13 Sep 07 nicklas 135
11 13 Sep 07 nicklas 136     /** Constructor with file and type.
11 13 Sep 07 nicklas 137      * @param filename The name of the CHP file.
11 13 Sep 07 nicklas 138      * @param assayType The type of data in the CHP file.
11 13 Sep 07 nicklas 139      */
11 13 Sep 07 nicklas 140     public CHPData(String filename, String assayType) {
11 13 Sep 07 nicklas 141         
11 13 Sep 07 nicklas 142   entriesExp = null;
11 13 Sep 07 nicklas 143   entriesGeno = null;
11 13 Sep 07 nicklas 144   entriesUniv = null;
11 13 Sep 07 nicklas 145   entriesReseq = null;
11 13 Sep 07 nicklas 146   bgZones = null;
11 13 Sep 07 nicklas 147   forceSet = null;
11 13 Sep 07 nicklas 148   origSet = null;
11 13 Sep 07 nicklas 149         wideProbeSetNames = false;
11 13 Sep 07 nicklas 150         genericData = new GenericData();
11 13 Sep 07 nicklas 151   clear();
11 13 Sep 07 nicklas 152   setFilename(filename);
11 13 Sep 07 nicklas 153
11 13 Sep 07 nicklas 154   String groupName;
11 13 Sep 07 nicklas 155   if (assayType.compareTo(CHP_EXPRESSION_ASSAY_TYPE) == 0)
11 13 Sep 07 nicklas 156             groupName = CHP_EXPR_GROUP;
11 13 Sep 07 nicklas 157
11 13 Sep 07 nicklas 158   else if (assayType.compareTo(CHP_RESEQUENCING_ASSAY_TYPE) == 0)
11 13 Sep 07 nicklas 159             groupName = CHP_RESEQ_GROUP;
11 13 Sep 07 nicklas 160
11 13 Sep 07 nicklas 161   else if (assayType.compareTo(CHP_GENOTYPING_ASSAY_TYPE) == 0)
11 13 Sep 07 nicklas 162             groupName = CHP_GENO_GROUP;
11 13 Sep 07 nicklas 163
11 13 Sep 07 nicklas 164   else if (assayType.compareTo(CHP_UNIVERSAL_ASSAY_TYPE) == 0)
11 13 Sep 07 nicklas 165             groupName = CHP_UNIV_GROUP;
11 13 Sep 07 nicklas 166
11 13 Sep 07 nicklas 167   else
11 13 Sep 07 nicklas 168             return;
11 13 Sep 07 nicklas 169
11 13 Sep 07 nicklas 170   DataGroupHeader dcHdr = new DataGroupHeader(groupName);
11 13 Sep 07 nicklas 171   genericData.getHeader().addDataGroupHdr(dcHdr);
11 13 Sep 07 nicklas 172   genericData.getHeader().getGenericDataHdr().setFileTypeId(assayType);
11 13 Sep 07 nicklas 173   DataGroupHeader dcHdrBg = new DataGroupHeader(CHP_BG_ZONE_GROUP);
11 13 Sep 07 nicklas 174   genericData.getHeader().addDataGroupHdr(dcHdrBg);
11 13 Sep 07 nicklas 175
11 13 Sep 07 nicklas 176   // Now add the force and orig sets for reseq designs.
11 13 Sep 07 nicklas 177   if (assayType.compareTo(CHP_RESEQUENCING_ASSAY_TYPE) == 0)
11 13 Sep 07 nicklas 178   {
11 13 Sep 07 nicklas 179             DataGroupHeader dcHdrForce = new DataGroupHeader(CHP_RESEQ_FORCE_CALL_GROUP);
11 13 Sep 07 nicklas 180             genericData.getHeader().addDataGroupHdr(dcHdrForce);
11 13 Sep 07 nicklas 181             DataGroupHeader dcHdrOrig = new DataGroupHeader(CHP_RESEQ_ORIG_CALL_GROUP);
11 13 Sep 07 nicklas 182             genericData.getHeader().addDataGroupHdr(dcHdrOrig);
11 13 Sep 07 nicklas 183         }
11 13 Sep 07 nicklas 184     }
11 13 Sep 07 nicklas 185
11 13 Sep 07 nicklas 186     /*! Flag indicating if the probe set names were stored in wide character format. */
11 13 Sep 07 nicklas 187     private boolean wideProbeSetNames;
11 13 Sep 07 nicklas 188     /** The generic file data object. */
11 13 Sep 07 nicklas 189     private GenericData genericData;
11 13 Sep 07 nicklas 190     /** keep rows from being read from the header all the time */
11 13 Sep 07 nicklas 191     private int cachedRows;
11 13 Sep 07 nicklas 192     /** keep cols from being read from the header all the time */
11 13 Sep 07 nicklas 193     private int cachedCols;
11 13 Sep 07 nicklas 194     /** expression entries DataSet */
11 13 Sep 07 nicklas 195     private DataSet entriesExp;
11 13 Sep 07 nicklas 196     /** genotyping entries DataSet */
11 13 Sep 07 nicklas 197     private DataSet entriesGeno;
11 13 Sep 07 nicklas 198     /** universal entries DataSet */
11 13 Sep 07 nicklas 199     private DataSet entriesUniv;
11 13 Sep 07 nicklas 200     /** resequencing entries DataSet */
11 13 Sep 07 nicklas 201     private DataSet entriesReseq;
11 13 Sep 07 nicklas 202     /** chp background zones DataSet */
11 13 Sep 07 nicklas 203     private DataSet bgZones;
11 13 Sep 07 nicklas 204     /** chp force call DataSet */
11 13 Sep 07 nicklas 205     private DataSet forceSet;
11 13 Sep 07 nicklas 206     /** chp orig DataSet */
11 13 Sep 07 nicklas 207     private DataSet origSet;
11 13 Sep 07 nicklas 208
11 13 Sep 07 nicklas 209     /** Clears the members. */
11 13 Sep 07 nicklas 210     public void clear() {
11 13 Sep 07 nicklas 211   if (entriesGeno != null){ entriesGeno.delete();  entriesGeno = null; }
11 13 Sep 07 nicklas 212   if (entriesExp != null) { entriesExp.delete();  entriesExp = null; }
11 13 Sep 07 nicklas 213   if (entriesUniv != null) { entriesUniv.delete();  entriesUniv = null; }
11 13 Sep 07 nicklas 214   if (entriesReseq != null) { entriesReseq.delete();  entriesReseq = null; }
11 13 Sep 07 nicklas 215   if (bgZones != null) { bgZones.delete();  bgZones = null; }
11 13 Sep 07 nicklas 216   if (forceSet != null) { forceSet.delete(); forceSet = null; }
11 13 Sep 07 nicklas 217   if (origSet != null) { origSet.delete(); origSet = null; }
11 13 Sep 07 nicklas 218   genericData.getHeader().clear();
11 13 Sep 07 nicklas 219   cachedRows = -1;
11 13 Sep 07 nicklas 220   cachedCols = -1;
11 13 Sep 07 nicklas 221     }
11 13 Sep 07 nicklas 222
11 13 Sep 07 nicklas 223     /** Sets the name of the CHP file. */
11 13 Sep 07 nicklas 224     public void setFilename(String p) {
11 13 Sep 07 nicklas 225         genericData.getHeader().setFilename(p);
11 13 Sep 07 nicklas 226     }
11 13 Sep 07 nicklas 227
11 13 Sep 07 nicklas 228     /** The name of the CHP file. */
11 13 Sep 07 nicklas 229     public String getFilename() {
11 13 Sep 07 nicklas 230         return genericData.getHeader().getFilename();
11 13 Sep 07 nicklas 231     }
11 13 Sep 07 nicklas 232
11 13 Sep 07 nicklas 233     /** Gets the version in the file. */
11 13 Sep 07 nicklas 234     public byte getVersion() { return genericData.getHeader().getVersion(); }
11 13 Sep 07 nicklas 235
11 13 Sep 07 nicklas 236     /** Gets the files magic number. */
11 13 Sep 07 nicklas 237     public byte getMagic() { return genericData.getHeader().getMagicNumber(); }
11 13 Sep 07 nicklas 238
11 13 Sep 07 nicklas 239     /** Gets the number of rows of features on the array. */
11 13 Sep 07 nicklas 240     public int getRows() {
11 13 Sep 07 nicklas 241   if (cachedRows == -1)
11 13 Sep 07 nicklas 242     cachedRows = getInt32FromGenericHdr(CHP_ROWS);
11 13 Sep 07 nicklas 243   return cachedRows;
11 13 Sep 07 nicklas 244     }
11 13 Sep 07 nicklas 245
11 13 Sep 07 nicklas 246     /** Gets the number of columns of features on the array. */
11 13 Sep 07 nicklas 247     public int getCols() {
11 13 Sep 07 nicklas 248   if (cachedCols == -1)
11 13 Sep 07 nicklas 249     cachedCols = getInt32FromGenericHdr(CHP_COLS);
11 13 Sep 07 nicklas 250   return cachedCols;
11 13 Sep 07 nicklas 251     }
11 13 Sep 07 nicklas 252
11 13 Sep 07 nicklas 253     /** Gets the CHP file prog Id. */
11 13 Sep 07 nicklas 254     public String getProgId() {
11 13 Sep 07 nicklas 255         return getWStringFromGenericHdr(CHP_PROGID);
11 13 Sep 07 nicklas 256     }
11 13 Sep 07 nicklas 257
11 13 Sep 07 nicklas 258     /** Gets the array type */
11 13 Sep 07 nicklas 259     public String getArrayType() {
11 13 Sep 07 nicklas 260         return getWStringFromGenericHdr(AffymetrixParameterConsts.ARRAY_TYPE_PARAM_NAME);
11 13 Sep 07 nicklas 261     }
11 13 Sep 07 nicklas 262
11 13 Sep 07 nicklas 263     /** Gets the assay type */
11 13 Sep 07 nicklas 264     public String getAssayType() { return genericData.getHeader().getGenericDataHdr().getFileTypeId(); }
11 13 Sep 07 nicklas 265
11 13 Sep 07 nicklas 266     /** Gets the algorithm name  */
11 13 Sep 07 nicklas 267     public String getAlgName() { return getWStringFromGenericHdr(CHP_ALG_NAME); }
11 13 Sep 07 nicklas 268
11 13 Sep 07 nicklas 269     /** Gets the name of the parent CEL file. */
11 13 Sep 07 nicklas 270     public String getParentCell() { return getWStringFromGenericHdr(CHP_PARENT_CELL); }
11 13 Sep 07 nicklas 271
11 13 Sep 07 nicklas 272     /** Gets the algorithm version.  */
11 13 Sep 07 nicklas 273     public String getAlgVersion() { return getWStringFromGenericHdr(CHP_ALG_VERSION); }
11 13 Sep 07 nicklas 274
11 13 Sep 07 nicklas 275     /** Gets the alg parameters */
11 13 Sep 07 nicklas 276     public Vector /*ParameterNameValue*/ getAlgParams() {
11 13 Sep 07 nicklas 277         Vector algParams = new Vector();
11 13 Sep 07 nicklas 278         Vector allParams = genericData.getHeader().getGenericDataHdr().getNameValParams();
11 13 Sep 07 nicklas 279         for (int i=0; i<allParams.size(); i++)
11 13 Sep 07 nicklas 280         {
11 13 Sep 07 nicklas 281             ParameterNameValue param = (ParameterNameValue) allParams.elementAt(i);
11 13 Sep 07 nicklas 282             String name = param.getName();
11 13 Sep 07 nicklas 283             if (name.startsWith(CHP_ALG_PARAM) == true)
11 13 Sep 07 nicklas 284             {
11 13 Sep 07 nicklas 285                 ParameterNameValue algParam = new ParameterNameValue(param);
11 13 Sep 07 nicklas 286                 algParam.setName( name.substring(CHP_ALG_PARAM.length(), name.length()));
11 13 Sep 07 nicklas 287                 algParams.add(algParam);
11 13 Sep 07 nicklas 288             }
11 13 Sep 07 nicklas 289         }
11 13 Sep 07 nicklas 290         return algParams;
11 13 Sep 07 nicklas 291     }
11 13 Sep 07 nicklas 292
11 13 Sep 07 nicklas 293     /** Gets a single algorithm parameter by name. */
11 13 Sep 07 nicklas 294     public ParameterNameValue getAlgParam( String tag) {
11 13 Sep 07 nicklas 295         GenericDataHeader hdr = genericData.getHeader().getGenericDataHdr();
11 13 Sep 07 nicklas 296         ParameterNameValue type = hdr.findNameValParam(CHP_ALG_PARAM + tag);
11 13 Sep 07 nicklas 297         if (type != null)
11 13 Sep 07 nicklas 298             type.setName(tag);
11 13 Sep 07 nicklas 299   return type;
11 13 Sep 07 nicklas 300     }
11 13 Sep 07 nicklas 301
11 13 Sep 07 nicklas 302     /** Gets all the chip summary parameters */
11 13 Sep 07 nicklas 303     public Vector /*ParameterNameValue*/ getChipSums() {
11 13 Sep 07 nicklas 304         Vector sumParams = new Vector();
11 13 Sep 07 nicklas 305         Vector allParams = genericData.getHeader().getGenericDataHdr().getNameValParams();
11 13 Sep 07 nicklas 306         for (int i=0; i<allParams.size(); i++)
11 13 Sep 07 nicklas 307         {
11 13 Sep 07 nicklas 308             ParameterNameValue param = (ParameterNameValue) allParams.elementAt(i);
11 13 Sep 07 nicklas 309             String name = param.getName();
11 13 Sep 07 nicklas 310             if (name.startsWith(CHP_CHIP_SUM) == true)
11 13 Sep 07 nicklas 311             {
11 13 Sep 07 nicklas 312                 ParameterNameValue sumParam = new ParameterNameValue(param);
11 13 Sep 07 nicklas 313                 sumParam.setName( name.substring(CHP_CHIP_SUM.length(), name.length()));
11 13 Sep 07 nicklas 314                 sumParams.add(sumParam);
11 13 Sep 07 nicklas 315             }
11 13 Sep 07 nicklas 316         }
11 13 Sep 07 nicklas 317         return sumParams;
11 13 Sep 07 nicklas 318     }
11 13 Sep 07 nicklas 319
11 13 Sep 07 nicklas 320     /** Gets a chip summary parameter by name  */
11 13 Sep 07 nicklas 321     public ParameterNameValue getChipSum( String tag) {
11 13 Sep 07 nicklas 322          GenericDataHeader hdr = genericData.getHeader().getGenericDataHdr();
11 13 Sep 07 nicklas 323         ParameterNameValue type = hdr.findNameValParam(CHP_CHIP_SUM + tag);
11 13 Sep 07 nicklas 324         if (type != null)
11 13 Sep 07 nicklas 325             type.setName(tag);
11 13 Sep 07 nicklas 326   return type;
11 13 Sep 07 nicklas 327     }
11 13 Sep 07 nicklas 328
11 13 Sep 07 nicklas 329     /** Gets the file header */
11 13 Sep 07 nicklas 330     public FileHeader getFileHeader() { return genericData.getHeader(); }
11 13 Sep 07 nicklas 331
11 13 Sep 07 nicklas 332     /** Gets the file data object. */
11 13 Sep 07 nicklas 333     public GenericData getGenericData() { return genericData; }  // should be a friend method only
11 13 Sep 07 nicklas 334
11 13 Sep 07 nicklas 335     /** Gets the number of entries (probe sets) */
11 13 Sep 07 nicklas 336     public int getEntryCount() {
11 13 Sep 07 nicklas 337         DataGroupHeader dcHdr = genericData.getHeader().getDataGroup(0);
11 13 Sep 07 nicklas 338   DataSetHeader dpHdr = dcHdr.getDataSet(0);
11 13 Sep 07 nicklas 339   return dpHdr.getRowCnt();
11 13 Sep 07 nicklas 340     }
11 13 Sep 07 nicklas 341
11 13 Sep 07 nicklas 342     /** Gets the number of background zones. */
11 13 Sep 07 nicklas 343     public int getBackgroundZoneCnt() {
11 13 Sep 07 nicklas 344   DataGroupHeader dcHdr = genericData.getHeader().getDataGroup(1);
11 13 Sep 07 nicklas 345   DataSetHeader dpHdr = dcHdr.getDataSet(0);
11 13 Sep 07 nicklas 346   return dpHdr.getRowCnt();
11 13 Sep 07 nicklas 347     }
11 13 Sep 07 nicklas 348
11 13 Sep 07 nicklas 349     /** Gets CHP background zone value
11 13 Sep 07 nicklas 350      *  @param row The row from which to start copying
11 13 Sep 07 nicklas 351      *  @param zone The data object to be filled
11 13 Sep 07 nicklas 352      */
11 13 Sep 07 nicklas 353     public void getBackgroundZone(int row, CHPBackgroundZone zone) {
11 13 Sep 07 nicklas 354   prepareBackgroundZoneDataSet();
11 13 Sep 07 nicklas 355   if (bgZones != null && bgZones.isOpen())
11 13 Sep 07 nicklas 356         {
11 13 Sep 07 nicklas 357             float centerX = bgZones.getDataFloat(row, 0);
11 13 Sep 07 nicklas 358             zone.setCenterX(centerX);
11 13 Sep 07 nicklas 359
11 13 Sep 07 nicklas 360             float centerY = bgZones.getDataFloat(row, 1);
11 13 Sep 07 nicklas 361             zone.setCenterY(centerY);
11 13 Sep 07 nicklas 362
11 13 Sep 07 nicklas 363             float background = bgZones.getDataFloat(row, 2);
11 13 Sep 07 nicklas 364             zone.setBackground(background);
11 13 Sep 07 nicklas 365
11 13 Sep 07 nicklas 366             float smoothFactor = bgZones.getDataFloat(row, 3);
11 13 Sep 07 nicklas 367             zone.setSmoothFactor(smoothFactor);
11 13 Sep 07 nicklas 368   }
11 13 Sep 07 nicklas 369     }
11 13 Sep 07 nicklas 370
11 13 Sep 07 nicklas 371     /** Gets the background zones. */
11 13 Sep 07 nicklas 372     public void getBackgroundZones(int row, int rowCnt, Vector /*CHPBackgroundZone*/ zones) {
11 13 Sep 07 nicklas 373         zones.clear();
11 13 Sep 07 nicklas 374         for(int i = row; i < rowCnt; i++)
11 13 Sep 07 nicklas 375   {
11 13 Sep 07 nicklas 376             CHPBackgroundZone z = new CHPBackgroundZone();
11 13 Sep 07 nicklas 377             getBackgroundZone(i, z);
11 13 Sep 07 nicklas 378             zones.add(z);
11 13 Sep 07 nicklas 379   }
11 13 Sep 07 nicklas 380     }
11 13 Sep 07 nicklas 381
11 13 Sep 07 nicklas 382     /** Gets the expression entry (probe set). */
11 13 Sep 07 nicklas 383     public void getEntry(int row, CHPUniversalEntry e) {
11 13 Sep 07 nicklas 384   prepareUnivEntryDataSet();
11 13 Sep 07 nicklas 385   if (entriesUniv != null && entriesUniv.isOpen() == true)
11 13 Sep 07 nicklas 386   {
11 13 Sep 07 nicklas 387             float background = entriesUniv.getDataFloat(row, 0);
11 13 Sep 07 nicklas 388             e.setBackground(background);
11 13 Sep 07 nicklas 389   }
11 13 Sep 07 nicklas 390     }
11 13 Sep 07 nicklas 391
11 13 Sep 07 nicklas 392     /** Gets the expression entry (probe set). */
11 13 Sep 07 nicklas 393     public void getEntry(int row, CHPGenotypeEntry e) {
11 13 Sep 07 nicklas 394   prepareGenoEntryDataSet();
11 13 Sep 07 nicklas 395   if (entriesGeno != null && entriesGeno.isOpen() == true)
11 13 Sep 07 nicklas 396   {
11 13 Sep 07 nicklas 397     String probeSetName;
11 13 Sep 07 nicklas 398                 if (wideProbeSetNames == false)
11 13 Sep 07 nicklas 399                     probeSetName=entriesGeno.getDataString8(row, 0);
11 13 Sep 07 nicklas 400                 else
11 13 Sep 07 nicklas 401                     probeSetName=entriesGeno.getDataString16(row, 0);
11 13 Sep 07 nicklas 402     e.setProbeSetName(probeSetName);
11 13 Sep 07 nicklas 403
11 13 Sep 07 nicklas 404     byte call = entriesGeno.getDataByte(row, 1);
11 13 Sep 07 nicklas 405     e.setCall(call);
11 13 Sep 07 nicklas 406
11 13 Sep 07 nicklas 407     float confidence = entriesGeno.getDataFloat(row, 2);
11 13 Sep 07 nicklas 408     e.setConfidence(confidence);
11 13 Sep 07 nicklas 409
11 13 Sep 07 nicklas 410     float ras1 = entriesGeno.getDataFloat(row, 3);
11 13 Sep 07 nicklas 411     e.setRAS1(ras1);
11 13 Sep 07 nicklas 412
11 13 Sep 07 nicklas 413     float ras2 = entriesGeno.getDataFloat(row, 4);
11 13 Sep 07 nicklas 414     e.setRAS2(ras2);
11 13 Sep 07 nicklas 415
11 13 Sep 07 nicklas 416     float aaCall = entriesGeno.getDataFloat(row, 5);
11 13 Sep 07 nicklas 417     e.setAACall(aaCall);
11 13 Sep 07 nicklas 418
11 13 Sep 07 nicklas 419     float abCall = entriesGeno.getDataFloat(row, 6);
11 13 Sep 07 nicklas 420     e.setABCall(abCall);
11 13 Sep 07 nicklas 421
11 13 Sep 07 nicklas 422     float bbCall = entriesGeno.getDataFloat(row, 7);
11 13 Sep 07 nicklas 423     e.setBBCall(bbCall);
11 13 Sep 07 nicklas 424
11 13 Sep 07 nicklas 425     float noCall = entriesGeno.getDataFloat(row, 8);
11 13 Sep 07 nicklas 426     e.setNoCall(noCall);
11 13 Sep 07 nicklas 427   }
11 13 Sep 07 nicklas 428     }
11 13 Sep 07 nicklas 429
11 13 Sep 07 nicklas 430     /** Gets the expression entry (probe set). */
11 13 Sep 07 nicklas 431     public void getEntry(int row, CHPExpressionEntry e) {
11 13 Sep 07 nicklas 432   prepareExprEntryDataSet();
11 13 Sep 07 nicklas 433   if (entriesExp != null && entriesExp.isOpen() == true)
11 13 Sep 07 nicklas 434   {
11 13 Sep 07 nicklas 435             int colIndex = 0;
11 13 Sep 07 nicklas 436             String probeSetName;
11 13 Sep 07 nicklas 437             if (wideProbeSetNames == false)
11 13 Sep 07 nicklas 438                 probeSetName = entriesExp.getDataString8(row, colIndex);
11 13 Sep 07 nicklas 439             else
11 13 Sep 07 nicklas 440                 probeSetName = entriesExp.getDataString16(row, colIndex);
11 13 Sep 07 nicklas 441             ++colIndex;
11 13 Sep 07 nicklas 442             e.setProbeSetName(probeSetName);
11 13 Sep 07 nicklas 443
11 13 Sep 07 nicklas 444             byte detection = entriesExp.getDataByte(row, colIndex);
11 13 Sep 07 nicklas 445             ++colIndex;
11 13 Sep 07 nicklas 446             e.setDetection(detection);
11 13 Sep 07 nicklas 447
11 13 Sep 07 nicklas 448             float detectionPValue = entriesExp.getDataFloat(row, colIndex);
11 13 Sep 07 nicklas 449             ++colIndex;
11 13 Sep 07 nicklas 450             e.setDetectionPValue(detectionPValue);
11 13 Sep 07 nicklas 451
11 13 Sep 07 nicklas 452             float signal = entriesExp.getDataFloat(row, colIndex);
11 13 Sep 07 nicklas 453             ++colIndex;
11 13 Sep 07 nicklas 454             e.setSignal(signal);
11 13 Sep 07 nicklas 455
11 13 Sep 07 nicklas 456             short numPairs = entriesExp.getDataShort(row, colIndex);
11 13 Sep 07 nicklas 457             ++colIndex;
11 13 Sep 07 nicklas 458             e.setNumPairs(numPairs);
11 13 Sep 07 nicklas 459
11 13 Sep 07 nicklas 460             short numPairsUsed = entriesExp.getDataShort(row, colIndex);
11 13 Sep 07 nicklas 461             ++colIndex;
11 13 Sep 07 nicklas 462             e.setNumPairsUsed(numPairsUsed);
11 13 Sep 07 nicklas 463
11 13 Sep 07 nicklas 464             e.setHasComparisonData(false);
11 13 Sep 07 nicklas 465
11 13 Sep 07 nicklas 466             if (entriesExp.getCols() > colIndex)
11 13 Sep 07 nicklas 467             {
11 13 Sep 07 nicklas 468                 e.setHasComparisonData(true);
11 13 Sep 07 nicklas 469
11 13 Sep 07 nicklas 470                 byte change = entriesExp.getDataByte(row, colIndex);
11 13 Sep 07 nicklas 471                 ++colIndex;
11 13 Sep 07 nicklas 472                 e.setChange(change);
11 13 Sep 07 nicklas 473
11 13 Sep 07 nicklas 474                 float changePValue = entriesExp.getDataFloat(row, colIndex);
11 13 Sep 07 nicklas 475                 ++colIndex;
11 13 Sep 07 nicklas 476                 e.setChangePValue(changePValue);
11 13 Sep 07 nicklas 477
11 13 Sep 07 nicklas 478                 float sigLogRatio = entriesExp.getDataFloat(row, colIndex);
11 13 Sep 07 nicklas 479                 ++colIndex;
11 13 Sep 07 nicklas 480                 e.setSigLogRatio(sigLogRatio);
11 13 Sep 07 nicklas 481
11 13 Sep 07 nicklas 482                 float sigLogRatioLo = entriesExp.getDataFloat(row, colIndex);
11 13 Sep 07 nicklas 483                 ++colIndex;
11 13 Sep 07 nicklas 484                 e.setSigLogRatioLo(sigLogRatioLo);
11 13 Sep 07 nicklas 485
11 13 Sep 07 nicklas 486                 float sigLogRatioHi = entriesExp.getDataFloat(row, colIndex);
11 13 Sep 07 nicklas 487                 ++colIndex;
11 13 Sep 07 nicklas 488                 e.setSigLogRatioHi(sigLogRatioHi);
11 13 Sep 07 nicklas 489
11 13 Sep 07 nicklas 490                 short commonPairs = entriesExp.getDataShort(row, colIndex);
11 13 Sep 07 nicklas 491                 ++colIndex;
11 13 Sep 07 nicklas 492                 e.setCommonPairs(commonPairs);
11 13 Sep 07 nicklas 493             }
11 13 Sep 07 nicklas 494   }
11 13 Sep 07 nicklas 495     }
11 13 Sep 07 nicklas 496     
11 13 Sep 07 nicklas 497     /** Gets the resequence entry. */
11 13 Sep 07 nicklas 498     public void getEntry(int row, CHPReseqEntry e) {
11 13 Sep 07 nicklas 499   prepareReseqEntryDataSet();
11 13 Sep 07 nicklas 500   if (entriesReseq != null && entriesReseq.isOpen() == true)
11 13 Sep 07 nicklas 501   {
11 13 Sep 07 nicklas 502             e.setCall((char)entriesReseq.getDataByte(row, 0));
11 13 Sep 07 nicklas 503             e.setScore(entriesReseq.getDataFloat(row, 1));
11 13 Sep 07 nicklas 504   }
11 13 Sep 07 nicklas 505     }
11 13 Sep 07 nicklas 506
11 13 Sep 07 nicklas 507     /** Gets the number of force calls. */
11 13 Sep 07 nicklas 508     public int getForceCnt() {
11 13 Sep 07 nicklas 509         DataGroupHeader dcHdr = genericData.getHeader().getDataGroup(2);
11 13 Sep 07 nicklas 510   DataSetHeader dpHdr = dcHdr.getDataSet(0);
11 13 Sep 07 nicklas 511   return dpHdr.getRowCnt();
11 13 Sep 07 nicklas 512     }
11 13 Sep 07 nicklas 513
11 13 Sep 07 nicklas 514     /** Gets the force call value
11 13 Sep 07 nicklas 515      *  @param row The row index
11 13 Sep 07 nicklas 516      *  @param force The data object to be filled
11 13 Sep 07 nicklas 517      */
11 13 Sep 07 nicklas 518     public void getForceCall(int row, CHPReseqForceCall force) {
11 13 Sep 07 nicklas 519   prepareForceDataSet();
11 13 Sep 07 nicklas 520   if (forceSet != null && forceSet.isOpen() == true)
11 13 Sep 07 nicklas 521   {
11 13 Sep 07 nicklas 522             force.setPosition(forceSet.getDataInt(row, 0));
11 13 Sep 07 nicklas 523             force.setCall((char) forceSet.getDataByte(row, 1));
11 13 Sep 07 nicklas 524             force.setReason((char) forceSet.getDataByte(row, 2));
11 13 Sep 07 nicklas 525   }
11 13 Sep 07 nicklas 526     }
11 13 Sep 07 nicklas 527
11 13 Sep 07 nicklas 528     /** Gets the number of orig calls. */
11 13 Sep 07 nicklas 529     public int getOrigCnt() {
11 13 Sep 07 nicklas 530   DataGroupHeader dcHdr = genericData.getHeader().getDataGroup(3);
11 13 Sep 07 nicklas 531   DataSetHeader dpHdr = dcHdr.getDataSet(0);
11 13 Sep 07 nicklas 532   return dpHdr.getRowCnt();
11 13 Sep 07 nicklas 533     }
11 13 Sep 07 nicklas 534
11 13 Sep 07 nicklas 535     /** Gets the original call value from the orig set.
11 13 Sep 07 nicklas 536      *  @param row The row index
11 13 Sep 07 nicklas 537      *  @param orig The orginal call value.
11 13 Sep 07 nicklas 538      */
11 13 Sep 07 nicklas 539     public void getOrigCall(int row, CHPReseqOrigCall orig) {
11 13 Sep 07 nicklas 540   prepareOrigDataSet();
11 13 Sep 07 nicklas 541   if (origSet != null && origSet.isOpen() == true)
11 13 Sep 07 nicklas 542   {
11 13 Sep 07 nicklas 543             orig.setPosition(origSet.getDataInt(row, 0));
11 13 Sep 07 nicklas 544             orig.setCall((char) origSet.getDataByte(row, 1));
11 13 Sep 07 nicklas 545   }
11 13 Sep 07 nicklas 546     }
11 13 Sep 07 nicklas 547
11 13 Sep 07 nicklas 548     /** Prepares the data set. */
11 13 Sep 07 nicklas 549     private void prepareGenoEntryDataSet() {
11 13 Sep 07 nicklas 550   if (entriesGeno == null)
11 13 Sep 07 nicklas 551   {
11 13 Sep 07 nicklas 552             try
11 13 Sep 07 nicklas 553             {
11 13 Sep 07 nicklas 554                 entriesGeno = genericData.getDataSet(CHP_GENO_GROUP, CHP_GENO_GROUP);
11 13 Sep 07 nicklas 555                 if (entriesGeno != null)
11 13 Sep 07 nicklas 556                 {
11 13 Sep 07 nicklas 557                     entriesGeno.open();
11 13 Sep 07 nicklas 558                     wideProbeSetNames = (entriesGeno.getHeader().getColumnInfo(0).getColumnType() == ColumnInfo.UnicodeCharColType);
11 13 Sep 07 nicklas 559                 }
11 13 Sep 07 nicklas 560             }
11 13 Sep 07 nicklas 561             catch (Throwable t)
11 13 Sep 07 nicklas 562             {
11 13 Sep 07 nicklas 563                 entriesGeno = null;
11 13 Sep 07 nicklas 564             }
11 13 Sep 07 nicklas 565   }
11 13 Sep 07 nicklas 566     }
11 13 Sep 07 nicklas 567
11 13 Sep 07 nicklas 568     /** Prepares the data set. */
11 13 Sep 07 nicklas 569     private void prepareExprEntryDataSet() {
11 13 Sep 07 nicklas 570   if (entriesExp == null)
11 13 Sep 07 nicklas 571   {
11 13 Sep 07 nicklas 572             try
11 13 Sep 07 nicklas 573             {
11 13 Sep 07 nicklas 574                 entriesExp = genericData.getDataSet(CHP_EXPR_GROUP, CHP_EXPR_GROUP);
11 13 Sep 07 nicklas 575                 if (entriesExp != null)
11 13 Sep 07 nicklas 576                 {
11 13 Sep 07 nicklas 577                     entriesExp.open();
11 13 Sep 07 nicklas 578                     wideProbeSetNames = (entriesExp.getHeader().getColumnInfo(0).getColumnType() == ColumnInfo.UnicodeCharColType);
11 13 Sep 07 nicklas 579                 }
11 13 Sep 07 nicklas 580             }
11 13 Sep 07 nicklas 581             catch (Throwable t)
11 13 Sep 07 nicklas 582             {
11 13 Sep 07 nicklas 583                 entriesExp = null;
11 13 Sep 07 nicklas 584             }
11 13 Sep 07 nicklas 585   }
11 13 Sep 07 nicklas 586     }
11 13 Sep 07 nicklas 587
11 13 Sep 07 nicklas 588     /** Prepares the data set. */
11 13 Sep 07 nicklas 589     private void prepareUnivEntryDataSet() {
11 13 Sep 07 nicklas 590   if (entriesUniv == null)
11 13 Sep 07 nicklas 591   {
11 13 Sep 07 nicklas 592             try
11 13 Sep 07 nicklas 593             {
11 13 Sep 07 nicklas 594                 entriesUniv = genericData.getDataSet(CHP_UNIV_GROUP, CHP_UNIV_GROUP);
11 13 Sep 07 nicklas 595                 if (entriesUniv != null)
11 13 Sep 07 nicklas 596                 {
11 13 Sep 07 nicklas 597                     entriesUniv.open();
11 13 Sep 07 nicklas 598                 }
11 13 Sep 07 nicklas 599             }
11 13 Sep 07 nicklas 600             catch (Throwable t)
11 13 Sep 07 nicklas 601             {
11 13 Sep 07 nicklas 602                 entriesUniv = null;
11 13 Sep 07 nicklas 603             }
11 13 Sep 07 nicklas 604   }
11 13 Sep 07 nicklas 605     }
11 13 Sep 07 nicklas 606
11 13 Sep 07 nicklas 607     /** Prepares the data set. */
11 13 Sep 07 nicklas 608     private void prepareReseqEntryDataSet() {
11 13 Sep 07 nicklas 609   if (entriesReseq == null)
11 13 Sep 07 nicklas 610         {
11 13 Sep 07 nicklas 611             try
11 13 Sep 07 nicklas 612             {
11 13 Sep 07 nicklas 613                 entriesReseq = genericData.getDataSet(CHP_RESEQ_GROUP, CHP_RESEQ_GROUP);
11 13 Sep 07 nicklas 614                 if (entriesReseq != null)
11 13 Sep 07 nicklas 615                 {
11 13 Sep 07 nicklas 616                     entriesReseq.open();
11 13 Sep 07 nicklas 617                 }
11 13 Sep 07 nicklas 618             }
11 13 Sep 07 nicklas 619             catch (Throwable t)
11 13 Sep 07 nicklas 620             {
11 13 Sep 07 nicklas 621                 entriesReseq = null;
11 13 Sep 07 nicklas 622             }
11 13 Sep 07 nicklas 623   }
11 13 Sep 07 nicklas 624     }
11 13 Sep 07 nicklas 625     
11 13 Sep 07 nicklas 626     /** Gets a string parameter to the header. */
11 13 Sep 07 nicklas 627     private String getWStringFromGenericHdr( String name) {
11 13 Sep 07 nicklas 628         GenericDataHeader hdr = genericData.getHeader().getGenericDataHdr();
11 13 Sep 07 nicklas 629         ParameterNameValue paramType = hdr.findNameValParam(name);
11 13 Sep 07 nicklas 630         if (paramType != null)
11 13 Sep 07 nicklas 631             return paramType.getValueText();
11 13 Sep 07 nicklas 632   return null;
11 13 Sep 07 nicklas 633     }
11 13 Sep 07 nicklas 634
11 13 Sep 07 nicklas 635     /** Gets an integer parameter from the header. */
11 13 Sep 07 nicklas 636     private int getInt32FromGenericHdr( String name) {
11 13 Sep 07 nicklas 637   GenericDataHeader hdr = genericData.getHeader().getGenericDataHdr();
11 13 Sep 07 nicklas 638         ParameterNameValue paramType = hdr.findNameValParam(name);
11 13 Sep 07 nicklas 639         if (paramType != null)
11 13 Sep 07 nicklas 640             return paramType.getValueInt32();
11 13 Sep 07 nicklas 641   return 0;
11 13 Sep 07 nicklas 642     }
11 13 Sep 07 nicklas 643
11 13 Sep 07 nicklas 644     /** Prepares the data set for the bg set. */
11 13 Sep 07 nicklas 645     private void prepareBackgroundZoneDataSet() {
11 13 Sep 07 nicklas 646   if (bgZones == null)
11 13 Sep 07 nicklas 647   {
11 13 Sep 07 nicklas 648             try
11 13 Sep 07 nicklas 649             {
11 13 Sep 07 nicklas 650                 bgZones = genericData.getDataSet(CHP_BG_ZONE_GROUP, CHP_BG_ZONE_GROUP);
11 13 Sep 07 nicklas 651                 if (bgZones != null)
11 13 Sep 07 nicklas 652                 {
11 13 Sep 07 nicklas 653                     bgZones.open();
11 13 Sep 07 nicklas 654                 }
11 13 Sep 07 nicklas 655             }
11 13 Sep 07 nicklas 656             catch (Throwable t)
11 13 Sep 07 nicklas 657             {
11 13 Sep 07 nicklas 658                 bgZones = null;
11 13 Sep 07 nicklas 659             }
11 13 Sep 07 nicklas 660   }
11 13 Sep 07 nicklas 661     }
11 13 Sep 07 nicklas 662
11 13 Sep 07 nicklas 663     /** Prepares the data set for the force call set. */
11 13 Sep 07 nicklas 664     private void prepareForceDataSet() {
11 13 Sep 07 nicklas 665   if (forceSet == null)
11 13 Sep 07 nicklas 666   {
11 13 Sep 07 nicklas 667             try
11 13 Sep 07 nicklas 668             {
11 13 Sep 07 nicklas 669                 forceSet = genericData.getDataSet(CHP_RESEQ_FORCE_CALL_GROUP, CHP_RESEQ_FORCE_CALL_GROUP);
11 13 Sep 07 nicklas 670                 if (forceSet != null)
11 13 Sep 07 nicklas 671                 {
11 13 Sep 07 nicklas 672                     forceSet.open();
11 13 Sep 07 nicklas 673                 }
11 13 Sep 07 nicklas 674             }
11 13 Sep 07 nicklas 675             catch (Throwable t)
11 13 Sep 07 nicklas 676             {
11 13 Sep 07 nicklas 677                 forceSet = null;
11 13 Sep 07 nicklas 678             }
11 13 Sep 07 nicklas 679   }
11 13 Sep 07 nicklas 680     }
11 13 Sep 07 nicklas 681
11 13 Sep 07 nicklas 682     /** Prepares the data set for the orig call set. */
11 13 Sep 07 nicklas 683     private void prepareOrigDataSet() {
11 13 Sep 07 nicklas 684   if (origSet == null)
11 13 Sep 07 nicklas 685   {
11 13 Sep 07 nicklas 686             try
11 13 Sep 07 nicklas 687             {
11 13 Sep 07 nicklas 688                 origSet = genericData.getDataSet(CHP_RESEQ_ORIG_CALL_GROUP, CHP_RESEQ_ORIG_CALL_GROUP);
11 13 Sep 07 nicklas 689                 if (origSet != null)
11 13 Sep 07 nicklas 690                 {
11 13 Sep 07 nicklas 691                     origSet.open();
11 13 Sep 07 nicklas 692                 }
11 13 Sep 07 nicklas 693             }
11 13 Sep 07 nicklas 694             catch (Throwable t)
11 13 Sep 07 nicklas 695             {
11 13 Sep 07 nicklas 696                 origSet = null;
11 13 Sep 07 nicklas 697             }
11 13 Sep 07 nicklas 698   }
11 13 Sep 07 nicklas 699     }
11 13 Sep 07 nicklas 700
11 13 Sep 07 nicklas 701 }