Changeset 3879
- Timestamp:
- Oct 26, 2007, 11:01:46 AM (15 years ago)
- Location:
- trunk/src/plugins/core/net/sf/basedb/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/plugins/core/net/sf/basedb/plugins/LowessNormalization.java
r3877 r3879 334 334 Expression ch2 = Dynamic.column(VirtualColumn.channel(2)); 335 335 // A = log10(sqrt(ch1 * ch2)) 336 Expression A = Expressions.log10(Expressions.sqrt(Expressions.multiply(ch1, ch2))); 336 Expression pseudoA = Expressions.multiply(ch1, ch2); 337 Expression A = Expressions.log10(Expressions.sqrt(pseudoA)); 337 338 338 339 // Create restriction: ch1 > 0 and ch2 > 0 … … 363 364 query.restrict(bioAssayRestriction); 364 365 query.order(Orders.asc(block)); 365 query.order(Orders.asc( A));366 query.order(Orders.asc(pseudoA)); 366 367 367 368 // Normalize one bioassay at a time … … 428 429 SpotData spot = data.get(fromIndex + j); 429 430 double factor = Math.exp(smoothCurve.get(j) * 0.5); 430 double newCh1 = spot.ch1/factor; 431 double newCh2 = spot.ch2*factor; 432 batcher.insert(bioassayColumn, spot.position, (float) newCh1, (float) newCh2); 431 batcher.insert(bioassayColumn, spot.position, (float)(spot.ch1/factor), (float)(spot.ch2*factor)); 433 432 } 434 433 normalizedSpots += smoothCurve.size(); … … 645 644 final double A; 646 645 final int block; 647 static final double LN2 =Math.log(2);646 static final double INV_LN2 = 1 / Math.log(2); 648 647 649 648 public SpotData(int position, float ch1, float ch2, int block) … … 653 652 this.ch2 = ch2; 654 653 this.block = block; 655 this.M = Math.log(ch1 / ch2) /LN2;654 this.M = Math.log(ch1 / ch2) * INV_LN2; 656 655 this.A = Math.log10(Math.sqrt(ch1 * ch2)); 657 656 } -
trunk/src/plugins/core/net/sf/basedb/plugins/MedianRatioNormalization.java
r3878 r3879 429 429 430 430 // Correct all spot intensities 431 float sqrtMedRatio = (float)Math.sqrt(median);432 floatinvSqrtMedRatio = 1 / sqrtMedRatio;431 double sqrtMedRatio = Math.sqrt(median); 432 double invSqrtMedRatio = 1 / sqrtMedRatio; 433 433 for (int j = fromIndex; j < toIndex; ++j) 434 434 { 435 435 SpotData spot = data.get(j); 436 double newCh1 = spot.ch1 * invSqrtMedRatio;437 double newCh2 = spot.ch2 * sqrtMedRatio;438 batcher.insert(bioassayColumn, spot.position, (float)newCh1, (float)newCh2);436 float newCh1 = (float)(spot.ch1 * invSqrtMedRatio); 437 float newCh2 = (float)(spot.ch2 * sqrtMedRatio); 438 batcher.insert(bioassayColumn, spot.position, newCh1, newCh2); 439 439 } 440 440 }
Note: See TracChangeset
for help on using the changeset viewer.