Changeset 1144


Ignore:
Timestamp:
Jul 29, 2009, 9:21:24 AM (14 years ago)
Author:
Martin Svensson
Message:

References #228 Updated the method that calculates bioassayset's global average in AverageNormalizationPlugin?, to support userdefine average method. Documentation related to recent changes has also been updated. The updated plugins execute as expected but the normalized data has not yet been verified.

Location:
plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins
Files:
3 edited

Legend:

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

    r1143 r1144  
    7171    "averageMethod",
    7272    "Average calculation method",
    73     "Select which method to use when calculating the averages.\n" +
    74     "Geometric mean is default for none-logged values and arithmetic " +
     73    "Select which method to use when calculating averages.\n" +
     74    geometricOption +
     75    " is default for none-logged values and " + arithmeticOption +
    7576    "is default for logged values.",
    7677    null
  • plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins/AverageNormalization.java

    r1143 r1144  
    6969/**
    7070   This plug-in scales the expression values for an assay with a
    71    factor, ''S'', equal to the ratio of either i) the geometric mean
     71   factor, ''S'', equal to the ratio of either i) the mean
    7272   of the expression values of all spots in the bioassay set divided
    7373   by the assay average, or ii) a user defined value divided by the
    74    assay average.
     74   assay average. Which average method to use is selected in the job
     75   configuration process.
    7576
    7677   The new expression values will become ''S'' times the original
    7778   expression value.
    7879
    79    Background subtraction and proper filtration have to be done before
    80    running this plug-in.
     80   Background subtraction and proper filtration should be done on the
     81   bioassay set before running this plug-in.
    8182 
    8283   @author Martin
     
    106107    (
    107108      "useGlobalAvgInt",
    108       "Use global geometric mean intensity",
    109       "Select if the global geometric mean intensity or an user defined value should be used as a reference value\n" +
    110       noOption + " = User defined value(default)\n" +
    111       yesOption + " = Global geometric mean intensity",
     109      "Use global mean intensity",
     110      "Select if the global mean intensity should be used as a reference value.\n" +
     111      noOption + " = User defined reference value is used(default).\n" +
     112      yesOption + " = Global mean intensity is used.",
    112113      new StringParameterType(null, noOption, true, 1, 0, 0, Arrays.asList(new String[] {noOption, yesOption}))
    113114    );
     
    121122    "Reference value",
    122123    "Reference value to use when calculating the scaling factor. Default value is 100\n" +
    123     "This parameter cannot be null if 'Use global geometric mean intensity' is " + noOption + ".",
     124    "This parameter cannot be null if 'Use global mean intensity' is " + noOption + ".",
    124125    new FloatParameterType(null, null, 100f, false)
    125126  );
     
    304305        if (useGlobalAvgInt)
    305306        {
    306           refValue = getGlobalGeometricMeanIntensity(dc, source, minIntensity, (String)job.getValue("averageMethod"));
     307          refValue = getGlobalMeanIntensity(dc, source, minIntensity, (String)job.getValue("averageMethod"));
    307308        }
    308309        else
     
    515516        if (progress != null)
    516517          progress.display((int)((100L * normalizedSpots) / numSpots),
    517                            normalizedSpots + " spots normalized");
     518                           normalizedSpots + " spots processed");
    518519      }
    519520      batcher.flush();
     
    530531    either 1-channel or 2-channel data.
    531532   */
    532   private float getGlobalGeometricMeanIntensity(DbControl dc, BioAssaySet source, float minIntensity, String averageMethod)
     533  private float getGlobalMeanIntensity(DbControl dc, BioAssaySet source, float minIntensity, String averageMethod)
    533534    throws SQLException, BaseException
    534535  {
     
    546547      break;
    547548    case 2:
    548       ratio = Expressions.ln(Expressions.divide(ch1, ch2));
     549      ratio = Expressions.divide(ch1, ch2);
    549550      break;
    550551    default:
    551552      throw new BaseException(noOfChannels + " channel-data is not supported by this plugin");
    552     }   
    553    
     553    }       
    554554       
    555555    if (arithmeticOption.equals(averageMethod)) mean = Aggregations.mean(ratio);
     
    565565    else throw new BaseException("The global average intensity could not be calculated");
    566566   
    567     return (float)Math.exp(meanValue);
     567    return (float)meanValue;
    568568  }
    569569}
  • plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins/QuantileNormalization.java

    r1143 r1144  
    319319  private BioAssaySet normalize(DbControl dc, BioAssaySet source,
    320320      Job job, ProgressReporter progress)
    321   {
    322     String averageMethod = (String)(job.getParameterValue("averageMethod"));
    323    
     321  {
    324322    int noOfChannels = source.getRawDataType().getChannels();
    325323    long normalizedSpots = 0;
Note: See TracChangeset for help on using the changeset viewer.