Changeset 6958
- Timestamp:
- Sep 30, 2015, 2:55:14 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/test/roles/index.html
r6124 r6958 2127 2127 </li> 2128 2128 2129 <li><a name="inheritannotations"></a>2130 Inherit the annotations from the scans, extracts, samples and biosource for each raw bioassay.2131 Use the <i>auto-inherit</i> function that exists on the experiment properties2132 tab. Make sure that all experimental factors are selected by the check boxes,2133 then click on the <i>Auto-inherit</i> link in the column header. <br>2134 <b>Note!</b> The <i>Dye swap</i>2135 annotation will not get values until the next step, and the <i>Affymetrix raw A.3</i>2136 data set is missing biomaterial parents with annotations.<br>2137 <b>Note 2!</b> In <i>Experiment A</i> there are duplicate values for the <i>RIN</i>2138 annotations. Fix this by manually removing the annotations that are inherited from2139 the <i>Extract A.ref.qc</i> extract.2140 <p>2141 2142 </li>2143 2144 2129 <li> 2145 2130 Import raw data to the Genepix and Cufflinks raw bioassays. … … 2242 2227 2243 2228 </li> 2229 2230 <li><a name="inheritannotations"></a> 2231 Inherit the annotations from the scans, extracts, samples and biosource for each root raw bioassay. 2232 Use the <i>auto-inherit</i> function that exists on the experiment properties 2233 tab. Make sure that all experimental factors are selected by the check boxes, 2234 then click on the <i>Auto-inherit</i> link in the column header. Use the <b>Inherit</b> 2235 option for some annotations and <b>Clone</b> option for some. Uncheck the <b>No duplicates</b> 2236 option for the <i>RIN</i> annotation (see note 2 below). 2237 <br> 2238 <b>Note!</b> The <i>Affymetrix raw A.3</i> 2239 data set is missing biomaterial parents with annotations.<br> 2240 <b>Note 2!</b> In <i>Experiment A</i> there are duplicate values for the <i>RIN</i> 2241 annotations. Verify and fix this by manually removing the annotations that are inherited 2242 from the <i>Extract A.ref.qc</i> extract (value=9.2). 2243 <p> 2244 2245 </li> 2246 2244 2247 2245 2248 <li> -
trunk/src/clients/web/net/sf/basedb/clients/web/Base.java
r6955 r6958 1431 1431 // oldItem.getAnnotationSet() : null; 1432 1432 AnnotationSet newAs = newItem.getAnnotationSet(); 1433 /*if (oldItem == newItem)1433 if (oldItem == newItem) 1434 1434 { 1435 1435 // The items were not loaded in separate sessions, the protocol has to be … … 1438 1438 if (p != null) dc.reattachItem(p, false); 1439 1439 } 1440 */1441 1440 1442 1441 for (int entryNo = 0; entryNo < jsonModified.size(); entryNo++) -
trunk/src/core/net/sf/basedb/core/Experiment.java
r6915 r6958 733 733 734 734 /** 735 Get the root raw bioassay that represents the given raw bioassay 736 in this experiment. 737 @return A root raw bioassay object or null if the given 738 raw bioassay is not part of the experiment 739 @since 3.6 740 */ 741 public RootRawBioAssay getRootRawBioAssay(RawBioAssay raw) 742 { 743 RootRawBioAssayData root = getData().getRootRawBioAssays().get(raw.getData()); 744 return getDbControl().getItem(RootRawBioAssay.class, root); 745 } 746 747 /** 735 748 Create a new root transformation for this experiment. 736 749 @param job The job that executed the transformation -
trunk/src/test/net/sf/basedb/test/roles/UserTest.java
r6921 r6958 23 23 24 24 import net.sf.basedb.core.Annotatable; 25 import net.sf.basedb.core.Annotation;26 25 import net.sf.basedb.core.AnnotationSet; 27 26 import net.sf.basedb.core.AnnotationType; … … 57 56 import net.sf.basedb.core.RawDataType; 58 57 import net.sf.basedb.core.RawDataTypes; 58 import net.sf.basedb.core.RootRawBioAssay; 59 59 import net.sf.basedb.core.Sample; 60 60 import net.sf.basedb.core.Software; … … 359 359 seqRaw2 = Util.findRawBioAssay(dc, "SeqRaw A.24h"); 360 360 361 inheritAnnotations(dc, rba1, s1, e1Qc, bioSource, sc1);362 inheritAnnotations(dc, rba2, s2, e2Qc, bioSource, sc2);363 inheritAnnotations(dc, rba1DyeSwap, s1, e1Qc, bioSource, sc1DyeSwap);364 inheritAnnotations(dc, rba2DyeSwap, s2, e2Qc, bioSource, sc2DyeSwap);365 366 // Affymetrix367 inheritAnnotations(dc, affyRaw1, s1, e1Qc, bioSource, affyScan1);368 inheritAnnotations(dc, affyRaw2, s2, e2Qc, bioSource, affyScan2);369 inheritAnnotations(dc, affyRaw3, sRef, eRefQc, affyScan3);370 371 // Sequence372 inheritAnnotations(dc, seqRaw1, s1, e1Qc, bioSource);373 inheritAnnotations(dc, seqRaw2, s2, e2Qc, bioSource);374 375 361 PluginConfiguration rawDataImporter = Util.findPluginConfiguration(dc, "Raw data for project A"); 376 362 PluginConfiguration rawDataImporterDyeSwap = Util.findPluginConfiguration(dc, "Raw data for project A (dye-swap)"); … … 386 372 importRawData(seqRawImporter, seqData1, seqRaw1); 387 373 importRawData(seqRawImporter, seqData2, seqRaw2); 388 374 389 375 // Experiment 390 376 dc = TestUtil.getDbControl(); 391 Experiment exp1 = createExperiment(dc, "Experiment A", 392 RawDataTypes.getSafeRawDataType("genepix"), rba1, rba2, rba1DyeSwap, rba2DyeSwap); 393 Experiment affyExperiment = createExperiment(dc, "Affymetrix A", 394 affymetrixPlatform.getRawDataType(), affyRaw1, affyRaw2, affyRaw3); 395 Experiment seqExperiment = createExperiment(dc, "Sequence A", 396 RawDataTypes.getSafeRawDataType("cufflinks"), seqRaw1, seqRaw2); 377 AnnotationType drugResistance = Util.findAnnotationType(dc, "Drug resistance", Item.BIOSOURCE); 378 AnnotationType dyeSwap = Util.findAnnotationType(dc, "Dye swap", Item.RAWBIOASSAY); 379 AnnotationType pmtGain = Util.findAnnotationType(dc, "PMT gain", Item.DERIVEDBIOASSAY); 380 AnnotationType rin = Util.findAnnotationType(dc, "RIN", Item.EXTRACT); 381 AnnotationType timeAnnotation = Util.findAnnotationType(dc, "Time", Item.SAMPLE); 382 383 Experiment exp1 = createExperiment(dc, "Experiment A", RawDataTypes.getSafeRawDataType("genepix"), 384 rawBioAssays(rba1, rba2, rba1DyeSwap, rba2DyeSwap), 385 experimentalFactors(drugResistance, dyeSwap, pmtGain, rin, timeAnnotation) 386 ); 387 Experiment affyExperiment = createExperiment(dc, "Affymetrix A", affymetrixPlatform.getRawDataType(), 388 rawBioAssays(affyRaw1, affyRaw2, affyRaw3), 389 experimentalFactors(drugResistance, pmtGain, rin, timeAnnotation) 390 ); 391 Experiment seqExperiment = createExperiment(dc, "Sequence A", RawDataTypes.getSafeRawDataType("cufflinks"), 392 rawBioAssays(seqRaw1, seqRaw2), 393 experimentalFactors(drugResistance, rin, timeAnnotation) 394 ); 395 dc.commit(); 396 397 // Experimental factors 398 // Experiment A 399 dc = TestUtil.getDbControl(); 400 inheritExperimentalFactors(dc, exp1, rba1, s1, e1Qc, bioSource, sc1); 401 inheritExperimentalFactors(dc, exp1, rba2, s2, e2Qc, bioSource, sc2); 402 inheritExperimentalFactors(dc, exp1, rba1DyeSwap, s1, e1Qc, bioSource, sc1DyeSwap); 403 inheritExperimentalFactors(dc, exp1, rba2DyeSwap, s2, e2Qc, bioSource, sc2DyeSwap); 404 405 // Affymetrix 406 inheritExperimentalFactors(dc, affyExperiment, affyRaw1, s1, e1Qc, bioSource, affyScan1); 407 inheritExperimentalFactors(dc, affyExperiment, affyRaw2, s2, e2Qc, bioSource, affyScan2); 408 inheritExperimentalFactors(dc, affyExperiment, affyRaw3, sRef, eRefQc, affyScan3); 409 410 // Sequence 411 inheritExperimentalFactors(dc, seqExperiment, seqRaw1, s1, e1Qc, bioSource); 412 inheritExperimentalFactors(dc, seqExperiment, seqRaw2, s2, e2Qc, bioSource); 397 413 dc.commit(); 398 414 … … 415 431 } 416 432 433 public static RawBioAssay[] rawBioAssays(RawBioAssay... rba) 434 { 435 return rba; 436 } 437 438 public static AnnotationType[] experimentalFactors(AnnotationType... annotationTypes) 439 { 440 return annotationTypes; 441 } 442 417 443 /** 418 444 Create a biosource. … … 679 705 680 706 /** 681 Inherit all annotations from the parent. 682 */ 683 public static void inheritAnnotations(DbControl dc, Annotatable item, Annotatable... parents) 684 { 685 AnnotationSet as = item.getAnnotationSet(); 707 Inherit all annotations to the root raw bioassay from the 708 raw bioassay and other parents. 709 */ 710 public static void inheritExperimentalFactors(DbControl dc, Experiment experiment, RawBioAssay raw, Annotatable... parents) 711 { 712 experiment = Experiment.getById(dc, experiment.getId()); 713 raw = RawBioAssay.getById(dc, raw.getId()); 714 RootRawBioAssay root = experiment.getRootRawBioAssay(raw); 715 AnnotationSet as = root.getAnnotationSet(); 716 if (raw.isAnnotated()) as.inheritAll(raw.getAnnotationSet(), false); 686 717 for (Annotatable parent : parents) 687 718 { … … 726 757 Create an experiment. 727 758 */ 728 public static Experiment createExperiment(DbControl dc, String name, RawDataType rawDataType, RawBioAssay ... rawBioAssays)759 public static Experiment createExperiment(DbControl dc, String name, RawDataType rawDataType, RawBioAssay[] rawBioAssays, AnnotationType[] experimentalFactors) 729 760 { 730 761 TestUtil.write("--Creating experiment: " + name + "\n"); … … 732 763 experiment.setName(name); 733 764 734 for (RawBioAssay rba : rawBioAssays) 735 { 736 rba = RawBioAssay.getById(dc, rba.getId()); // To get the latest information 737 experiment.addRawBioAssay(rba); 738 739 AnnotationSet as = rba.getAnnotationSet(); 740 for (Annotation a : as.getAnnotations(null).list(dc)) 765 if (rawBioAssays != null) 766 { 767 for (RawBioAssay rba : rawBioAssays) 741 768 { 742 experiment.addExperimentalFactor(a.getAnnotationType()); 769 experiment.addRawBioAssay(rba); 770 } 771 } 772 773 if (experimentalFactors != null) 774 { 775 for (AnnotationType at : experimentalFactors) 776 { 777 experiment.addExperimentalFactor(at); 743 778 } 744 779 }
Note: See TracChangeset
for help on using the changeset viewer.