mev-4.0.01/source/org/tigr/microarray/mev/cluster/algorithm/impl/LEM.java

Code
Comments
Other
Rev Date Author Line
2 26 Feb 07 jari 1 /*
2 26 Feb 07 jari 2 Copyright @ 1999-2006, The Institute for Genomic Research (TIGR).
2 26 Feb 07 jari 3 All rights reserved.
2 26 Feb 07 jari 4 */
2 26 Feb 07 jari 5 package org.tigr.microarray.mev.cluster.algorithm.impl;
2 26 Feb 07 jari 6
2 26 Feb 07 jari 7 import java.util.Hashtable;
2 26 Feb 07 jari 8 import java.util.Vector;
2 26 Feb 07 jari 9
2 26 Feb 07 jari 10 import org.tigr.microarray.mev.cluster.algorithm.AbstractAlgorithm;
2 26 Feb 07 jari 11 import org.tigr.microarray.mev.cluster.algorithm.AlgorithmData;
2 26 Feb 07 jari 12 import org.tigr.microarray.mev.cluster.algorithm.AlgorithmEvent;
2 26 Feb 07 jari 13 import org.tigr.microarray.mev.cluster.algorithm.AlgorithmException;
2 26 Feb 07 jari 14 import org.tigr.util.FloatMatrix;
2 26 Feb 07 jari 15 import org.tigr.util.QSort;
2 26 Feb 07 jari 16
2 26 Feb 07 jari 17 /**
2 26 Feb 07 jari 18  * @author braisted
2 26 Feb 07 jari 19  * 
2 26 Feb 07 jari 20  * Class to handle sorting data by chromosomal location
2 26 Feb 07 jari 21  * Returns:
2 26 Feb 07 jari 22  * 
2 26 Feb 07 jari 23  * 1.) a condensed matrix of sorted and averaged values
2 26 Feb 07 jari 24  * where rows are in 'start location' order and averages are taken for
2 26 Feb 07 jari 25  * in-slide replicates.
2 26 Feb 07 jari 26  * 
2 26 Feb 07 jari 27  * 2.) A 2D array of replicate indices, rows are sorted by locus location
2 26 Feb 07 jari 28  * for each locus there will be one or more indices to IData that represnt
2 26 Feb 07 jari 29  * replicate spots.  This is for mapping locus to relevant spots.
2 26 Feb 07 jari 30  * 
2 26 Feb 07 jari 31  * 3.) 'Strata' if loci overlap, a strata is determined to display an offset
2 26 Feb 07 jari 32  * for each of the overlapping loci.  This is used by the viewer under
2 26 Feb 07 jari 33  * the 'scaled' viewer mode.
2 26 Feb 07 jari 34  * 
2 26 Feb 07 jari 35  * 4.) Direction array indicates if 'start' < 'end' location, if reversed transcription
2 26 Feb 07 jari 36  * is on the 'antisense' strand, relevant to prokaryotic organisms.
2 26 Feb 07 jari 37  * 
2 26 Feb 07 jari 38  * 5.) Sorted locus names (id's sorted by location)
2 26 Feb 07 jari 39  * 
2 26 Feb 07 jari 40  * 6.) Sorted start locations
2 26 Feb 07 jari 41  * 
2 26 Feb 07 jari 42  * 7.) Sorted end locations
2 26 Feb 07 jari 43  * 
2 26 Feb 07 jari 44  */
2 26 Feb 07 jari 45 public class LEM extends AbstractAlgorithm {
2 26 Feb 07 jari 46
2 26 Feb 07 jari 47   
2 26 Feb 07 jari 48   private int [] sortedStart;
2 26 Feb 07 jari 49   private int [] sortedEnd;
2 26 Feb 07 jari 50     
2 26 Feb 07 jari 51   /**
2 26 Feb 07 jari 52    * Uses parameters and raw data in AlgorithmData to construct
2 26 Feb 07 jari 53    * output described in the LEM class description above.
2 26 Feb 07 jari 54    */
2 26 Feb 07 jari 55   public AlgorithmData execute(AlgorithmData data) throws AlgorithmException {
2 26 Feb 07 jari 56     
2 26 Feb 07 jari 57     //experiment indices for the loci passed in
2 26 Feb 07 jari 58     int [] origIndices = data.getIntArray("original-indices");
2 26 Feb 07 jari 59
2 26 Feb 07 jari 60     //idata indices for the current float matrix
2 26 Feb 07 jari 61     int [] idataIndices = data.getIntArray("idata-indices");
2 26 Feb 07 jari 62     
2 26 Feb 07 jari 63     FloatMatrix fm = data.getMatrix("expression-matrix");
2 26 Feb 07 jari 64     String [] locusArray = data.getStringArray("locus-array");
2 26 Feb 07 jari 65     int [] start = data.getIntArray("start-array");
2 26 Feb 07 jari 66     int [] end = data.getIntArray("end-array");
2 26 Feb 07 jari 67     
2 26 Feb 07 jari 68     //unique locus array and vector of vector indices where each index
2 26 Feb 07 jari 69     //in a vector corresponds to the same locus
2 26 Feb 07 jari 70     Vector lociV = new Vector();        
2 26 Feb 07 jari 71     
2 26 Feb 07 jari 72     Vector v;
2 26 Feb 07 jari 73     int index;
2 26 Feb 07 jari 74     int missingDataCount = 0;
2 26 Feb 07 jari 75     //also construct a hash from locus to an origial IData index
2 26 Feb 07 jari 76     //Hashtable locus2IDataIndex = new Hashtable();
2 26 Feb 07 jari 77     
2 26 Feb 07 jari 78     AlgorithmEvent event = new AlgorithmEvent(this, AlgorithmEvent.MONITOR_VALUE, 0, "Building and Validating Locus Vector\n");
2 26 Feb 07 jari 79     this.fireValueChanged(event);
2 26 Feb 07 jari 80
2 26 Feb 07 jari 81     //holds full experiment IData indices for replicates array and 
2 26 Feb 07 jari 82     //for value extraction
2 26 Feb 07 jari 83     Hashtable table = new Hashtable(locusArray.length);
2 26 Feb 07 jari 84     
2 26 Feb 07 jari 85     //holds locus index (relative to current run) to map locus to start and end arrays
2 26 Feb 07 jari 86     Hashtable locusToStartArrayTable = new Hashtable(locusArray.length);
2 26 Feb 07 jari 87     
2 26 Feb 07 jari 88     Vector indicesV;
2 26 Feb 07 jari 89     
2 26 Feb 07 jari 90     for(int i = 0; i < locusArray.length; i++) {
2 26 Feb 07 jari 91
2 26 Feb 07 jari 92       //filter null locus ids and flagged missing coordinates
2 26 Feb 07 jari 93       if(locusArray[i].equals("") || start[i] == -1 || end[i] == -1) {
2 26 Feb 07 jari 94         missingDataCount++;
2 26 Feb 07 jari 95         continue;
2 26 Feb 07 jari 96       }
2 26 Feb 07 jari 97     
2 26 Feb 07 jari 98       //handle refs to full experiment
2 26 Feb 07 jari 99       v = (Vector)table.get(locusArray[i]);      
2 26 Feb 07 jari 100       if(v == null) {
2 26 Feb 07 jari 101         v = new Vector();
2 26 Feb 07 jari 102         table.put(locusArray[i], v);
2 26 Feb 07 jari 103         lociV.add(locusArray[i]);
2 26 Feb 07 jari 104       }
2 26 Feb 07 jari 105             
2 26 Feb 07 jari 106             
2 26 Feb 07 jari 107       //map to IData
2 26 Feb 07 jari 108       v.add(new Integer(idataIndices[origIndices[i]]));        
2 26 Feb 07 jari 109       //try to just store locus index
2 26 Feb 07 jari 110       //v.add(new Integer(i));
2 26 Feb 07 jari 111         
2 26 Feb 07 jari 112       //handle refs with this anlysis relative to locus array
2 26 Feb 07 jari 113       indicesV = (Vector)locusToStartArrayTable.get(locusArray[i]);      
2 26 Feb 07 jari 114
2 26 Feb 07 jari 115       if(indicesV == null) {
2 26 Feb 07 jari 116         indicesV = new Vector();
2 26 Feb 07 jari 117         locusToStartArrayTable.put(locusArray[i], indicesV);
2 26 Feb 07 jari 118       }
2 26 Feb 07 jari 119       
2 26 Feb 07 jari 120       //just store the locus index (not mapped to experiment)
2 26 Feb 07 jari 121       indicesV.add(new Integer(i));      
2 26 Feb 07 jari 122
2 26 Feb 07 jari 123     }
2 26 Feb 07 jari 124
2 26 Feb 07 jari 125     //get min coord. and direction info.
2 26 Feb 07 jari 126     float [] minCoord = new float[lociV.size()];
2 26 Feb 07 jari 127     int [] direction = new int[lociV.size()];
2 26 Feb 07 jari 128     
2 26 Feb 07 jari 129     event = new AlgorithmEvent(this, AlgorithmEvent.MONITOR_VALUE, 0, "Determining Loci Read Polarity\n");
2 26 Feb 07 jari 130     this.fireValueChanged(event);
2 26 Feb 07 jari 131     
2 26 Feb 07 jari 132     for(int i = 0; i < minCoord.length; i++) {
2 26 Feb 07 jari 133     //  index = ((Integer)(((Vector)(table.get(lociV.get(i)))).get(0))).intValue();
2 26 Feb 07 jari 134       
2 26 Feb 07 jari 135       index = ((Integer)(((Vector)(locusToStartArrayTable.get(lociV.get(i)))).get(0))).intValue();
2 26 Feb 07 jari 136       
2 26 Feb 07 jari 137       
2 26 Feb 07 jari 138       if(start[index] < end[index]) {
2 26 Feb 07 jari 139         minCoord[i] = start[index];
2 26 Feb 07 jari 140         direction[i] = 1;
2 26 Feb 07 jari 141       } else {
2 26 Feb 07 jari 142         minCoord[i] = end[index];
2 26 Feb 07 jari 143         direction[i] = -1;
2 26 Feb 07 jari 144       }
2 26 Feb 07 jari 145     }
2 26 Feb 07 jari 146
2 26 Feb 07 jari 147     event = new AlgorithmEvent(this, AlgorithmEvent.MONITOR_VALUE, 0, "Sorting Loci on Location\n");
2 26 Feb 07 jari 148     this.fireValueChanged(event);
2 26 Feb 07 jari 149
2 26 Feb 07 jari 150     //sort on min coord
2 26 Feb 07 jari 151     QSort qsort;
2 26 Feb 07 jari 152     //constructs and sorts
2 26 Feb 07 jari 153     qsort = new QSort(minCoord);
2 26 Feb 07 jari 154     int [] sortedIndices = qsort.getOrigIndx();
2 26 Feb 07 jari 155     float [] sortedCoords = qsort.getSorted();
2 26 Feb 07 jari 156     
2 26 Feb 07 jari 157     //need to sort the direction of loci
2 26 Feb 07 jari 158     int [] sortedDirection = new int[direction.length];
2 26 Feb 07 jari 159
2 26 Feb 07 jari 160     //order the direction array based on new sorted order
2 26 Feb 07 jari 161     for(int i = 0; i < direction.length; i++) {
2 26 Feb 07 jari 162       sortedDirection[i] = direction[sortedIndices[i]];
2 26 Feb 07 jari 163     }
2 26 Feb 07 jari 164         
2 26 Feb 07 jari 165     //construct an ordered list of replicate sets and condensed FloatMatrix
2 26 Feb 07 jari 166     int [][] replicates = new int[minCoord.length][];
2 26 Feb 07 jari 167     
2 26 Feb 07 jari 168     //vector of IData indices
2 26 Feb 07 jari 169     Vector repIDataVector;
2 26 Feb 07 jari 170     
2 26 Feb 07 jari 171     //vector of current FloatMatrix row indices
2 26 Feb 07 jari 172     Vector repVector;
2 26 Feb 07 jari 173     
2 26 Feb 07 jari 174     int [] array;
2 26 Feb 07 jari 175     int numCol = fm.getColumnDimension();
2 26 Feb 07 jari 176     FloatMatrix condensedMatrix = new FloatMatrix(minCoord.length, numCol);
2 26 Feb 07 jari 177     int [] validN;
2 26 Feb 07 jari 178     float [] sumExp;
2 26 Feb 07 jari 179     
2 26 Feb 07 jari 180     sortedStart = new int[replicates.length];       
2 26 Feb 07 jari 181     sortedEnd = new int[replicates.length];
2 26 Feb 07 jari 182     
2 26 Feb 07 jari 183     int [] sortedIDataIndices = new int[replicates.length];
2 26 Feb 07 jari 184     String [] sortedLociNames = new String[sortedIndices.length];
2 26 Feb 07 jari 185         
2 26 Feb 07 jari 186     event = new AlgorithmEvent(this, AlgorithmEvent.MONITOR_VALUE, 0, "Logging Spot to Locus Mapping and... \n ...Locus Mean Expression Calculation\n");
2 26 Feb 07 jari 187     this.fireValueChanged(event);
2 26 Feb 07 jari 188     
2 26 Feb 07 jari 189     //System.out.println("num replicates = "+replicates.length);
2 26 Feb 07 jari 190     
2 26 Feb 07 jari 191     for(int i = 0; i < replicates.length; i++) {
2 26 Feb 07 jari 192
2 26 Feb 07 jari 193       //grab the sorted locus name using sorted indices
2 26 Feb 07 jari 194       sortedLociNames[i] = (String)(lociV.get(sortedIndices[i]));
2 26 Feb 07 jari 195
2 26 Feb 07 jari 196       //current replicate vector
2 26 Feb 07 jari 197       repIDataVector = (Vector)(table.get(sortedLociNames[i]));      
2 26 Feb 07 jari 198
2 26 Feb 07 jari 199       //prepare to convert to array
2 26 Feb 07 jari 200       array = new int[repIDataVector.size()];
2 26 Feb 07 jari 201       
2 26 Feb 07 jari 202       //populate replicate array
2 26 Feb 07 jari 203       for(int m = 0; m < array.length; m++)
2 26 Feb 07 jari 204         array[m] = ((Integer)repIDataVector.get(m)).intValue();
2 26 Feb 07 jari 205
2 26 Feb 07 jari 206       //append current array
2 26 Feb 07 jari 207       replicates[i] = array;
2 26 Feb 07 jari 208     
2 26 Feb 07 jari 209       //replicates array has IData indices
2 26 Feb 07 jari 210       sortedIDataIndices[i] = replicates[i][0];
2 26 Feb 07 jari 211       
2 26 Feb 07 jari 212       //current FloatMatrix row replicates
2 26 Feb 07 jari 213       repVector = (Vector)(locusToStartArrayTable.get(sortedLociNames[i]));
2 26 Feb 07 jari 214       
2 26 Feb 07 jari 215       array = new int[repVector.size()];
2 26 Feb 07 jari 216       
2 26 Feb 07 jari 217       //populate indices
2 26 Feb 07 jari 218       for(int m = 0; m < array.length; m++)
2 26 Feb 07 jari 219         array[m] = origIndices[((Integer)repVector.get(m)).intValue()];
2 26 Feb 07 jari 220       
2 26 Feb 07 jari 221       //average expression of replicates expression
2 26 Feb 07 jari 222       validN = new int[numCol];
2 26 Feb 07 jari 223       sumExp = new float[numCol];
2 26 Feb 07 jari 224       
2 26 Feb 07 jari 225       //build new FloatMatrix entry and grab valid number count
2 26 Feb 07 jari 226       for(int j = 0; j < array.length; j++) { //over replicates
2 26 Feb 07 jari 227         for(int k = 0; k < numCol; k++) {
2 26 Feb 07 jari 228           if(!Float.isNaN(fm.A[array[j]][k])) {
2 26 Feb 07 jari 229             validN[k]++;
2 26 Feb 07 jari 230             sumExp[k] += fm.A[array[j]][k];
2 26 Feb 07 jari 231           }          
2 26 Feb 07 jari 232         }
2 26 Feb 07 jari 233       }
2 26 Feb 07 jari 234       
2 26 Feb 07 jari 235       //take mean
2 26 Feb 07 jari 236       for(int j = 0; j < numCol; j++) {
2 26 Feb 07 jari 237         if(validN[j] > 0)
2 26 Feb 07 jari 238           sumExp[j] /= validN[j];
2 26 Feb 07 jari 239         else
2 26 Feb 07 jari 240           sumExp[j] = Float.NaN;
2 26 Feb 07 jari 241       }
2 26 Feb 07 jari 242       
2 26 Feb 07 jari 243       //drop into new FloatMatrix in sorted order
2 26 Feb 07 jari 244       condensedMatrix.A[i] = sumExp;
2 26 Feb 07 jari 245       
2 26 Feb 07 jari 246       index = ((Integer)(((Vector)(locusToStartArrayTable.get(sortedLociNames[i]))).get(0))).intValue();
2 26 Feb 07 jari 247       sortedStart[i] = Math.min(start[index], end[index]);
2 26 Feb 07 jari 248       sortedEnd[i] = Math.max(start[index], end[index]);
2 26 Feb 07 jari 249     }
2 26 Feb 07 jari 250     
2 26 Feb 07 jari 251     //build strata
2 26 Feb 07 jari 252     //for each sorted locus have a sorted start and end and determine
2 26 Feb 07 jari 253     //overlap and strata with one pass    
2 26 Feb 07 jari 254     int [] strata = getStrataArray();
2 26 Feb 07 jari 255     
2 26 Feb 07 jari 256     
2 26 Feb 07 jari 257     //accumulate results
2 26 Feb 07 jari 258     
2 26 Feb 07 jari 259     //sorted locus names
2 26 Feb 07 jari 260     data.addStringArray("sorted-loci-names", sortedLociNames);
2 26 Feb 07 jari 261
2 26 Feb 07 jari 262     //this holds IData replicates in Locus coord, order
2 26 Feb 07 jari 263     //required for selecting spots for a cluster or for finding
2 26 Feb 07 jari 264     //individual expression values for each loci (replicate measures)
2 26 Feb 07 jari 265     data.addIntMatrix("replication-indices-matrix", replicates);
2 26 Feb 07 jari 266
2 26 Feb 07 jari 267     //Matrix and indices can be used to build a new Experiment for the viewer
2 26 Feb 07 jari 268     data.addMatrix("condensed-matrix", condensedMatrix);
2 26 Feb 07 jari 269     data.addIntArray("sorted-idata-indices", sortedIDataIndices);
2 26 Feb 07 jari 270     
2 26 Feb 07 jari 271     //sorted start and end points (min and max coord regardless of direction)
2 26 Feb 07 jari 272     data.addIntArray("sorted-start", sortedStart);
2 26 Feb 07 jari 273     data.addIntArray("sorted-end", sortedEnd);
2 26 Feb 07 jari 274
2 26 Feb 07 jari 275     //direction indicator, 1 == forward, -1 == back
2 26 Feb 07 jari 276     data.addIntArray("direction-array", sortedDirection);
2 26 Feb 07 jari 277     
2 26 Feb 07 jari 278     //offset for overlaps
2 26 Feb 07 jari 279     data.addIntArray("strata-array", strata);
2 26 Feb 07 jari 280     data.addParam("missing-data-count", String.valueOf(missingDataCount));
2 26 Feb 07 jari 281     
2 26 Feb 07 jari 282     return data;
2 26 Feb 07 jari 283   }
2 26 Feb 07 jari 284
2 26 Feb 07 jari 285
2 26 Feb 07 jari 286
2 26 Feb 07 jari 287
2 26 Feb 07 jari 288   //strata strategy
2 26 Feb 07 jari 289   //look for all overlaps with a smaller start value
2 26 Feb 07 jari 290   //sort overlaps by strata
2 26 Feb 07 jari 291   
2 26 Feb 07 jari 292   //traverse strata from low to high
2 26 Feb 07 jari 293   //if strata 0 is not taken, take it and move on
2 26 Feb 07 jari 294   //else move up the strata and take the lowest
2 26 Feb 07 jari 295   //or take maxStrata + 1
2 26 Feb 07 jari 296   
2 26 Feb 07 jari 297   //move on to next strata;
2 26 Feb 07 jari 298   
2 26 Feb 07 jari 299   /**
2 26 Feb 07 jari 300    * Returns true if two loci overlap in any possible way
2 26 Feb 07 jari 301    * |--------|              |------------|
2 26 Feb 07 jari 302    *        |---------|          |------|
2 26 Feb 07 jari 303    * One encapsulates the other or one starts within the other
2 26 Feb 07 jari 304    */
2 26 Feb 07 jari 305   private boolean haveOverLap(int currX, int otherX) {
2 26 Feb 07 jari 306     if((sortedStart[currX] >= sortedStart[otherX] && sortedStart[currX] <= sortedEnd[otherX])
2 26 Feb 07 jari 307         || (sortedEnd[currX] <= sortedEnd[otherX] && sortedEnd[currX] >= sortedEnd[otherX])
2 26 Feb 07 jari 308         ||(sortedStart[otherX] >= sortedStart[currX] && sortedStart[otherX] <= sortedEnd[currX]))
2 26 Feb 07 jari 309         return true;
2 26 Feb 07 jari 310     return false;
2 26 Feb 07 jari 311   }
2 26 Feb 07 jari 312   
2 26 Feb 07 jari 313   /**
2 26 Feb 07 jari 314    * Builds a vector by looking back to all loci for overlap
2 26 Feb 07 jari 315    * @param currIndex
2 26 Feb 07 jari 316    * @return
2 26 Feb 07 jari 317    */
2 26 Feb 07 jari 318   private Vector getOverLapIndicesFromPrevious(int currIndex) {
2 26 Feb 07 jari 319     if(currIndex == 0)
2 26 Feb 07 jari 320       return null;
2 26 Feb 07 jari 321     
2 26 Feb 07 jari 322     Vector v = new Vector();
2 26 Feb 07 jari 323     for(int i = currIndex-1; i >= 0 ; i--) {
2 26 Feb 07 jari 324       if(haveOverLap(currIndex, i)) {
2 26 Feb 07 jari 325         v.add(new Integer(i));
2 26 Feb 07 jari 326       }
2 26 Feb 07 jari 327     }    
2 26 Feb 07 jari 328     return v;
2 26 Feb 07 jari 329   }
2 26 Feb 07 jari 330   
2 26 Feb 07 jari 331   /**
2 26 Feb 07 jari 332    * Returns the strata for the given locus index based on locus overlap
2 26 Feb 07 jari 333    * @param currIndex current locus index
2 26 Feb 07 jari 334    * @param strata strata array 
2 26 Feb 07 jari 335    * @return strata
2 26 Feb 07 jari 336    */
2 26 Feb 07 jari 337   private int getStrata(int currIndex, int [] strata) {
2 26 Feb 07 jari 338     Vector v = getOverLapIndicesFromPrevious(currIndex);
2 26 Feb 07 jari 339     
2 26 Feb 07 jari 340     //no overlaps
2 26 Feb 07 jari 341     if(v == null || v.size() == 0)
2 26 Feb 07 jari 342       return 0;
2 26 Feb 07 jari 343     
2 26 Feb 07 jari 344     int index;
2 26 Feb 07 jari 345     
2 26 Feb 07 jari 346     //simple base case    
2 26 Feb 07 jari 347     if(v.size() == 1) {
2 26 Feb 07 jari 348       index = ((Integer)(v.get(0))).intValue();
2 26 Feb 07 jari 349       if(strata[index] >0)
2 26 Feb 07 jari 350         return 0;
2 26 Feb 07 jari 351       else
2 26 Feb 07 jari 352         return strata[index]+1;
2 26 Feb 07 jari 353     }
2 26 Feb 07 jari 354     
2 26 Feb 07 jari 355     //get strata in overlaps
2 26 Feb 07 jari 356     Vector setStrata = new Vector();  
2 26 Feb 07 jari 357     for(int i = 0; i < v.size(); i++) {
2 26 Feb 07 jari 358       index = ((Integer)(v.get(i))).intValue();
2 26 Feb 07 jari 359       setStrata.add(new Integer(strata[index]));
2 26 Feb 07 jari 360     }
2 26 Feb 07 jari 361
2 26 Feb 07 jari 362     //find the lowest unclaimed strata
2 26 Feb 07 jari 363     
2 26 Feb 07 jari 364     int strataValue = 0;
2 26 Feb 07 jari 365     while(setStrata.contains(new Integer(strataValue)))
2 26 Feb 07 jari 366       strataValue++;
2 26 Feb 07 jari 367     
2 26 Feb 07 jari 368     return strataValue;    
2 26 Feb 07 jari 369   }
2 26 Feb 07 jari 370   
2 26 Feb 07 jari 371   /**
2 26 Feb 07 jari 372    * Wrapper method to kick off the recursive search for strata
2 26 Feb 07 jari 373    * @return returns an array indicating strata for each sorted loci
2 26 Feb 07 jari 374    */
2 26 Feb 07 jari 375   private int [] getStrataArray() {
2 26 Feb 07 jari 376     int [] strata = new int[sortedStart.length];
2 26 Feb 07 jari 377
2 26 Feb 07 jari 378     for(int i = 0; i< strata.length; i++) {
2 26 Feb 07 jari 379       strata [i] = getStrata(i, strata);
2 26 Feb 07 jari 380     }      
2 26 Feb 07 jari 381     return strata;
2 26 Feb 07 jari 382   }
2 26 Feb 07 jari 383   
2 26 Feb 07 jari 384
2 26 Feb 07 jari 385   /* (non-Javadoc)
2 26 Feb 07 jari 386    * @see org.tigr.microarray.mev.cluster.algorithm.Algorithm#abort()
2 26 Feb 07 jari 387    */
2 26 Feb 07 jari 388   public void abort() {
2 26 Feb 07 jari 389     
2 26 Feb 07 jari 390   }
2 26 Feb 07 jari 391
2 26 Feb 07 jari 392 }