Changeset 4025


Ignore:
Timestamp:
Nov 30, 2007, 3:08:47 PM (15 years ago)
Author:
Nicklas Nordborg
Message:

References #854: Extend test procedure for predefined roles

Updated documentation. Most implementation is in place. Need a few more test runs.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/test/roles/index.html

    r4013 r4025  
    575575      <td>Sample</td>
    576576    </tr>
     577    <tr>
     578      <td>Dye swap</td>
     579      <td>Boolean</td>
     580      <td>-</td>
     581      <td>-</td>
     582      <td>Raw bioassay</td>
     583    </tr>
    577584    </table>
    578585    <p>
     
    974981    </tr>
    975982    </table>
     983    <p>
     984  </li>
     985 
     986  <li>
     987    Annotate the file formats:
     988    <table class="listing" cellspacing="0" cellpadding="2" border="0">
     989    <tr>
     990      <th>File format</th>
     991      <th>Annotation</th>
     992      <th>Value</th>
     993    </tr>
     994    <tr>
     995      <td>Raw data for project A</td>
     996      <td>Dye swap</td>
     997      <td>false</td>
     998    </tr>
     999    <tr>
     1000      <td>Raw data for project A (dye swap)</td>
     1001      <td>Dye swap</td>
     1002      <td>true</td>
     1003    </tr>
     1004    </table>
     1005    This will make the raw data importer automatically annotate the
     1006    raw bioassays with the specified annotations.
    9761007    <p>
    9771008  </li>
     
    10611092    <li>Continue and wait for the import to finish. It should create 36,864 features and 48 blocks.</li>
    10621093    </ol>
     1094    <p>
     1095  </li>
     1096
     1097  <li>
     1098    Set project defaults. Go to the projects page and edit the
     1099    <code>Project A</code> project. On the <code>Defaults</code>
     1100    tab, set the following defaults:
     1101   
     1102    <table class="listing" cellspacing="0" cellpadding="2" border="0">
     1103    <tr>
     1104      <th>Setting</th>
     1105      <th>Value</th>
     1106    </tr>
     1107    <tr>
     1108      <td>Platform / raw data type</td>
     1109      <td>Generic / Genepix</td>
     1110    </tr>
     1111    <tr>
     1112      <td>Software</td>
     1113      <td>Software A</td>
     1114    </tr>
     1115    <tr>
     1116      <td>Array design</td>
     1117      <td>Array design A</td>
     1118    </tr>
     1119    <tr>
     1120      <td>Hybridization station</td>
     1121      <td>Hybridization station A</td>
     1122    </tr>
     1123    <tr>
     1124      <td>Scanner</td>
     1125      <td>Scanner A</td>
     1126    </tr>
     1127    <tr>
     1128      <td>Print robot</td>
     1129      <td>Print robot A</td>
     1130    </tr>
     1131    <tr>
     1132      <td>Scanning protocol</td>
     1133      <td>Scanning A</td>
     1134    </tr>
     1135    <tr>
     1136      <td>Sampling protocol</td>
     1137      <td>Sampling A</td>
     1138    </tr>
     1139    <tr>
     1140      <td>Extraction protocol</td>
     1141      <td>Extraction A</td>
     1142    </tr>
     1143    <tr>
     1144      <td>Labeling protocol</td>
     1145      <td>Labeling A</td>
     1146    </tr>
     1147    <tr>
     1148      <td>Hybridization protocol</td>
     1149      <td>Hybridization A</td>
     1150    </tr>
     1151    <tr>
     1152      <td>Feat. extraction protocol</td>
     1153      <td>Feature extraction A</td>
     1154    </tr>
     1155    <tr>
     1156      <td>Printing protocol</td>
     1157      <td>Printing A</td>
     1158    </tr>
     1159    </table>
     1160   
    10631161    <p>
    10641162  </li>
     
    15091607      <th>Raw data file</th>
    15101608      <th>Spots inserted</th>
     1609      <th>Annotations created</th>
    15111610    </tr>
    15121611    <tr>
     
    15141613      <td>genepix.mouse.v4.37k.00h.gpr</td>
    15151614      <td>36,232</td>
     1615      <td><i>Dye swap</i>: false</td>
    15161616    </tr>
    15171617    <tr>
     
    15191619      <td>genepix.mouse.v4.37k.24h.gpr</td>
    15201620      <td>36,232</td>
     1621      <td><i>Dye swap</i>: false</td>
    15211622    </tr>   
    15221623    <tr class="shaded">
     
    15241625      <td>genepix.mouse.v4.37k.00h.dyeswap.gpr</td>
    15251626      <td>36,232</td>
     1627      <td><i>Dye swap</i>: true</td>
    15261628    </tr>
    15271629    <tr class="shaded">
     
    15291631      <td>genepix.mouse.v4.37k.24h.dyeswap.gpr</td>
    15301632      <td>36,232</td>
     1633      <td><i>Dye swap</i>: true</td>
    15311634    </tr>
    15321635    </table>
     
    15481651      <td>Raw bioassay A.00h,<br>Raw bioassay A.24h,<br>Raw bioassay A.00h (dye-swap),<br>
    15491652        Raw bioassay A.24h (dye-swap)</td>
    1550       <td>Drug resistance, Time (hours)</td>
     1653      <td>Drug resistance, Time (hours), Dye swap</td>
    15511654    </tr>
    15521655    <tr>
     
    15591662    <p>
    15601663  </li>
     1664 
     1665  <li>
     1666    Check the experiment overview page. It should display one warnings for the
     1667    Genepix experiment. The warning is related to a missing biosurce
     1668    on the reference sample.
     1669    <p>
     1670    The Affymetrix experiment gives some more warnings. Most of them are
     1671    related to not using the project default items, missing protocols
     1672    and missing hardware. There should also be an error about missing
     1673    experimental factor values for the <code>Affymetrix.3</code>
     1674    raw bioassay. It is expected since this comes from the reference sample
     1675    which doesn't have values for those annotations.
     1676    <p>
     1677   
     1678    Change validation options to reduce the number of warnings:
     1679    <table class="listing" cellspacing="0" cellpadding="2" border="0">
     1680    <tr>
     1681      <th>Validation option</th>
     1682      <th>Setting</th>
     1683    </tr>
     1684    <tr>
     1685      <td>Project defaults</td>
     1686      <td>Set all to <code>Ignore</code></td>
     1687    </tr>
     1688    <tr>
     1689      <td>Missing items</td>
     1690      <td>Set all to <code>Ignore</code></td>
     1691    </tr>
     1692    <tr>
     1693      <td>Annotations - Missing factor value</td>
     1694      <td><code>Warning</code></td>
     1695    </tr>
     1696    </table>
     1697   
     1698    After the changes there should now only be two warnings about the
     1699    missing factor values.
     1700   
     1701    <p>
     1702  </li>
     1703 
    15611704  </ol>
    15621705
  • trunk/src/test/net/sf/basedb/test/FileUtil.java

    r4020 r4025  
    8383      dc.saveItem(file);
    8484      InputStream toUpload = TestUtil.class.getResourceAsStream(path);
    85       if (isBzip)
     85      if (toUpload == null)
    8686      {
    87         // Remove 'BZ' marker at start of file
    88         toUpload.read();
    89         toUpload.read();
    90         toUpload = new CBZip2InputStream(toUpload);
    91        
     87        TestUtil.write("--NOT FOUND - skipping upload\n");
    9288      }
    93       file.upload(toUpload, false, true);
     89      else
     90      {
     91        if (isBzip)
     92        {
     93          // Remove 'BZ' marker at start of file
     94          toUpload.read();
     95          toUpload.read();
     96          toUpload = new CBZip2InputStream(toUpload);
     97        }
     98        file.upload(toUpload, false, true);
     99      }
    94100    }
    95101    return file;
  • trunk/src/test/net/sf/basedb/test/roles/AdminTest.java

    r3873 r4025  
    3636import net.sf.basedb.core.FileType;
    3737import net.sf.basedb.core.Group;
     38import net.sf.basedb.core.Location;
    3839import net.sf.basedb.core.MultiPermissions;
    3940import net.sf.basedb.core.Permission;
     
    124125      //Import reporters
    125126      PluginUtil.importReporters(reporterImporter, reporters, "Importing reporters for project A");
    126       PluginUtil.importReporters(affyReporterImporter, affyReporters, "Importing Affymetrix reporter for project A");
     127      if (affyReporters.getLocation() == Location.PRIMARY)
     128      {
     129        PluginUtil.importReporters(affyReporterImporter, affyReporters, "Importing Affymetrix reporter for project A");
     130      }
    127131      TestUtil.logout();
    128132    }
  • trunk/src/test/net/sf/basedb/test/roles/AnalysisTest.java

    r3675 r4025  
    2323*/
    2424package net.sf.basedb.test.roles;
     25
     26import java.util.List;
    2527
    2628import net.sf.basedb.core.BioAssaySet;
     
    3335import net.sf.basedb.core.Job;
    3436import net.sf.basedb.core.PluginDefinition;
     37import net.sf.basedb.core.Project;
    3538import net.sf.basedb.core.RawBioAssay;
    3639import net.sf.basedb.core.RawDataTypes;
     
    3841import net.sf.basedb.test.PluginUtil;
    3942import net.sf.basedb.test.TestUtil;
     43import net.sf.basedb.util.overview.ExperimentOverview;
     44import net.sf.basedb.util.overview.Failure;
     45import net.sf.basedb.util.overview.Severity;
     46import net.sf.basedb.util.overview.ValidationOptions;
     47import net.sf.basedb.util.overview.Validator;
    4048
    4149/**
     
    6573      dc = TestUtil.getDbControl();
    6674      Experiment experiment = Util.findExperiment(dc, "Experiment A");
     75      Experiment affyExperiment = Util.findExperiment(dc, "Affymetrix A");
     76      Project activeProject = Project.getById(dc, TestUtil.getSessionControl().getActiveProjectId());
     77     
     78      ValidationOptions options = new ValidationOptions();
     79      // Expected, since we never specified a biosource for the reference sample
     80      options.setSeverity(Validator.MISSING_BIOSOURCE, Severity.IGNORE);
     81      ExperimentOverview overview = getExperimentOverview(experiment,
     82        activeProject, options, 0);
     83     
     84      // Expected, since the Affymetrix experiment is using a different platform
     85      options.setSeverity(Validator.NONDEFAULT_PLATFORM, Severity.IGNORE);
     86      options.setSeverity(Validator.NONDEFAULT_RAWDATATYPE, Severity.IGNORE);
     87      options.setSeverity(Validator.NONDEFAULT_ARRAYDESIGN, Severity.IGNORE);
     88      options.setSeverity(Validator.MISSING_HARDWARE, Severity.IGNORE);
     89      options.setSeverity(Validator.MISSING_PROTOCOL, Severity.IGNORE);
     90      ExperimentOverview affyOverview = getExperimentOverview(affyExperiment,
     91        activeProject, options, 2);
     92     
    6793      Formula formula = Util.findFormula(dc, RawDataTypes.getRawDataType("genepix"), Formula.Type.INTENSITY_EXPRESSION, "Mean FG - Mean BG");
    6894      dc.close();
     
    194220  }
    195221
    196  
     222  public static ExperimentOverview getExperimentOverview(Experiment experiment,
     223    Project project, ValidationOptions options, int expected)
     224  {
     225    TestUtil.write("--Getting overview for experiment: " + experiment.getName() + "\n");
     226    ExperimentOverview overview = ExperimentOverview.getOverview(experiment, project);
     227    List<Failure> failures = overview.getFailures();
     228    int i = 0;
     229    for (Failure f : failures)
     230    {
     231      Severity severity = options.getSeverity(f.getValidator());
     232      if (severity != Severity.IGNORE)
     233      {
     234        i++;
     235        TestUtil.write("  " + i + ". " + severity + ": " + f.getMessage() + ": " + f.getNode().getItem() + "\n");
     236      }
     237    }
     238    if (i == 0)
     239    {
     240      TestUtil.write("  No errors or warnings\n");
     241    }
     242    if (i == expected)
     243    {
     244      TestUtil.write("--We expected " + expected + " warnings so this is probably ok.\n");
     245    }
     246    else
     247    {
     248      TestUtil.write("--Unexpected number of warnings: " + i + "; expected " +
     249        expected + "\n");
     250    }
     251    return overview;
     252  }
    197253}
  • trunk/src/test/net/sf/basedb/test/roles/PowerUserTest.java

    r3873 r4025  
    5555import net.sf.basedb.core.Protocol;
    5656import net.sf.basedb.core.ProtocolType;
     57import net.sf.basedb.core.RawDataType;
     58import net.sf.basedb.core.RawDataTypes;
    5759import net.sf.basedb.core.Software;
    5860import net.sf.basedb.core.SoftwareType;
     
    128130        );
    129131      AnnotationType hours = createAnnotationType(dc, "Time (hours)", Type.INT, null,
    130           new Item[] { Item.SAMPLE } );
     132          new Item[] { Item.SAMPLE }
     133        );
     134     
     135      AnnotationType dyeSwap = createAnnotationType(dc, "Dye swap", Type.BOOLEAN, null,
     136          new Item[] { Item.RAWBIOASSAY }
     137        );
    131138     
    132139      PlateType plateType = createPlateType(dc, "Plate type A", 16, 24);
     
    142149      PluginConfiguration rawDataImporter = PluginUtil.createPluginConfiguration(dc, "Raw data for project A",
    143150          "net.sf.basedb.plugins.RawDataFlatFileImporter", MouseData.getGenePixRawDataParameters(false));
    144 
     151      Util.setAnnotation(rawDataImporter, dyeSwap, false);
     152     
    145153      PluginConfiguration rawDataImporterDyeSwap = PluginUtil.createPluginConfiguration(dc, "Raw data for project A (dye-swap)",
    146154          "net.sf.basedb.plugins.RawDataFlatFileImporter", MouseData.getGenePixRawDataParameters(true));
     155      Util.setAnnotation(rawDataImporterDyeSwap, dyeSwap, true);
    147156     
    148157      dc.commit();
     
    169178     
    170179      dc = TestUtil.getDbControl();
     180      RawDataType genepix = RawDataTypes.getRawDataType("genepix");
     181      p = Project.getById(dc, p.getId());
     182      p.setDefaultItem(dc, genericPlatform, Project.Default.PLATFORM);
     183      p.setDefaultRawDataType(genepix);
     184      p.setDefaultItem(dc, design, Project.Default.ARRAYDESIGN);
     185      p.setDefaultItem(dc, software, Project.Default.SOFTWARE);
     186      p.setDefaultItem(dc, hybStation, Project.Default.HYBRIDIZATION_HARDWARE);
     187      p.setDefaultItem(dc, scanner, Project.Default.SCANNER_HARDWARE);
     188      p.setDefaultItem(dc, robot, Project.Default.PRINTROBOT_HARDWARE);
     189      p.setDefaultItem(dc, scanning, Project.Default.SCANNING_PROTOCOL);
     190      p.setDefaultItem(dc, sampling, Project.Default.SAMPLING_PROTOCOL);
     191      p.setDefaultItem(dc, extraction, Project.Default.EXTRACTING_PROTOCOL);
     192      p.setDefaultItem(dc, labeling, Project.Default.LABELING_PROTOCOL);
     193      p.setDefaultItem(dc, hybridization, Project.Default.HYBRIDIZATION_PROTOCOL);
     194      p.setDefaultItem(dc, feature, Project.Default.FEATURE_EXTRACTION_PROTOCOL);
     195      p.setDefaultItem(dc, printing, Project.Default.PRINTING_PROTOCOL); 
     196     
    171197      ArrayBatch batch = createArrayBatch(dc, "Array batch A", design, robot, printing);
    172198      ArraySlide slide1 = createArraySlide(dc, "Array slide A.1", batch, 1);
  • trunk/src/test/net/sf/basedb/test/roles/UserTest.java

    r3873 r4025  
    199199      dc.commit();
    200200     
    201       // Analysis
     201      // Experiment overview and Analysis
    202202      AnalysisTest.run("user");
    203203     
     
    403403        experiment.addExperimentalFactor(a.getAnnotationType());
    404404      }
     405      for (Annotation a : as.getAnnotations().list(dc))
     406      {
     407        experiment.addExperimentalFactor(a.getAnnotationType());
     408      }
    405409    }
    406410   
Note: See TracChangeset for help on using the changeset viewer.