Changeset 2165
- Timestamp:
- Dec 9, 2013, 12:23:59 PM (9 years ago)
- Location:
- plugins/base2/net.sf.basedb.normalizers/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/base2/net.sf.basedb.normalizers/trunk/META-INF/extensions.xml
r1454 r2165 11 11 </description> 12 12 <version>1.1-beta</version> 13 <min-base-version>3. 0.0</min-base-version>13 <min-base-version>3.2.4</min-base-version> 14 14 <copyright>BASE development team</copyright> 15 15 <email>basedb-users@lists.sourceforge.net</email> … … 30 30 31 31 The new expression values will become "S" times the original 32 expression value. 32 expression value. Background subtraction and proper filtration 33 33 have to be done before running this plug-in. 34 34 … … 52 52 values are replaced with the row average value. Finally, each assay 53 53 is reordered into its original order to retain a standard 54 expression matrix w ere each row represents one probe. Assays are54 expression matrix where each row represents one probe. Assays are 55 55 not mixed. 56 56 … … 58 58 bioassay set before running this plug-in. The bioassay set must not 59 59 contain any missing values. 60 61 Data stored in logarithmic format will be untransformed before averaging, 62 and then transformed back to logarithmic format before results are stored. 60 63 61 64 This plug-in supports 1-channel and 2-channel data. … … 111 114 <name>Rank invariant normalization</name> 112 115 <description> 113 The development of this plug-in is still in progress 116 The development of this plug-in is still in progress. 117 118 This plug-in currently only supports 1-channel data. 114 119 </description> 115 120 </about> -
plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins/AbstractNormalizationPlugin.java
r2156 r2165 71 71 "averageMethod", 72 72 "Average calculation method", 73 "Select which method to use when calculating averages.\n" + 74 geometricOption + 75 " is default for non-logarithmic values and " + arithmeticOption + 76 " is default for logarithmic values.", 73 "Select which method to use when calculating averages.", 77 74 null 78 75 ); -
plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins/QuantileNormalization.java
r2154 r2165 70 70 values are replaced with the row average value. Finally, each assay 71 71 is reordered into its original order to retain a standard 72 expression matrix w ere each row represents one probe. Assays are72 expression matrix where each row represents one probe. Assays are 73 73 not mixed. 74 74 … … 252 252 253 253 // Average normalization options 254 Formula.AverageMethod defaultAverageMethod = Formula.AverageMethod.ARITHMETIC_MEAN; 255 IntensityTransform transform = bas.getIntensityTransform(); 256 if (transform == IntensityTransform.NONE) 257 { 258 defaultAverageMethod = Formula.AverageMethod.GEOMETRIC_MEAN; 259 } 254 // Default is always set to geometric mean, since averaging is performed on untransformed data 255 Formula.AverageMethod defaultAverageMethod = Formula.AverageMethod.GEOMETRIC_MEAN; 260 256 StringParameterType spt = new StringParameterType 261 257 ( … … 301 297 int noOfChannels = source.getRawDataType().getChannels(); 302 298 long normalizedSpots = 0; 299 IntensityTransform transform = source.getIntensityTransform(); 303 300 304 301 // Get query to recieve the spot data. … … 325 322 String configuredAverageMethod = (String)job.getParameterValue(averageMethodParameter.getName()); 326 323 int spotsPerAssay = -1; 324 String refAssayName = ""; 327 325 328 326 for (BioAssay assay : assays) … … 332 330 // Control that the number of spots per assay is the same in all assays 333 331 if (spotsPerAssay > -1 && spotsPerAssay != assay.getNumSpots()) 334 throw new BaseException("The number of spots are not equal between the dispal\n " + 332 { 333 throw new BaseException("The number of spots for assay '" + assay.getName() + "' (" + assay.getNumSpots() + ") is not equal to that for assay '" + refAssayName + "' (" + spotsPerAssay + ")\n " + 335 334 "The normalization can not be done."); 335 } 336 336 else if (spotsPerAssay == -1) 337 { 338 // First BioAssay, save data for check and possible error message 337 339 spotsPerAssay = assay.getNumSpots(); 340 refAssayName = assay.getName(); 341 } 338 342 339 343 // Get spot data and sort it ascending … … 342 346 343 347 // Write spot data to file and calculate row summaries 344 if (rowCalculators == null) rowCalculators = new AverageCalculator[data.size()]; 348 if (rowCalculators == null) 349 { 350 rowCalculators = new AverageCalculator[data.size()]; 351 } 345 352 FileWriter fw = null; 346 353 try … … 352 359 { 353 360 AbstractSpotData spot = data.get(i); 354 if (rowCalculators[i] == null) rowCalculators[i] = new AverageCalculator(configuredAverageMethod); 361 if (rowCalculators[i] == null) 362 { 363 rowCalculators[i] = new AverageCalculator(configuredAverageMethod); 364 } 355 365 rowCalculators[i].addNumber(spot.getNormalizableData()); 356 366 … … 413 423 AbstractSpotData spot = getSpotDataFromString(lineInfo); 414 424 spot.setNormalizableData(rowCalculators[rowIndex].getAverage()); 415 batcher.insert(columnNo, spot.getPosition(), spot.getChannelData()); 425 // Average is calculated for untransformed data, transform channel data before storing 426 float[] channelDataArr = spot.getChannelData(); 427 float[] transformedChannelDataArr = new float[channelDataArr.length]; 428 for (int i=0; i < channelDataArr.length; i++) 429 { 430 // d1 = untransormed value, d2 = transformed value (0 if d1 is out of range) 431 float d1 = channelDataArr[i]; 432 float d2 = 0F; 433 if (!Float.isNaN(d1) && !Float.isInfinite(d1)) 434 { 435 d2 = (float) transform.transform(d1); 436 } 437 transformedChannelDataArr[i] = d2; 438 } 439 batcher.insert(columnNo, spot.getPosition(), transformedChannelDataArr); 416 440 normalizedSpots++; 417 441 rowIndex++; 418 442 } 443 child.setIntensityTransform(transform); 419 444 // Clean up 420 445 input.close();
Note: See TracChangeset
for help on using the changeset viewer.