Changeset 2167


Ignore:
Timestamp:
Dec 10, 2013, 9:50:53 AM (10 years ago)
Author:
olle
Message:

Refs #541. Rank invariant normalization updated to store data in same format as before the normalization, untransformed, log-2, log-10. (Note that Rank inveriant normalization currently is only implemented for one-channel data):

  1. Class/file RankInvariantNormalization.java in src/net/sf/basedb/plugins/ in package net.sf.basedb.normalizers updated in private method BioAssaySet normalize1Ch(DbControl dc, BioAssaySet source, List<?> masterAssays, int numIteration, Job job, ProgressReporter progress) updated to call public method double transform(double value) in class IntensityTransform to transform the normalized result back before storing it.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins/RankInvariantNormalization.java

    r1410 r2167  
    3131import net.sf.basedb.core.DynamicResultIterator;
    3232import net.sf.basedb.core.DynamicSpotQuery;
     33import net.sf.basedb.core.IntensityTransform;
    3334import net.sf.basedb.core.ItemParameterType;
    3435import net.sf.basedb.core.Job;
     
    299300    long numSpots;
    300301    long normalizedSpots = 0;
     302    IntensityTransform transform = source.getIntensityTransform();
    301303   
    302304    // Create Transformation
     
    388390        List<Double> weights = getBiSquareWeights(rankInvSampleGenes, spot.getNormalizableData());
    389391        double[] km = getNormCoeffs(rankInvMasterGenes, rankInvSampleGenes, weights);
    390         float newIntensity = new Float((spot.getNormalizableData()-km[1]) / km[0]);
    391        
    392         batcher.insert(bioassayColumn, spot.getPosition(), newIntensity);       
    393       }
     392        float newIntensity = new Float((spot.getNormalizableData()-km[1]) / km[0]);
     393        // Normalization is calculated for untransformed data, transform channel data before storing
     394        float transformedNewIntensity = 0F;
     395        if (!Float.isNaN(newIntensity) && !Float.isInfinite(newIntensity))
     396        {
     397          transformedNewIntensity = (float) transform.transform(newIntensity);
     398        }       
     399        batcher.insert(bioassayColumn, spot.getPosition(), transformedNewIntensity);       
     400      }
     401      child.setIntensityTransform(transform);
    394402      normalizedSpots += rankInvSampleGenes.size();     
    395403    }
Note: See TracChangeset for help on using the changeset viewer.