Changeset 2154


Ignore:
Timestamp:
Dec 4, 2013, 12:37:11 PM (7 years ago)
Author:
olle
Message:

Refs #228. Classes/files AverageNormalization.java and QuantileNormalization.java updated to determine the default averaging method based on the intensity transform information for the BioAssaySet to work on, instead of what is returned from the Formula.AverageMethod getAverage() method for the IntensityTransform of the latter:

  1. Private method RequestInformation getConfiguredJobParameters() is updated to check the intensity transform set for the BioAssaySet, and select the default averaging method based on that. This makes the choice of default averaging method independent on the value of the getAverage() method.
Location:
plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins
Files:
2 edited

Legend:

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

    r1410 r2154  
    3131import net.sf.basedb.core.DynamicResultIterator;
    3232import net.sf.basedb.core.DynamicSpotQuery;
     33import net.sf.basedb.core.Formula;
     34import net.sf.basedb.core.IntensityTransform;
    3335import net.sf.basedb.core.FloatParameterType;
    3436import net.sf.basedb.core.InvalidUseOfNullException;
     
    345347        parameters.add(getChildDescriptionParameter(null, null, null));
    346348        // Average normalization options       
     349        Formula.AverageMethod defaultAverageMethod = Formula.AverageMethod.ARITHMETIC_MEAN;
     350        IntensityTransform transform = bas.getIntensityTransform();
     351        if (transform == IntensityTransform.NONE)
     352        {
     353          defaultAverageMethod = Formula.AverageMethod.GEOMETRIC_MEAN;
     354        }
    347355        StringParameterType spt = new StringParameterType
    348356        (
    349357            null,
    350             bas.getIntensityTransform().getAverageMethod().toString(),
     358            defaultAverageMethod.toString(),
    351359            true, 1, 0, 0,
    352360            Arrays.asList(arithmeticOption, geometricOption)
  • plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins/QuantileNormalization.java

    r1410 r2154  
    2929import net.sf.basedb.core.DbControl;
    3030import net.sf.basedb.core.DynamicSpotQuery;
     31import net.sf.basedb.core.Formula;
     32import net.sf.basedb.core.IntensityTransform;
    3133import net.sf.basedb.core.Job;
    3234import net.sf.basedb.core.PluginParameter;
     
    250252       
    251253        // 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        }
    252260        StringParameterType spt = new StringParameterType
    253261        (
    254262            null,
    255             bas.getIntensityTransform().getAverageMethod().toString(),
     263            defaultAverageMethod.toString(),
    256264            true, 1, 0, 0,
    257265            Arrays.asList(arithmeticOption, geometricOption)
     
    323331     
    324332      // Control that the number of spots per assay is the same in all assays
    325       if (spotsPerAssay > -1 && spotsPerAssay != assay.getNumSpots()) 
     333      if (spotsPerAssay > -1 && spotsPerAssay != assay.getNumSpots())
    326334        throw new BaseException("The number of spots are not equal between the dispal\n " +
    327335            "The normalization can not be done.");
    328336      else if (spotsPerAssay == -1)
    329         spotsPerAssay = assay.getNumSpots(); 
     337        spotsPerAssay = assay.getNumSpots();
    330338     
    331339      // Get spot data and sort it ascending
Note: See TracChangeset for help on using the changeset viewer.