Changeset 753


Ignore:
Timestamp:
Sep 3, 2008, 12:59:31 PM (13 years ago)
Author:
Martin Svensson
Message:

The SpotData2Ch objects are now compared by their ratio-value and not A-value as before.
Change the compareTo method in SpotData1Ch to return negative as specified in the Comparable interface.
Extended the javadoc-documentation in some of the files.

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

Legend:

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

    r750 r753  
    4343
    4444/**
     45  An abstract base class whith common methods
     46  and fields for all the normalization plug-ins.
     47   
    4548    @author Martin
    4649    @version 1.0
    47    
    48  
    4950 */
    5051public abstract class AbstractNormalizationPlugin
     
    7576 
    7677  /**
    77     Request use access to Experiment:s and read access to Job:s.
     78    Request use access to Experiment:s and read access to Job:s and reporter list.
     79    @see net.sf.basedb.core.plugin.AbstractPlugin
    7880  */
    7981  @Override
     
    9193  /**
    9294    Gets a 'greater than' restriction for the specified number of channels.
     95    @param noOfChannels Number of channels. Greater or equal to 1
     96    @param minIntensity Sets intensity restriction to be greater then this value
     97    @return Restriction object
    9398   **/
    9499  protected Restriction getIntensityRestriction(int noOfChannels, float minIntensity)
  • plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins/AbstractSpotData.java

    r751 r753  
    2626
    2727/**
     28  An abstract base class for classes that hold a single spot data.
    2829    @author Martin
    2930  @version 1.0
     
    3536  public abstract int compareTo(T o);
    3637 
     38  /**
     39    Prints a spot data's position and channel intensities
     40    as a tab-separated string like:
     41    position\tCh1Intensity\Ch2Intensity(...)
     42   */
    3743  @Override
    3844  public String toString()
  • plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins/AverageNormalization.java

    r750 r753  
    5454import net.sf.basedb.core.query.Expressions;
    5555import net.sf.basedb.core.query.Restriction;
    56 import net.sf.basedb.core.query.Restrictions;
    5756import net.sf.basedb.core.query.Selects;
    5857import net.sf.basedb.core.query.SqlResult;
     
    7069
    7170/**
    72   Plug-in to BASE 2 that normalize sample intensities by using the ratio of average intensity
    73   of virtual sample to the average instensity of the given sample as a scale factor.
    74   The background is subtracted before scaling.
     71  Plug-in to BASE 2 that normalize sample intensities by using the ratio either
     72  between a, by the user, given number and the intensity average for an assay OR
     73  between the global average intensity over all assays and the intensity average for an assay.
    7574 
    7675    @author Martin
     
    8483  private static final String noOption = "no";
    8584 
    86   /**
     85  /*
    8786    Use to abort a running job
    8887   */
    8988  private ThreadSignalHandler signalHandler;
    9089 
    91   /**
    92     Holds the configured job parameters
     90  /*
     91    Holds the job parameters
    9392  */
    9493  private RequestInformation configureJob = null;
    9594 
    96  
     95  /*
     96    Parameter to set whether the average of intensities in all assays should be used as a reference, or not
     97   */
    9798  private final PluginParameter<String> useGlobalAverageIntensityParameter = new PluginParameter<String>
    9899    (
     
    105106    );
    106107 
     108  /*
     109    If global average intensity not should be used, then this parameter's value should be used.
     110   */
    107111  private final PluginParameter<Float> referenceValueParameter = new PluginParameter<Float>
    108112  (
     
    114118  );
    115119   
     120  /*
     121    Information about this plug-in
     122   */
    116123  private final About about = new AboutImpl
    117124  (
     
    119126    "This normalization plug-in uses the average algorithm to adjust sample signals.\n" +
    120127    "Currently 1-channel or 2-channel are supported\n" +
    121     "This plug-in is part of the BASE 2 normalizers package.",
     128    "This plug-in is part of the BASE normalizers package.",
    122129    Normalizations.PACKAGE_VERSION,
    123130    Normalizations.COPYRIGHT,
     
    127134  );
    128135 
     136  /*
     137    The lower limit of the spot-intensities to include in the normalization.
     138   */
    129139  private PluginParameter<Float> minIntensityParameter = new PluginParameter<Float>
    130140  (
    131141    "minIntensity",
    132142    "Minimum intensity",
    133     "Use spots with both int greater than [value]",
     143    "Use spots with int greater than [value]",
    134144    null
    135145  );
    136146 
    137   /**
    138     Section for normalization options
     147  /*
     148    Section-header for normalization options
    139149  */
    140150  protected static final PluginParameter<String> normalizationSection = new PluginParameter<String>(
     
    161171  /*
    162172    From InteractivePlugin interface
     173    @see net.sf.basedb.core.plugin.InteractivePlugin
    163174  */
    164175  @Override
     
    232243  /*
    233244    From Plugin interface
     245    @see net.sf.basedb.core.plugin.Plugin
    234246  */
    235247  @Override
     
    309321    }
    310322  }
    311  
     323  /*
     324   ------------------------------------------------------------------------
     325   */
     326 
     327  /*
     328    Gets job parameters in a RequestInformation object
     329   */
    312330  private RequestInformation getConfiguredJobParameters()
    313331  {
     
    349367          Request.COMMAND_CONFIGURE_JOB,
    350368          "Configure a new job",
    351           "Set reference group",
     369          "Set normalization options and properties of the new bio-assay set.",
    352370          parameters
    353371        );
     
    362380  }
    363381 
     382  /*
     383    Create a normalized bio-assay set, using the average normalization algorithm
     384   */
    364385  private BioAssaySet normalize(DbControl dc, BioAssaySet source, Job job, float refValue,
    365386      float minIntensity, ProgressReporter progress)
  • plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins/Normalizable.java

    r746 r753  
    5757  /**
    5858    Gets the spot data's position on the array
    59       @return an int <=0
     59      @return an int >=0
    6060   */
    6161  public int getPosition();
  • plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins/SpotData1Ch.java

    r750 r753  
    7171  public int compareTo(SpotData1Ch o)
    7272  {
    73     return this.ch1 < o.ch1 ? 1 : -1;
     73    return this.ch1 < o.ch1 ? -1 : 1;
    7474  }
    7575
  • plugins/base2/net.sf.basedb.normalizers/trunk/src/net/sf/basedb/plugins/SpotData2Ch.java

    r750 r753  
    4242  private float ratio;
    4343 
     44  /**
     45    New SpotData2Ch object, representing data for one 2channel-spot
     46      @param position The spots position
     47      @param ch1 Intensity of channel 1
     48      @param ch2 Intensity of channel 2
     49   */
    4450  public SpotData2Ch(int position, float ch1, float ch2)
    4551  {
     
    6268  }
    6369
    64   /*
    65    *  (non-Javadoc)
     70  /**
     71    Gets the normalizable data of this object
     72    @return float, the ratio between ch1 and ch2.
    6673      @see net.sf.basedb.plugins.Normalizable#getNormalizableData()
    6774   */
     
    7279  }
    7380
     81  /**
     82    Sets the modified normalizable data of this object.
     83    @param data The new value to update to,
     84   */
    7485  @Override
    7586  public void setNormalizableData(float data)
     
    8091  }
    8192
     93  /**
     94    Sorts this object in ascending order
     95     corresponding to another SpotData2Ch object.
     96   */
    8297  @Override
    8398  public int compareTo(SpotData2Ch o)
    8499  {
    85     return this.A < o.A ? -1 : 1;
     100    return this.ratio < o.ratio ? -1 : 1;
    86101  }
    87102
     
    91106    return position;
    92107  }
    93 
    94108}
Note: See TracChangeset for help on using the changeset viewer.