Changeset 2498


Ignore:
Timestamp:
Aug 8, 2006, 4:01:22 PM (16 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #314: Update documentation that shows code examples with Transformation.newProduct

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/development/overview/dynamic/filter.html

    r2304 r2498  
    116116  // Create Transformation
    117117  Transformation t = source.newTransformation(null);
     118  dc.saveItem(t);
    118119
    119120  // Create a new BioAssaySet using the same data cube and layer
    120   BioAssaySet filtered = t.newProduct(null, null);
     121  BioAssaySet filtered = t.newProduct(null, null, true);
    121122  filtered.setName("Filtered bioassayset");
    122   dc.saveItem(t);
    123123  dc.saveItem(filtered);
    124 
    125   // Create BioAssay:s for each source BioAssay
    126   for (BioAssay sourceBa : source.getBioAssays().list(dc))
    127   {
    128     BioAssay ba = filtered.newBioAssay(sourceBa);
    129     dc.saveItem(ba);
    130   }
    131124
    132125  // Get all column and position coordinate for all spots that pass the filter
  • trunk/doc/development/overview/dynamic/rootbioassayset.html

    r2304 r2498  
    140140  // Create Transformation
    141141  Transformation t = e.newTransformation(null, rba);
     142  dc.saveItem(t);
    142143 
    143144  // Create root BioAssaySet in new data cube and layer
    144   BioAssaySet root = t.newProduct("new", "new");
     145  BioAssaySet root = t.newProduct("new", "new", false);
    145146  root.setName("New root bioassayset");
    146   dc.saveItem(t);
    147147  dc.saveItem(root);
    148148 
  • trunk/doc/development/plugins/analysis/index.html

    r2467 r2498  
    246246      Transformation t = source.newTransformation(j);
    247247      t.setName("Copy spot intensities >= 0");
    248       BioAssaySet result = t.newProduct(null, "new");
     248      dc.saveItem(t);
     249
     250      BioAssaySet result = t.newProduct(null, "new", true);
    249251      result.setName("After: Copying spot intensities");
    250       dc.saveItem(t);
    251252      dc.saveItem(result);
    252      
    253       // Create child bioassays for each source bioassay
    254       for (BioAssay ba : source.getBioAssays.list(dc))
    255       {
    256          dc.saveItem(result.newBioAssay(ba));
    257       }
    258253
    259254      // Get query for source data
  • trunk/src/core/net/sf/basedb/core/FilterBatcher.java

    r2380 r2498  
    4949// filtered result
    5050Transformation t = source.newTransformation();
    51 BioAssaySet filtered = t.newProduct(null, null);
    5251dc.saveItem(t);
     52BioAssaySet filtered = t.newProduct(null, null, true);
    5353dc.saveItem(filtered);
    54 
    55 // Create new bioassays for each bioassay in the source
    56 // bioassayset
    57 for (BioAssay sourceBa : source.getBioAssays().list(dc))
    58 {
    59    dc.saveItem(bas.newBioAssay(sourceBa));
    60 }
    6154
    6255// Create a query that selects the column
     
    258251// filtered result
    259252Transformation t = source.newTransformation();
    260 BioAssaySet filtered = t.newProduct(null, null);
    261253dc.saveItem(t);
     254BioAssaySet filtered = t.newProduct(null, null, true);
    262255dc.saveItem(filtered);
    263 
    264 // Create new bioassays for each bioassay in the source
    265 // bioassayset
    266 for (BioAssay sourceBa : source.getBioAssays().list(dc))
    267 {
    268    dc.saveItem(bas.newBioAssay(sourceBa));
    269 }
    270256
    271257// Create a query that selects the column
  • trunk/src/core/net/sf/basedb/core/PositionExtraValueBatcher.java

    r2380 r2498  
    4646// new intensities, we use the same data cube and layer as the source
    4747Transformation t = source.newTransformation();
    48 BioAssaySet bas = t.newProduct(null, null);
    4948dc.saveItem(t);
     49BioAssaySet bas = t.newProduct(null, null, true);
    5050dc.saveItem(bas);
    51 
    52 // Create new bioassays for each bioassay in the source
    53 // bioassayset
    54 for (BioAssay sourceBa : source.getBioAssays().list(dc))
    55 {
    56    dc.saveItem(bas.newBioAssay(sourceBa));
    57 }
    5851
    5952// Create a query that selects the data of
     
    282275// new intensities, we use the same data cube and layer as the source
    283276Transformation t = source.newTransformation();
    284 BioAssaySet bas = t.newProduct(null, null);
    285277dc.saveItem(t);
     278BioAssaySet bas = t.newProduct(null, null, true);
    286279dc.saveItem(bas);
    287280
    288 // Create new bioassays for each bioassay in the source
    289 // bioassayset
    290 for (BioAssay sourceBa : source.getBioAssays().list(dc))
    291 {
    292    dc.saveItem(bas.newBioAssay(sourceBa));
    293 }
    294281
    295282// Create a query that selects the data of
  • trunk/src/core/net/sf/basedb/core/SpotBatcher.java

    r2380 r2498  
    4747// but a different layer
    4848Transformation t = source.newTransformation();
    49 BioAssaySet bas = t.newProduct(null, "new");
    5049dc.saveItem(t);
     50BioAssaySet bas = t.newProduct(null, "new", true);
    5151dc.saveItem(bas);
    52 
    53 // Create new bioassays for each bioassay in the source
    54 // bioassayset
    55 for (BioAssay sourceBa : source.getBioAssays().list(dc))
    56 {
    57    dc.saveItem(bas.newBioAssay(sourceBa));
    58 }
    5952
    6053// Create a query that selects the data of
     
    274267// but a different layer
    275268Transformation t = source.newTransformation();
    276 BioAssaySet bas = t.newProduct(null, "new");
    277269dc.saveItem(t);
     270BioAssaySet bas = t.newProduct(null, "new", true);
    278271dc.saveItem(bas);
    279 
    280 // Create new bioassays for each bioassay in the source
    281 // bioassayset
    282 for (BioAssay sourceBa : source.getBioAssays().list(dc))
    283 {
    284    dc.saveItem(bas.newBioAssay(sourceBa));
    285 }
    286272
    287273// Create a query that selects the data of
  • trunk/src/core/net/sf/basedb/core/SpotExtraValueBatcher.java

    r2380 r2498  
    4646// new intensities, we use the same data cube and layer as the source
    4747Transformation t = source.newTransformation();
    48 BioAssaySet bas = t.newProduct(null, null);
    4948dc.saveItem(t);
     49BioAssaySet bas = t.newProduct(null, null, true);
    5050dc.saveItem(bas);
    51 
    52 // Create new bioassays for each bioassay in the source
    53 // bioassayset
    54 for (BioAssay sourceBa : source.getBioAssays().list(dc))
    55 {
    56    dc.saveItem(bas.newBioAssay(sourceBa));
    57 }
    5851
    5952// Create a query that selects the data from
     
    274267// new intensities, we use the same data cube and layer as the source
    275268Transformation t = source.newTransformation();
    276 BioAssaySet bas = t.newProduct(null, null);
    277269dc.saveItem(t);
     270BioAssaySet bas = t.newProduct(null, null, true);
    278271dc.saveItem(bas);
    279 
    280 // Create new bioassays for each bioassay in the source
    281 // bioassayset
    282 for (BioAssay sourceBa : source.getBioAssays().list(dc))
    283 {
    284    dc.saveItem(bas.newBioAssay(sourceBa));
    285 }
    286272
    287273// Create a query that selects the data from
  • trunk/src/core/net/sf/basedb/core/Transformation.java

    r2492 r2498  
    382382Transformation t = ...
    383383
    384 // Use same data cube, but a new layer
    385 BioAssaySet bas = t.newProduct(null, "new");
    386 
    387 // Use same data cube and layer
    388 BioAssaySet filtered = t.newProduct(null, null);
    389 
    390 // Use new data cube and layer
    391 BioAsssySet merged = t.newProduct("new", "new");
     384// Use same data cube, but a new layer; automatically create child bioassays
     385BioAssaySet bas = t.newProduct(null, "new", true);
     386
     387// Use same data cube and layer; automatically create child bioassays
     388BioAssaySet filtered = t.newProduct(null, null, true);
     389
     390// Use new data cube and layer; automatic creation of
     391// child bioassays is not supported
     392BioAsssySet merged = t.newProduct("new", "new", false);
    392393
    393394// Create four new bioassaysets using two datacubes, one
    394395// with two layers and one with one layer
    395 BioAssaySet bas1 = t.newProduct("cube1", "layer1");
    396 BioAssaySet bas2 = t.newProduct("cube1", "layer2");
    397 BioAssaySet bas3 = t.newProduct("cube2", "layer3");
    398 BioAssaySet bas4 = t.newProduct("cube2", "layer3");
     396BioAssaySet bas1 = t.newProduct("cube1", "layer1", false);
     397BioAssaySet bas2 = t.newProduct("cube1", "layer2", false);
     398BioAssaySet bas3 = t.newProduct("cube2", "layer3", false);
     399BioAssaySet bas4 = t.newProduct("cube2", "layer3", false);
    399400</pre>
    400401
     
    404405    <pre class="code">
    405406// Don't! We bas3 is now using the same cube and layer as bas1
    406 BioAssaySet bas3 = t.newProduct("cube2", "layer1");
     407BioAssaySet bas3 = t.newProduct("cube2", "layer1", false);
    407408</pre>
    408409
  • trunk/src/examples/plugins/src/net/sf/basedb/exampleplugins/ExampleAnalyzer.java

    r2346 r2498  
    151151        Transformation t = source.newTransformation(j);
    152152        t.setName("Multiply " + factor + "; filter < " + cutoff);
    153       BioAssaySet result = t.newProduct(null, "new");
     153      BioAssaySet result = t.newProduct(null, "new", true);
    154154      result.setName("After: multiply and filter");
    155155      dc.saveItem(t);
    156156      dc.saveItem(result);
    157        
    158         // Create child bioassays for each source bioassay
    159         for (BioAssay ba : source.getBioAssays().list(dc))
    160         {
    161            dc.saveItem(result.newBioAssay(ba));
    162         }
    163157       
    164158        //  Get query for source data
Note: See TracChangeset for help on using the changeset viewer.