Changeset 6368


Ignore:
Timestamp:
Dec 6, 2013, 10:53:25 AM (8 years ago)
Author:
Nicklas Nordborg
Message:

References #1791: Normalizers should store data in the same transform as the source data

Added a log2-transform+lowess normalization test in the 'roles' test program. Seems to work ok and give the same results as when running lowess on the un-transformed values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2-stable/src/test/net/sf/basedb/test/roles/AnalysisTest.java

    r6047 r6368  
    3030import net.sf.basedb.core.Formula;
    3131import net.sf.basedb.core.IntegerParameterType;
     32import net.sf.basedb.core.IntensityTransform;
    3233import net.sf.basedb.core.ItemParameterType;
    3334import net.sf.basedb.core.Job;
     
    123124        "Normalized bioassay set (" + user + ")");
    124125     
     126      BioAssaySet log2 = log2TransformBioAssaySet(experiment, filtered,
     127        "Log2-transformed bioassay set (" + user + ")");
     128
     129      BioAssaySet normalizedLog2 = normalizeBioAssaySet(experiment, log2,
     130          "Normalized log2 bioassay set (" + user + ")");
     131
     132     
    125133      BioAssaySet rootSeq = createRootBioAssaySet(seqExperiment,
    126134        "Root bioassay set ("+user+")", fpkmFormula);
     
    282290  }
    283291
     292  /**
     293    Create a normalized bioassay set.
     294    @since 3.2.4
     295  */
     296  public static BioAssaySet log2TransformBioAssaySet(Experiment experiment, BioAssaySet source, String name)
     297    throws Exception
     298  {
     299    TestUtil.write("--Creating log2-transformed bioassay set in " + experiment.getName() + ": " + name + "\n");
     300    DbControl dc = TestUtil.getDbControl();
     301    try
     302    {
     303      PluginDefinition plugin = PluginDefinition.getByClassName(dc, "net.sf.basedb.plugins.JepIntensityTransformer");
     304      Job job = Job.getNew(dc, plugin, null, experiment);
     305      job.setName("Creating log2-transformed bioassay set: " + name);
     306      job.setParameterValue("source",
     307        new ItemParameterType<BioAssaySet>(BioAssaySet.class, null), source);
     308      job.setParameterValue("childName", new StringParameterType(), name);
     309     
     310      job.setParameterValue("transformationName", new StringParameterType(), "Log2-transform");
     311      job.setParameterValue("ch1.expression", new StringParameterType(), "log2(rawCh(1))");
     312      job.setParameterValue("ch2.expression", new StringParameterType(), "log2(rawCh(2))");
     313      job.setParameterValue("resultTransform", new StringParameterType(), IntensityTransform.LOG2.name());
     314     
     315      dc.saveItem(job);
     316      dc.commit();
     317      PluginUtil.executeJob(job);
     318     
     319      dc = TestUtil.getDbControl();
     320      BioAssaySet root = Util.findBioAssaySet(dc, experiment, name);
     321      dc.close();
     322      return root;
     323    }
     324    finally
     325    {
     326      if (dc != null) dc.close();
     327    }
     328  }
     329
     330 
    284331  public static GenericOverview getExperimentOverview(DbControl dc, Experiment experiment,
    285332    Project project, ValidationOptions options, int expected)
Note: See TracChangeset for help on using the changeset viewer.