Changeset 5314


Ignore:
Timestamp:
Apr 16, 2010, 12:46:12 PM (12 years ago)
Author:
Nicklas Nordborg
Message:

References #1397: Function to inherit annotations for all experimental factors in the experimental factors table

Fixed a NullPointerException? that happened when the item to inherit annotations to doesn't have any annotations already.

Updated test documentation to reflect changes in the gui.

Location:
branches/2.15-stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.15-stable/doc/test/roles/index.html

    r5144 r5314  
    17781778    Inherit the annotations from the scans, samples and biosource for each raw bioassay.
    17791779    Use the <i>auto-inherit</i> function that exists on the experiment properties
    1780     tab. The <i>Status</i> column in <i>Experimental factors</i> table should indicate
    1781     the number of raw bioassays that is missing a value. Click on this warning to
    1782     automatically inherit annotations from the parents. Note! The <i>Dye swap</i>
     1780    tab. Make sure that all experimental factors are selected by the check boxes,
     1781    then click on the <i>Auto-inherit</i> link in the column header.
     1782    Note! The <i>Dye swap</i>
    17831783    annotation will not get values until the next step, and the <i>Affymetrix raw A.3</i>
    1784     data set doesn't have any parents with annotations.
     1784    data set is missing biomaterial parents with annotations.
    17851785    <p>
    17861786
  • branches/2.15-stable/src/core/net/sf/basedb/core/AnnotationSet.java

    r5176 r5314  
    791791    AnnotationSetSnapshot snapshot = manager.getSnapshot(dc, getId());
    792792    AnnotationTypeFilter atFilter = new AnnotationTypeFilter();
    793     for (AnnotationType at : annotationTypes)
    794     {
    795       atFilter.setAnnotationType(at);
    796       if (manager.findAnnotations(dc, snapshot, atFilter, true).size() == 0)
     793    if (snapshot == null)
     794    {
     795      // If snapshot==null this annotation set is new and unsaved
     796      // and doesn't have any annotations
     797      missing.addAll(annotationTypes);
     798    }
     799    else
     800    {
     801      for (AnnotationType at : annotationTypes)
    797802      {
    798         missing.add(at);
     803        atFilter.setAnnotationType(at);
     804        if (manager.findAnnotations(dc, snapshot, atFilter, true).size() == 0)
     805        {
     806          missing.add(at);
     807        }
    799808      }
    800809    }
  • branches/2.15-stable/src/core/net/sf/basedb/core/snapshot/SnapshotManager.java

    r5185 r5314  
    9090      the database cache
    9191    @param annotationSetId The id of the annotation set
    92     @return A snapshot
     92    @return A snapshot, or null if the annotation set with the given
     93     id doesn't exists
    9394  */
    9495  public AnnotationSetSnapshot getSnapshot(DbControl dc, int annotationSetId)
     
    106107      // As a last resort, create a new snapshot and cache it
    107108      snapshot = AnnotationSet.createSnapshot(dc, annotationSetId);
    108       cache.store(cacheKey, snapshot, 1000);
     109      if (snapshot != null) cache.store(cacheKey, snapshot, 1000);
    109110    }
    110111    snapshots.put(annotationSetId, snapshot);
Note: See TracChangeset for help on using the changeset viewer.