示例#1
0
 // test multiple derived data with no scan , multiple normalizations.
 @Test
 public void testNoScanWithNorm() {
   MageTabDocumentSet ds = getDocumentSet(TestMageTabSets.MULTI_NO_SCAN_2_INPUT_SET);
   CaArrayFileSet fileSet = TestMageTabSets.getFileSet(ds);
   CaArrayTranslationResult result = this.translator.translate(ds, fileSet);
   Experiment experiment = result.getInvestigations().iterator().next();
   Hybridization hyb = experiment.getHybridizations().iterator().next();
   checkPaCollection(hyb.getProtocolApplications(), "Scan");
   RawArrayData rad = hyb.getRawDataCollection().iterator().next();
   checkPaCollection(
       rad.getProtocolApplications(),
       "normalization-protocol-1",
       "normalization-protocol-2",
       "derived-data-protocol-1",
       "derived-data-protocol-2");
   for (DerivedArrayData d : hyb.getDerivedDataCollection()) {
     if (d.getName().equals("test.data")) {
       checkPaCollection(d.getProtocolApplications());
     } else if (d.getName().equals("test2.data")) {
       checkPaCollection(d.getProtocolApplications());
     } else {
       fail(d.getName());
     }
   }
 }
示例#2
0
 // test normalization protocols end up in raw data.
 @Test
 public void testNormal_3() {
   MageTabDocumentSet ds = getDocumentSet(TestMageTabSets.NORMAL_3_INPUT_SET);
   CaArrayFileSet fileSet = TestMageTabSets.getFileSet(ds);
   CaArrayTranslationResult result = this.translator.translate(ds, fileSet);
   Experiment experiment = result.getInvestigations().iterator().next();
   Hybridization hyb = experiment.getHybridizations().iterator().next();
   RawArrayData rad = hyb.getRawDataCollection().iterator().next();
   checkPaCollection(rad.getProtocolApplications(), "TRANPRTCL10656", "derived-data-protocol");
   DerivedArrayData dad = hyb.getDerivedDataCollection().iterator().next();
   checkPaCollection(dad.getProtocolApplications());
 }
示例#3
0
 @Test
 public void testNoNormNoDerivedData() {
   MageTabDocumentSet ds = getDocumentSet(TestMageTabSets.NO_DERIVED_2_INPUT_SET);
   CaArrayFileSet fileSet = TestMageTabSets.getFileSet(ds);
   CaArrayTranslationResult result = this.translator.translate(ds, fileSet);
   Experiment experiment = result.getInvestigations().iterator().next();
   Hybridization hyb = experiment.getHybridizations().iterator().next();
   checkPaCollection(hyb.getProtocolApplications(), "Scan");
   RawArrayData rad = hyb.getRawDataCollection().iterator().next();
   checkPaCollection(rad.getProtocolApplications(), "TRANPRTCL10656");
   assertTrue(hyb.getDerivedDataCollection().isEmpty());
 }
示例#4
0
  private void mergeTranslatedData(Experiment originalExperiment, Experiment translatedExperiment) {
    originalExperiment.getArrayDesigns().addAll(translatedExperiment.getArrayDesigns());
    originalExperiment.setDate(translatedExperiment.getDate());
    originalExperiment.setDescription(translatedExperiment.getDescription());
    mergeFactors(originalExperiment, translatedExperiment);
    originalExperiment
        .getExperimentDesignTypes()
        .addAll(translatedExperiment.getExperimentDesignTypes());
    originalExperiment.getNormalizationTypes().addAll(translatedExperiment.getNormalizationTypes());
    originalExperiment.getPublications().addAll(translatedExperiment.getPublications());
    originalExperiment
        .getQualityControlTypes()
        .addAll(translatedExperiment.getQualityControlTypes());
    originalExperiment.getReplicateTypes().addAll(translatedExperiment.getReplicateTypes());
    mergeExperimentContacts(originalExperiment, translatedExperiment);

    originalExperiment.getHybridizations().addAll(translatedExperiment.getHybridizations());
    this.projectDao.save(originalExperiment.getHybridizations());

    for (final LabeledExtract le : translatedExperiment.getLabeledExtracts()) {
      le.setExperiment(originalExperiment);
      originalExperiment.getLabeledExtracts().add(le);
    }
    this.projectDao.save(originalExperiment.getLabeledExtracts());
    for (final Extract e : translatedExperiment.getExtracts()) {
      e.setExperiment(originalExperiment);
      originalExperiment.getExtracts().add(e);
    }
    this.projectDao.save(originalExperiment.getExtracts());
    for (final Sample s : translatedExperiment.getSamples()) {
      s.setExperiment(originalExperiment);
      originalExperiment.getSamples().add(s);
    }
    this.projectDao.save(originalExperiment.getSamples());
    for (final Source s : translatedExperiment.getSources()) {
      s.setExperiment(originalExperiment);
      originalExperiment.getSources().add(s);
    }
    this.projectDao.save(originalExperiment.getSources());
  }
示例#5
0
 @Test
 public void testNormal_1() {
   MageTabDocumentSet ds = getDocumentSet(TestMageTabSets.NORMAL_1_INPUT_SET);
   CaArrayFileSet fileSet = TestMageTabSets.getFileSet(ds);
   CaArrayTranslationResult result = this.translator.translate(ds, fileSet);
   Experiment experiment = result.getInvestigations().iterator().next();
   Hybridization hyb = experiment.getHybridizations().iterator().next();
   checkPaCollection(hyb.getProtocolApplications(), "Scan");
   for (RawArrayData rad : hyb.getRawDataCollection()) {
     if (rad.getName().equals("test1.CEL")) {
       checkPaCollection(rad.getProtocolApplications());
     } else if (rad.getName().equals("test2.CEL")) {
       checkPaCollection(rad.getProtocolApplications(), "TRANPRTCL10656");
     } else {
       fail(rad.getName());
     }
   }
   DerivedArrayData dad = hyb.getDerivedDataCollection().iterator().next();
   checkPaCollection(dad.getProtocolApplications());
 }